The Derivative of a Regular Type is its Type of OneHole Contexts


 Jared O’Neal’
 1 years ago
 Views:
Transcription
1 The erivative of a egular Type is its Type of neole Contexts Extended Abstract Conor McBride Abstract olymorphic regular types are treelike datatypes generated by polynomial type expressions over a set of free variables and closed under least fixed point. The equality types of Core ML can be expressed in this form. Given such a type expression with free, this paper shows a way to represent the onehole contexts for elements of within elements of, together with an operation which will plug an element of into the hole of such a context. nehole contexts are given as inhabitants of a regular type, computed generically from the syntactic structure of by a mechanism better known as partial differentiation. The relevant notion of containment is shown to be appropriately characterized in terms of derivatives and plugging in. The technology is then exploited to give the onehole contexts for subelements of recursive types in a manner similar to uet s zippers [ue97]. 1 ntroduction Gérard uet s delightful paper The Zipper [ue97] defines a representation of treelike data decomposed into a subtree of interest and its surroundings. e shows us informally how to equip a datatype with an associated type of zippers onehole contexts representing a tree with one subtree deleted. Zippers collect the subtrees forking off step by step from the path which starts at the hole and returns to the root. This type of contexts is thus independent of the particular tree being decomposed or the subtree in the hole. ecomposition is seen not as a kind of epartment of Computer Science, University of urham, subtraction, an operation inherently troubled by the need to subtract only smaller things from larger, but as the inversion of a kind of addition (see figure 1). = + Figure 1: a tree as a onehole context plus a subtree This paper exhibits a similar technique, defined more formally, which is generic for a large class of treelike data structures the regular datatypes. These are essentially the equality types of core ML, presented as polynomial type expressions closed under least fixed point. n particular, will define and characterize two operations: on types, computing for each regular recursive datatype its type of onehole contexts; on terms, computing a big term by plugging a small term into a onehole context. The first of these operations is given by recursion on the structure of the algebraic expressions which name types. As wrote down the rules corresponding to the empty type, the unit type, sums and products, was astonished to find that Leibniz had beaten me to them by several centuries: they were exactly the rules of differentiation had learned as a child. 1
2 1.1 Motivating Examples ow can we describe the onehole contexts of a recursive type? uet suggests that we regard them as journeys backwards from hole to root, recording what we pass by on the way. propose to follow his suggestion, except that will start at the root and work my way forwards to the hole. Both choices have their uses: backwards is better for tree editing applications, but the forwards approach is conceptually simpler. Consider such journeys within binary trees: btree leaf node btree btree At each point, we are either at the hole or we must step further in our journey is a list of steps, list btree for some appropriate step type btree, but what? At each step, we must record our binary choice of left or right, together with the btree we passed by. We may take btree bool btree We can define the plugging in operation as follows 1 btree btree btree true node false node!"!# list btree btree!"! $ btree % & (')'*!"! $ +$,!"!  We might define btree more algebraically as the sum (i.e. choice ) of the unique leaf with nodes pairing two subtrees powers denote repeated product: btree 1 btree 2 Correspondingly, we might write 1 uet would 2 btree Now imagine similar journeys list ttree for ternary trees: ttree 1 ttree 3 Each step chooses one of three directions, and remembers two bypassed trees, so ttree 3 ttree 2 t looks remarkably like the type of steps is calculated by differentiating the original datatype. n fact, this is exactly what is happening, as we shall see when we examine how to compute the description of the onehole contexts for regular datatypes. 2 resenting the egular Types n order to give a precise treatment of differentiating a datatype, we must be precise about the expressions which define them. n particular, the availability of fixed points requires us to consider the binding of fresh type variables. There is much activity in this area of research, but this is not the place to rehearse its many issues. The approach take in this paper relativizes regular type expressions to finite sequences of available free names. then explain how to interpret such expressions relative to an environment which interprets those names. choose to give inductive definitions in natural deduction style. Although this requires more space than the datatype declarations of conventional programming languages, they allow dependent families to be presented much more clearly: even nested types [BM98, B99] must be defined uniformly over their indices, whilst the full notion of family allows constructors to apply only at particular indices. also give type signatures to defined functions in this way, preferring to present the universal quantification inherent in their type dependency via schematic use of variables, rather than by complex and inscrutable formulae. 2
3 2.1 Sequences of istinct Names Let us presume the existence of an infinite 2 set Name of names, equipped with a decidable equality. We may think of Name as being string. The set NmSeq may then be defined to contain the finite sequences of distinct names. Each such sequence can be viewed forgetfully as a set. E NmSeq NmSeq Set NmSeq Name GF = NmSeq Name Set shall always use names in a wellfounded manner. The explanation of some name from some sequence will involve only prior names intuitively, those which have already been explained. t is therefore important to define for any such pair, the restriction G, being the sequence of names from prior to. NmSeq G NmSeq = = KML N G As equality on names is decidable, shall freely allow names to occur nonlinearly in patterns. n order to recover the disjointness of patterns without recourse to pri ML oritizing them, introduce the notation to mean any except. Correspondingly, each clause of such a definition holds (schematically) as an equation. nonetheless write to indicate a directed computation rule, reserving for equational propositions. 2.2 escribing the egular Types The regular types over given free names, or rather, the expressions which describe them are given by the inductive 2 By infinite, mean that can always choose a fresh name if need to create a new binding. family eg in figure 2. Firstly, we embed 3 type variables in eg, then we give the building blocks for polynomials and least fixed point. NmSeq eg Set eg 0 eg eg eg 1 eg eg eg = eg Q. eg = eg eg = eg eg = eg Figure 2: descriptions of regular types The last two constructors may seem mysterious. owever, the redundancy they introduce will save us work when we come to interpret these descriptions of types. We could choose to interpret only eg E, the closed descriptions, keeping the open types underwater like the dangerous bits of an iceberg. This would require us to substitute for free names whenever they become exposed, for example, when expanding a fixed point. We would in turn be forced to take account of the equational properties of substitutions and prove closure properties with respect to them. dispense with substitution. The alternative have adopted is to interpret open descriptions in environments which explain their free names. The two unusual constructors above perform the rôles of definition and weakening, respectively growing and shrinking the environment within their scope. efinition replaces substitution and weakening adds more free names without modifying old descriptions. This avoids the propagation of substitutions through the syntactic structure and hence concerns about capture we shall only ever interpret the value of a variable in its bindingtime environment. 3 n fact am abusing notation by suppressing a constructor symbol. 3
4 Y } 2.3 Type Environments A type environment for a given name sequence associates each in with a type description over the prior names, G. NmSeq Env Set E Env = E NmSeq Env = = Env eg We may equip environments with operators for restriction (extracting the prefix prior to a given name) and projection (looking up a name s associated type description). is the environment which explains the free names in TSU. Env G Env Env TSV G eg CWL = = KML = SV N = SV TSV 2.4 nterpreting the escriptions Now that we have the means to describe regular types, we must say which data are contained by the type with a given description, relative to an environment explaining its free names we must give a semantics to the syntax. Figure 3 defines the interpretation && inductively. 4 Note that have not supplied constructor symbols for the embedding rules corresponding to variablelookup, definition and weakening. These apparent conflations of types, e.g. && = with &&, are harmless, as the types tell us which embeddings are operative. 4 The semantic brackets do not represent a metalevel operation; they are intended to be a suggestive objectlevel syntax for a dependent family of types. Env && eg Set TSU && && && inl && && inr && XZY && # && && X 1 Y && = Q &&. con Q &&. = && && && = = && Figure 3: the data in regular types 2.5 Examples of egular Types Let us briefly examine some familiar types in this setting. We have the unit type 1, so we can use to build the booleans: []\^\_ `a7bmc ecfg0h c 1 1 X Y eg any inl X Y && any d inr && any d We may use Q to build recursive datatypes like the natural numbers and our tree examples, again for any and, as a fresh bound variable ( below) can always be chosen: idjwk Q. 1  l cvam X Y h con inl bmnpo o con inr [ kvq*r r Q. 1 v g c f*e stu XZY vww con inl m xwc y X con inr kvkzq{r r Q. 1 ` g c fe s] X Y t con inl ` w m xwc }~ X con inr X YY 4
5 Y ˆ ˆ Y We may use weakening to define an operation which computes list types: _ C k ww g Q. 1 XZY p con inl ' '{ƒ! X con inr ƒ! Y The finitely branching trees may thus be given by kvq*r r Q. _C k e w m xwc,! con! 2.6 Subterm rderings for egular Types Let us now define an inductive relation, ˆ(Š for && and &&, characterizing the subterms of a term in accounted for by s in. This relation characterizes s rôle as a container of s. omit the obvious wellformedness premises. Œˆ Tˆ ] = && Tˆ Tˆ Œˆ 9 ^Š inl Tˆ(Š Tˆ 9 ^Š inr Œˆ Tˆ Ž Š X Y Œˆ(Š Tˆ Ž Š X Œˆ( =. Œˆ. con Tˆ ˆ = Œˆ Œˆ(Š ˆ Š bserve that subterms accounted for by an in a composite type are characterized by a rule for each component of that type. n particular, the rules for a definition = find subterms due to s in and s in respectively, the latter occurring within subterms due to s in. Note that the latter rule exploits && the fact 9&& that we may see as inhabiting both and =. The effect of local type variables is thus reflected at their place of binding, rather than at their places of use. 5 The significance of the phrase accounted for by the s in is shown by this simple example: f we take E v m m g = `a7bwc = we can derive ˆ Ž X `a7bwc ecf g)h c Y ecf g)h c but not ˆ Ž X `7abWc ecfg0h c Y ecfg0h c The point is that has type on account of the in this particular s definition of, whereas, irrespective of, we can always derive ˆ Ž X owever, discharging the definition of in our example: Taking E v m m g = `a7bwc we can derive Ž = X `7abWc ecfg0h c Y ecf g)h c Ž = X `7abWc ecfg0h c Y and Both s are accounted for by the indicated type, and the derivations follow respectively by the two definition rules. A similar phenomenon occurs if we try to specialize this ordering to the _C s contained by a k, that is, to determine when tˆ. 1 Ž! nly the rule for fixed points applies, showing this derived rule to be complete: 1 ˆ š Ž Uœ =. 1 Ž Z! ˆ(ž Ÿ 5 con! The premise can only be further simplified by the definition rules: the direct rule finds only the head of the list in ; the indirect rule s second premise finds only the tail in, and the first demands that we search for an within that tail. We thus derive (and show complete) the two rules we might have hoped for: 5 t would be interesting to investigate a notion of subterm with a single rule for definitions capturing subterms within term :, remembering that really means : however, we would pay with extra complexity in the rule for variables, and with the need to carry extra environmental information explicitly. 5
6 ˆ(ž Ÿ25 ')'! tˆ žÿ25! ˆ(ž Ÿ25 ' '! We may exploit this containment relation to define the usual subterm relation for recursive types, namely ˆ. for Q &&., as follows: Tˆ. Tˆ. ˆ Tˆ. con That is, to find a subterm of con Q &&., either stop where you are, or move down one level to an contained by and repeat. ˆ cannot go further than one level, because is free in! [ With a little work, we can specialize these rules for kzq{r r to tˆ 5««tˆ, vww m xwc 5««ˆ, ª «"«9* 3 neole Contexts tˆ 5««ˆ, vww m x c ª «"«Let us now turn to the generic representation of onehole contexts for recursive regular types. We shall first need to see what one step is. The immediate recursive subterms in some con of type Q &&. are those subterms of which correspond to the occurrences of in recall that has type = Q &&.. We therefore need to describe the onehole contexts for s in s. Since may itself contain fixed points, the primitive operation we need to define will compute for the type of onehole contexts for any of its free names. This operation is exactly partial differentiation. 3.1 artial ifferentiation 9 The partial derivative of a regular type description with respect to a free name is computed by structural recursion over the syntax of. 6 t is defined in figure 4. eg eg 1 CML Q. Q^±. = Q ². = Q ². ± = = = 0 z³ Figure 4: partial differentiation The first six lines are familiar from calculus. For onehole contexts, they tell us that an contains one in trivial surroundings a other than contains no constants contain no we find an in an in either an or a we find an in an the, or (right) in the passing the either (left) in the, passing Note that partial differentiation is independent of environments: it is defined on the syntax of types alone. ust like the subterm ordering, it takes no account of the possibility that some might, for some, expand in terms of. owever, partial differentiation is the basic tool by which total differentiation is constructed, and this is exactly what we need when we go under a binder and become liable to encounter local names which potentially do conceal s. The rule for definitions again handles local variables at their place of binding, summing the types of contexts for 6 t is depressing how few mathematics teachers deign to impart this vital clue to calculus students, giving them rules but no method. learned differentiation from the pattern matching algorithm given in [McB70]. 6
7 ² È Á Á Á Á Î o Î ² Â É ² ² È s occurring directly in, and indirectly in an buried within a. n conventional calculus, this is effectively the chain rule extended to functions of two arguments µ U ¹ µ º» {¼ in the special case where is. ¹½ µ º» {¾ z ½ ¼¹ ¾ š œkà š œ nce we know how to differentiate definitions, we can make the leap to fixed points. f we expand the fixed point and apply the chain rule, we obtain: Q. = Q. = Q. = Q. Q. t is tempting to solve this recursive equation with a least fixed point, but does this give the correct type of onehole contexts? Yes: every inside a Q. must be a piece of payload data attached to some node buried at a finite depth. ence our journey takes us either to an at the outermost node and stops hence the in the base case or to a subnode and onwards hence the in the step case : it must stop eventually. We must weaken at ±, for ± is not free for. ur journey is clearly linear: the body of the fixed point is syntactically linear in ±. ndeed, the following set isomorphism holds, showing that our journey is a list of steps with a tip : Q^± ². ± &&^Á ) _ C k * && The rules for differentiating an explicit weakening simply shortcircuit the process if the name we seek is that being excluded. 3.2 Examples of erivatives Before we develop any more technology, let us check that partial differentiation is giving us the kind of answers we expect. f course, the types we get back will contain lots of 0 and 1, but the usual algebraic laws which simplify such expressions hold as set isomorphisms. t is also not hard to show that a recursive type with no base cases is empty: f =0 && Á 0 then Q. && Á 0 Writing Â for the o fold product of s and o for the sum of o 1 s, we can check (by induction on o ), that for oäã Å 9 Â && Á Viewed as a onehole context for o, the tells us which Â Æ Ç records the remaining s. the hole is at, while the p Â Æ^Ç A more involved example finds an within a list of s _ C k Q. 1 st Q^±. 1 st V _ C = k 1 s] 7V _C = k ± Q^±. _C = k p _C = k t ± ² _C k _ C k We would indeed hope that a onehole context for a list element is a pair of lists the prefix and the suffix! _ C Amusingly, the following power series resembles k, È È,Ì for p Í and conventional calculus tells us 3.3 lugging n È È,Ì tï Given a onehole context in and an, we should be able to construct a by plugging the in the hole. That is, we need an operation which behaves thus: && Ò Ð ^Ñ && È È,Ì Ï && Ò 7
8 Ñ Y Y Ñ Ð É Á ÒÓ && && Ò Ð ^Ñ && X YÔÐ ^Ñ inl Ò Ð ^Ñ inl Ò Ð ^Ñ inr Ò Ð ^Ñ inr Ò Ð X ^Ñ N inl X Ò YÔÐ ^Ñ X Ò Ð ^Ñ inr Ò YÔÐ ^Ñ X Ò Ð ^Ñ con X inl Ò Ð Q. ^Ñ con Ò Ð +Ñ; con inr Ò {Õ! Y Ð Q. ^Ñ con Ò Ð Õ! Ð Q. ^Ñ N7 X inl Ò Ð = ^Ñ Ò Ð +Ñ inr Ò Ò YÖÐ = ^Ñ Ò Ð Ò +Ñ; ÒŒ V³ uø Ò Ð +Ñ Figure 5: plugging in ow are we to define this operation? should tell us the shape of the term we are trying to build; Ò should tell us which path to take and also supply the subterms corresponding to the offpath components of pairs. n effect, the operation proceeds by structural recursion on Ò, but its flow of control involves a primary case analysis on. f course, we need only consider cases where is not 0. The definition is in figure 5. zùd[ Q. Q. eg ¹Ùd[ Q. eg _C k 9 = Q. nformally, an inhabitant of ¹Ù+[ Q. looks like 3.4 Subtrees in ecursive egular Types Ò Ç ')' Ò ')' ÝVÝzÝ Ò Â ' ' ww g The operation picks out s from containers for s. As suggested above, this gives us the tool we need to pick out subtrees from our treelike recursive datatypes, interpreting as a container for the immediate subtrees of con. ence our intuition that contexts for recursive type inhabit list can be made rigorous. The step type for trees in Q. is = Q. The onehole contexts for Q. thus inhabit ¹Ù+[ Q. given by 7 7 Abuse of notation ÚÛ Ü is really an operation on A few brief calculations reassure us that hence ¹Ùd[ _ C k && _C k && ¹Ù+[ zùd[ Q. && Á zùd[ Q zùd[þ[ &&. kvq*r r &&ßÁ _C k à [ kzq{r r && ¹Ù+[ kzkvq*r r && Á Gá2á _ C k Câ kzkvq*r r ¹Ùd[ä É kvq*r r && Á 5ãã á2á _ C k _C k kzq{r r É ã ã The corresponding notion of addition has the signature Õ!# ¹Ùd[ Q &&. Q Õ &&.!. Q &&. 8
9 ç è For the Õ Õ! depicted above and an appropriate, we expect!. to be con Ò Ç con Ò É con ÝVÝVÝ Ò Â f course,. list 8 : ww g Ò ' ' Õ!.. is defined by iterating Ð ^Ñ over the con Ò Ð ^Ñ Òz. bserve, for example, that {å æ really behaves like plus, whilst ž Ÿ 5 is ¹Ù+[ effectively append. t is not hard to show in general that Q. is a monoid under append and that. is an action of that monoid on Q Subterms and erivatives The relationship between the containment orderings and derivatives is an intimate one, and so too is that between the subtree orderings and the types computed by ¹Ù+[. n effect, the containment ordering is exactly that induced by plugging in, while the subtree ordering on Q. is induced by.. What we have done is to give a concrete representation for the witnesses to these relational properties. We may prove the following theorems: For && and && : Œˆ(Š äç è ÒÓ && Ý¹Ò Ð +Ñ; é ê Theorem (containment) Theorem (subtree) For º Œˆ. Q &&. : Õ!# zùd[ Q &&. Ý Õ!. ä ê The proofs of these theorems are easy inductions, on derivations for the ë direction, and on the structure of 8 Again, uet would write.)ì^121uí36 8ªîzï. ð,ñ <>òì7/ 8 îvï. ð. con.0ì(ó(bu ô ñ 6C6 Ò Õ or! for the õ direction. t is moreover the case that distinct Ò Õ s or! s on the right give rise to distinct derivations on the left, and vice versa. omit the details for reasons of space. 4 Towards an mplementation ecent extensions to the ASKELL type system, such as ansson and euring s LY have begun to realise the potential of generic programming for the development of highly reusable code, instantiable for a wide class of datatypes and characterised by equally generic theorems [97, BM98]. owever, these systems show no sign of allowing operations like which compute types generically by recursion over a closed syntax of type expressions, crucially regarding type variables as concrete objects. n a dependent type theory supporting inductive families of datatypes [yb91], syntaxes such as eg can be represented as ordinary data which can then be used to index the families like && which reflect them. becomes merely an operation on data, requiring no extension to the computational power of the theory. A programming language based on such a type theory, as envisaged in [McB99], would seem to be a promising setting in which to implement the technology described in this paper. This work is well under way in the ComputerAssisted easoning Group at urham. The payoffs from such an implementation seem likely to be substantial, extending far beyond applications to editing trees. A library of generic tools for working with contexts would allow us to define functions in terms of these higherlevel structures, manipulating data in large chunks, rather than one constructor at a time. Furthermore, in a dependently typed setting, a richer structure on data is ipso facto a richer structure on the indices of datatypes. t also seems highly desirable to extend the class of datatypes for which onehole contexts can be manipulated generically beyond the regular types, perhaps to include indexed families themselves. A concrete representation of onehole contexts for a syntax with binding has much to offer both metaprogramming and metatheory. 9
10 Â 5 Conclusions and Future Work This paper has shown that the onehole contexts for elements contained in a polymorphic regular type can be represented as the inhabitants of the regular type computed from the original by partial differentiation. This technology has been used to characterize data structures equivalent to uet s zippers onehole contexts for the subtrees of trees inhabiting arbitrary recursive types in that class. The operations which plug appropriate data into the holes of such contexts have also been exhibited. While this connection seems unlikely to be a mere coincidence, it is perhaps surprising to find a use for the laws of the infinitesimal calculus in such a discrete setting. There is no obvious notion of tangent or of limit for datatypes which might connect with our intuitions from school mathematics. Neither can offer at present any sense in which integration might mean more than just differentiation backwards. ne observation does, however, seem relevant: the syntactic operation of differentiating an expression with respect to generates an approximation to the change in value of that expression by summing the contributions generated by varying each of the s in the expression in turn. The derivative is thus the sum of terms corresponding to each onehole context for an in the expression. erhaps the key to the connection can be found by focusing not on what is being infinitesimally varied, but on what, for the sake of a linear approximation to the curve, is being kept the same. Apart from the implementation of this technology, and the development of a library of related generic utilities, this work opens up a host of fascinating theoretical possibilities one only has to open one s old school textbooks almost at random and ask what does this mean for datatypes?. There must surely also be a relationship between this work and oyal s general characterization of species of structure in terms of their Taylor series[oy87]. For regular types, NÉ makes a hole for a second in a onehole context from. More generally, gives all the o  hole contexts for s in s in each of the ouö orders with which they can be found. This strong resonance with Taylor series seems worthy of pursuit and is an active topic of research. n summary, the establishment of the connection between contexts and calculus is but the first step on a long road who knows where it will end? Acknowledgements feel very lucky to have stumbled on this interpretation of differentiation for datatypes with such potential for both utility and fascination, and has been intriguing me since the day made the connection (whilst changing trains at Shrewsbury). This work has benefited greatly from hours spent on trains, and enthusiastic discussions with many people, most notably Konstantinos Tourlas, ames McKinna, Alex Simpson, aniele Turi, Martin ofmann, Thorsten Altenkirch and, especially, eter ancock. eferences [BM98] oland Backhouse, atrik ansson, ohan euring, and Lambert Meertens. Generic programming an introduction. n S. oaitse Sweierstra, edro. enriques, and osé N. liveira, editors, Advanced Functional rogramming, Third nternational Summer School (AF 98); Braga, ortugal, volume 1608 of LNCS, pages Springer Verlag, [BM98] [B99] ichard Bird and Lambert Meertens. Nested datatypes. n Mathematics of rogram Construction, volume 1422 of LNCS, pages SpringerVerlag, ichard Bird and oss aterson. de Bruijn notation as a nested datatype. ournal of Functional rogramming, 9(1):77 92, [yb91] eter ybjer. nductive sets and families in MartinLöf s type theory. n G. uet and G. lotkin, editors, Logical Frameworks. CU,
11 [ue97] Gérard uet. The Zipper. ournal of Functional rogramming, 7(5): , [97] atrik ansson and ohan euring. oly a polytypic programming language extension. n roceedings of L 97, pages ACM, anuary [oy87] André oyal. Foncteurs analytiques et espèces de structures. n Combinatoire énumerative, volume 1234 of LNM, pages SpringerVerlag, [McB70] Fred McBride. Computer Aided Manipulation of Symbols. h thesis, Queen s University of Belfast, [McB99] Conor McBride. ependently Typed Functional rograms and their roofs. h thesis, University of Edinburgh,
Type Theory & Functional Programming
Type Theory & Functional Programming Simon Thompson Computing Laboratory, University of Kent March 1999 c Simon Thompson, 1999 Not to be reproduced i ii To my parents Preface Constructive Type theory has
More informationDependent Types at Work
Dependent Types at Work Ana Bove and Peter Dybjer Chalmers University of Technology, Göteborg, Sweden {bove,peterd}@chalmers.se Abstract. In these lecture notes we give an introduction to functional programming
More informationSettheoretic Foundation of Parametric Polymorphism and Subtyping
Settheoretic Foundation of Parametric Polymorphism and Subtyping Giuseppe Castagna 1 Zhiwu Xu 1,2 1 CNRS, Laboratoire Preuves, Programmes et Systèmes, Univ Paris Diderot, Sorbonne Paris Cité, Paris, France.
More informationSwitching Algebra and Logic Gates
Chapter 2 Switching Algebra and Logic Gates The word algebra in the title of this chapter should alert you that more mathematics is coming. No doubt, some of you are itching to get on with digital design
More informationWHEN ARE TWO ALGORITHMS THE SAME?
WHEN ARE TWO ALGORITHMS THE SAME? ANDREAS BLASS, NACHUM DERSHOWITZ, AND YURI GUREVICH Abstract. People usually regard algorithms as more abstract than the programs that implement them. The natural way
More informationPROOFS AND TYPES JEANYVES GIRARD PAUL TAYLOR YVES LAFONT. CAMBRIDGE UNIVERSITY PRESS Cambridge. Translated and with appendices by
PROOFS AND TYPES JEANYVES GIRARD Translated and with appendices by PAUL TAYLOR YVES LAFONT CAMBRIDGE UNIVERSITY PRESS Cambridge New York Melbourne New Rochelle Sydney ii Published by the Press Syndicate
More informationHow many numbers there are?
How many numbers there are? RADEK HONZIK Radek Honzik: Charles University, Department of Logic, Celetná 20, Praha 1, 116 42, Czech Republic radek.honzik@ff.cuni.cz Contents 1 What are numbers 2 1.1 Natural
More informationIntroduction to Type Theory
Introduction to Type Theory Herman Geuvers Radboud University Nijmegen, The Netherlands Technical University Eindhoven, The Netherlands 1 Overview These notes comprise the lecture Introduction to Type
More informationDependently Typed Functional Programs and their Proofs. Conor McBride
Dependently Typed Functional Programs and their Proofs Conor McBride Doctor of Philosophy University of Edinburgh 1999 Abstract Research in dependent type theories [ML71a] has, in the past, concentrated
More informationThe Set Data Model CHAPTER 7. 7.1 What This Chapter Is About
CHAPTER 7 The Set Data Model The set is the most fundamental data model of mathematics. Every concept in mathematics, from trees to real numbers, is expressible as a special kind of set. In this book,
More informationType Systems. Luca Cardelli. Digital Equipment Corporation Systems Research Center
Type Systems 1 Introduction Luca Cardelli Digital Equipment Corporation Systems Research Center The fundamental purpose of a type system is to prevent the occurrence of execution errors during the running
More informationHow to Make Ad Hoc Proof Automation Less Ad Hoc
How to Make Ad Hoc Proof Automation Less Ad Hoc Georges Gonthier Microsoft Research gonthier@microsoft.com Beta Ziliani MPISWS beta@mpisws.org Aleksandar Nanevski IMDEA Software Institute aleks.nanevski@imdea.org
More informationOPRE 6201 : 2. Simplex Method
OPRE 6201 : 2. Simplex Method 1 The Graphical Method: An Example Consider the following linear program: Max 4x 1 +3x 2 Subject to: 2x 1 +3x 2 6 (1) 3x 1 +2x 2 3 (2) 2x 2 5 (3) 2x 1 +x 2 4 (4) x 1, x 2
More informationHomotopy Type Theory: A synthetic approach to higher equalities
Homotopy Type Theory: A synthetic approach to higher equalities Michael Shulman 1 Introduction Ask an average mathematician or philosopher today about the foundations of mathematics, and you are likely
More informationA Semantical Perspective on Verification of Knowledge
A Semantical Perspective on Verification of Knowledge Paul Leemans, Jan Treur, Mark Willems Vrije Universiteit Amsterdam, Department of Artificial Intelligence De Boelelaan 1081a, 1081 HV Amsterdam The
More informationOutrageous but Meaningful Coincidences
Outrageous but Meaningful Coincidences Dependent typesafe syntax and evaluation Conor McBride University of Strathclyde conor@cis.strath.ac.uk Abstract Tagless interpreters for welltyped terms in some
More informationInnovations in Computational Type Theory using Nuprl
Innovations in Computational Type Theory using Nuprl S. F. Allen, M. Bickford, R. L. Constable, R. Eaton, C. Kreitz, L. Lorigo, E. Moran Department of Computer Science, CornellUniversity, Ithaca, NY 148537501
More informationType Systems. Luca Cardelli. Microsoft Research
Type Systems Luca Cardelli Microsoft Research 1 Introduction The fundamental purpose of a type system is to prevent the occurrence of execution errors during the running of a program. This informal statement
More informationHomotopy Type Theory. Univalent Foundations of Mathematics THE UNIVALENT FOUNDATIONS PROGRAM INSTITUTE FOR ADVANCED STUDY
Homotopy Type Theory Univalent Foundations of Mathematics THE UNIVALENT FOUNDATIONS PROGRAM INSTITUTE FOR ADVANCED STUDY Homotopy Type Theory Univalent Foundations of Mathematics The Univalent Foundations
More informationType and Effect Systems
Type and Effect Systems Flemming Nielson & Hanne Riis Nielson Department of Computer Science, Aarhus University, Denmark. Abstract. The design and implementation of a correct system can benefit from employing
More informationFreeze After Writing
Freeze After Writing QuasiDeterministic Parallel Programming with LVars Lindsey Kuper Indiana University lkuper@cs.indiana.edu Aaron Turon MPISWS turon@mpisws.org Neelakantan R. Krishnaswami University
More informationSteering User Behavior with Badges
Steering User Behavior with Badges Ashton Anderson Daniel Huttenlocher Jon Kleinberg Jure Leskovec Stanford University Cornell University Cornell University Stanford University ashton@cs.stanford.edu {dph,
More informationMonads for functional programming
Monads for functional programming Philip Wadler, University of Glasgow Department of Computing Science, University of Glasgow, G12 8QQ, Scotland (wadler@dcs.glasgow.ac.uk) Abstract. The use of monads to
More informationSESSION 1 PAPER 1 SOME METHODS OF ARTIFICIAL INTELLIGENCE AND HEURISTIC PROGRAMMING. Dr. MARVIN L. MINSKY (94009)
SESSION 1 PAPER 1 SOME METHODS OF ARTIFICIAL INTELLIGENCE AND HEURISTIC PROGRAMMING by Dr. MARVIN L. MINSKY (94009) 3 BIOGRAPHICAL NOTE Marvin Lee Minsky was born in New York on 9th August, 1927. He received
More informationSet Theory. 2.1 Presenting Sets CHAPTER2
CHAPTER2 Set Theory 2.1 Presenting Sets Certain notions which we all take for granted are harder to define precisely than one might expect. In Taming the Infinite: The Story of Mathematics, Ian Stewart
More informationOn the Formal Semantics of IFlike Logics
On the Formal Semantics of IFlike Logics Santiago Figueira a,b, Daniel Gorín a, Rafael Grimson c a Departamento de Computación, FCEyN Universidad de Buenos Aires, Argentina b CONICET, Argentina c Departamento
More informationA Problem Course in Mathematical Logic Version 1.6. Stefan Bilaniuk
A Problem Course in Mathematical Logic Version 1.6 Stefan Bilaniuk Department of Mathematics Trent University Peterborough, Ontario Canada K9J 7B8 Email address: sbilaniuk@trentu.ca 1991 Mathematics Subject
More informationIntellectual Need and ProblemFree Activity in the Mathematics Classroom
Intellectual Need 1 Intellectual Need and ProblemFree Activity in the Mathematics Classroom Evan Fuller, Jeffrey M. Rabin, Guershon Harel University of California, San Diego Correspondence concerning
More informationHypercomputation: computing more than the Turing machine
Hypercomputation: computing more than the Turing machine Abstract: Toby Ord Department of Philosophy * The University of Melbourne t.ord@pgrad.unimelb.edu.au In this report I provide an introduction to
More informationTaking Place Value Seriously: Arithmetic, Estimation, and Algebra
Taking Place Value Seriously: Arithmetic, Estimation, and Algebra by Roger Howe, Yale University and Susanna S. Epp, DePaul University Introduction and Summary Arithmetic, first of nonnegative integers,
More information