摘要 :
Type systems typically only define the conditions under which an expression is well-typed, leaving ill-typed expressions formally meaningless. This approach is insufficient as the basis for language servers driving modern programm...
展开
Type systems typically only define the conditions under which an expression is well-typed, leaving ill-typed expressions formally meaningless. This approach is insufficient as the basis for language servers driving modern programming environments, which are expected to recover from simultaneously localized errors and continue to provide a variety of downstream semantic services. This paper addresses this problem, contributing the first comprehensive formal account of total type error localization and recovery: the marked lambda calculus. In particular, we define a gradual type system for expressions with marked errors, which operate as non-empty holes, together with a total procedure for marking arbitrary unmarked expressions. We mechanize the metatheory of the marked lambda calculus in Agda and implement it, scaled up, as the new basis for Hazel, a full-scale live functional programming environment with, uniquely, no meaningless editor states. The marked lambda calculus is bidirectionally typed, so localization decisions are systematically predictable based on a local flow of typing information. Constraint-based type inference can bring more distant information to bear in discovering inconsistencies but this notoriously complicates error localization. We approach this problem by deploying constraint solving as a type-hole-filling layer atop this gradual bidirectionally typed core. Errors arising from inconsistent unification constraints are localized exclusively to type and expression holes, i.e. the system identifies unfillable holes using a system of traced provenances, rather than localized in an ad hoc manner to particular expressions. The user can then interactively shift these errors to particular downstream expressions by selecting from suggested partially consistent type hole fillings, which returns control back to the bidirectional system. We implement this type hole inference system in Hazel.
收起
摘要 :
This study includes a general description of the Earth’s karst types based on literary data and field observations. An improved classification of karst types distinguishes the main group, group, and subgroup; and, a division of k...
展开
This study includes a general description of the Earth’s karst types based on literary data and field observations. An improved classification of karst types distinguishes the main group, group, and subgroup; and, a division of karst types involves a main karst type, karst type, subtype, variety, and non-individual karst type. The relation between karst type and karst area is described. The role of various characteristics of karsts in the development of primary, secondary, and tertiary karst types is analyzed. Their structure is studied, which includes a geomorphic agent, process, feature, feature assemblage, karst system and the characteristics of the bearing karst area. Dominant, tributary, and accessory features are distinguished. The conditions of the stability and the development of types are studied, transformation ways are classified, and the effect of climate on types is described.
收起
摘要 :
The singular and regular type of a point on a real hypersurface in are shown to agree when the regular type is strictly less than 4. If is pseudoconvex, we show they agree when the regular type is 4. A non-pseudoconvex example is ...
展开
The singular and regular type of a point on a real hypersurface in are shown to agree when the regular type is strictly less than 4. If is pseudoconvex, we show they agree when the regular type is 4. A non-pseudoconvex example is given where the regular type is 4 and the singular type is infinite.
收起
摘要 :
Polymorphic variants are a useful feature of the OCaml language whose current definition and implementation rely on kinding constraints to simulate a subtyping relation via unification. This yields an awkward formalization and res...
展开
Polymorphic variants are a useful feature of the OCaml language whose current definition and implementation rely on kinding constraints to simulate a subtyping relation via unification. This yields an awkward formalization and results in a type system whose behaviour is in some cases unintuitive and/or unduly restrictive.
收起
摘要 :
We present a linear functional calculus with both the safety guarantees expressible with linear types and the rich language of combinators and composition provided by functional programming. Unlike previous combinations of linear ...
展开
We present a linear functional calculus with both the safety guarantees expressible with linear types and the rich language of combinators and composition provided by functional programming. Unlike previous combinations of linear typing and functional programming, we compromise neither the linear side (for example, our linear values are first-class citizens of the language) nor the functional side (for example, we do not require duplicate definitions of compositions for linear and unrestricted functions). To do so, we must generalize abstraction and application to encompass both linear and unrestricted functions. We capture the typing of the generalized constructs with a novel use of qualified types. Our system maintains the metatheoretic properties of the theory of qualified types, including principal types and decidable type inference. Finally, we give a formal basis for our claims of expressiveness, by showing that evaluation respects linearity, and that our language is a conservative extension of existing functional calculi.
收起
摘要 :
This article is the second part of a two articles series about the definition of higher-order polymorphic functions in a type system with recursive types and set-theoretic type connectives (unions, intersections, and negations).
摘要 :
Even when programming in a statically typed language we every now and then encounter statically untypable values; such values result from interpreting values or from communicating with the outside world. To cope with this problem ...
展开
Even when programming in a statically typed language we every now and then encounter statically untypable values; such values result from interpreting values or from communicating with the outside world. To cope with this problem most languages include some form of dynamic types. It may be that the core language has been explicitly extended with such a type, or that one is allowed to live dangerously by using functions like unsafeCoerce. We show how, by a careful use of existentially and universally quantified types, one may achieve the same effect, without extending the language with new or unsafe features. The techniques explained are universally applicable, provided the core language is expressive enough; this is the case for the common implementations of Haskell. The techniques are used in the description of a type checking compiler that, starting from an expression term, constructs a typed function representing the semantics of that expression. In this function the overhead associated with the type checking is only once being paid for; in this sense we have thus achieved static type checking.
收起
摘要 :
This paper investigates Voevodsky's univalence axiom in intensional Martin-L?f type theory. In particular, it looks at how univalence can be derived from simpler axioms. We first present some existing work, collected together from...
展开
This paper investigates Voevodsky's univalence axiom in intensional Martin-L?f type theory. In particular, it looks at how univalence can be derived from simpler axioms. We first present some existing work, collected together from various published and unpublished sources; we then present a new decomposition of the univalence axiom into simpler axioms. We argue that these axioms are easier to verify in certain potential models of univalent type theory, particularly those models based on cubical sets. Finally we show how this decomposition is relevant to an open problem in type theory.
收起
摘要 :
We define a computational type theory combining the contentful equality structure of cartesian cubical type theory with internal parametricity primitives. The combined theory supports both univalence and its relational equivalent,...
展开
We define a computational type theory combining the contentful equality structure of cartesian cubical type theory with internal parametricity primitives. The combined theory supports both univalence and its relational equivalent, which we call relativity. We demonstrate the use of the theory by analyzing polymorphic functions between higher inductive types, observe how cubical equality regularizes parametric type theory, and examine the similarities and discrepancies between cubical and parametric type theory, which are closely related. We also abstract a formal interface to the computational interpretation and show that this also has a presheaf model.
收起
摘要 :
The purpose of this study was to determine the talar facet configuration of South Indian calcanei, measure the angle between the anterior and middle facet planes of these calcanei, and assess the relation between the above paramet...
展开
The purpose of this study was to determine the talar facet configuration of South Indian calcanei, measure the angle between the anterior and middle facet planes of these calcanei, and assess the relation between the above parameters and the degenerative changes in the subtalar joints. The angle between the anterior and middle talar facets was measured in 222 South Indian adult calcanei. The degree of sclerosis was measured on radiographs of the calcanei. Lipping and osteophytes around the joints were recorded by visual inspection. The facet patterns observed were fused anterior and middle facets (Type I), three separate facets (Type II), absence of the anterior facet (Type III), three merged facets (Type IV), and a new pattern of absent anterior and fused middle and posterior facets (Type V). An anterolateral impression was present in nine calcanei. Type I was the predominant pattern (72%). Type II configuration had the least mean angle (125 degrees) and had less number of calcanei with significant osteoarthritic changes. A wider angle was observed in Type I and Type III calcanei. Type IV and Type V were observed in only three and one calcanei, respectively. Lipping and osteophytes were observed in Type I to IV configurations. There was no correlation between the facet configuration and the radiological subchondral sclerosis in the posterior talar facet of the calcanei. This study reveals that the talar facet configuration of calcanei and the angle between the anterior and middle facets influence the stability of the subtalar joints and development of osteoarthritis.
收起