type Z = Z with static member (!!) Z = 0
type S<'a> = S of 'a with static member inline (!!) (S a) = !!a + 1
// type NatNum
// inline allows polymorphism/genericslet inline asInt x = !! x
let one = S(Z)printfn "one: %A" !! onelet two = S(one)printfn "two: %A" !! two
Thanks for your quick reply Jon! I think actually you misread me — I didn’t ask if types are just judgments, I asked if types are just judgment forms. I’m talking specifically about (from the very intro to Ch. 2):
A judgment states that one or more abstract binding trees have a property or stand in some relation to one another. The property or relation itself is called a judgment form, and the judgment that an object or objects have that property or stand in that relation is said to be an instance of that judgment form. A judgment form is also called a predicate, and the objects constituting an instance are its subjects.
Does this change your answer significantly? I was struck by judgment forms as types just given their inductive definitions are exactly analogous to types I’ve seen defined. For instance, 2.3a..b define the judgment form of “tree”, and here’s an example from Haskell: https://wiki.haskell.org/Algebraic_data_type#Tree_examples
In part I was also wondering this because of my understanding (shallow though it is) of refinement types, in that they add predicates to types. But ime, you can essentially define types as implicit predicates. Does that make sense? Then, what is the real value of refinement types?
Best,
Alex
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/1450033671.2520.466175169.48E9887B%40webmail.messagingengine.com.
Now, we can actually give a concrete example of how types and judgments
in general differ! It is the case that [empty tree] is an evident
judgment, but what about [(lam(x.x) empty) tree]? (i.e. applying the
identity function to the empty tree). That judgment is actually not
evident! (Because it is not in the inductive definition of the [t tree]
form of judgment)
--
You received this message because you are subscribed to the Google Groups "Type Theory Study Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to type-theory-study...@googlegroups.com.
To post to this group, send email to type-theory...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/0cc51ebd-25d9-419b-a111-71384b2a74a0%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Type Theory Study Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to type-theory-study...@googlegroups.com.
To post to this group, send email to type-theory...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/eadf6c71-6f18-419c-b207-9e2ac0fe7eca%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Type Theory Study Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to type-theory-study...@googlegroups.com.
To post to this group, send email to type-theory...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/5639af15-528c-4741-a748-ff7812cedcd3%40googlegroups.com.
Also Adam’s Certified Programming with Dependent Types is more newb friendly, I think. :)
--
You received this message because you are subscribed to the Google Groups "Type Theory Study Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to type-theory-study...@googlegroups.com.
To post to this group, send email to type-theory...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/77f188b9-bd61-4efb-aa1f-c5ce9e6c0f79%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to type-theory-study-group+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Type Theory Study Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to type-theory-study...@googlegroups.com.
To post to this group, send email to type-theory...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/ad7e21ae-ebf5-4495-aef1-ce25e91721b8%40googlegroups.com.
Lemma 4.2 (Inversion for Typing). Suppose that G ` e : t. If e = plus(e1; e2), then t = num, G ` e1 : num, and G ` e2 : num, and similarly for the other constructs of the language.
Lemma 4.3 (Weakening). If G ` e0 : t0, then G, x : t ` e0 : t0 for any x 2/ dom(G) and any type t.
The "bottom type" is poorly named, but it just means falsity, and has no
inhabitants—every inhabitant of "bottom" vacuously terminates, because
there are no inhabitants.
Also I found this a little hard to follow:Lemma 4.2 (Inversion for Typing). Suppose that G ` e : t. If e = plus(e1; e2), then t = num, G ` e1 : num, and G ` e2 : num, and similarly for the other constructs of the language.The context above appears to define inversion in this context as a way of pivoting: "[...] syntax-directed [...] [makes it] easy to give necessary conditions for typing an expression that invert the sufficient conditions expressed by the corresponding typing rule". Via the syntax direction, we can get get the necessary conditions from the sufficient?Or in other words, this mapping is injective (I'm not clear if it's surjective or not), so it's easy for us to go backwards as well as forwards?
second-order logic is an extension of first-order logic, which itself is an extension of propositional logic.[1]Second-order logic is in turn extended by higher-order logic and type theory.
Lemma 4.3 (Weakening). If G ` e0 : t0, then G, x : t ` e0 : t0 for any x 2/ dom(G) and any type t.
translates to "adding another variable of another type has no effect on e' having type tau'"?
> > > email to type-theory-study-group+unsub...@googlegroups.com
> > <javascript:>.
> > > To post to this group, send email to
> > > type-theory...@googlegroups.com <javascript:>.
> > > To view this discussion on the web visit
> > >
> > https://groups.google.com/d/msgid/type-theory-study-group/38b61284-27e2-48e0-bebe-7e33a9a3a5fb%40googlegroups.com.
> >
> > > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Type Theory Study Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
second-order logic is an extension of first-order logic, which itself is an extension of propositional logic.[1]Second-order logic is in turn extended by higher-order logic and type theory.The above is from Wikipedia. Is this true? And is there a simple table of operators available in the progressively "extended" logics up to type theory? It would be handy for reference for me.
Lemma 4.4 (Substitution). If G, x : t ` e0 : t0 and G ` e : t, then G ` [e/x]e0 : t0.
--
You received this message because you are subscribed to the Google Groups "Type Theory Study Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to type-theory-study...@googlegroups.com.
To post to this group, send email to type-theory...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/d212b978-8fc3-4918-9c8d-ee673a3eaf1e%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/type-theory-study-group/CAJ6ZEJ4Qpv75rnN%2BKt5%2BRHNc9ohzM4esCrSxHWNCtmpaGxF_PQ%40mail.gmail.com.
A transition sequence is a sequence of states s0, ..., sn such that s0 initial, and sisi+1 for every 0 ≤ i < n. A transition sequence is maximal iff there is no s such that sn
s, and it is complete iff it is maximal and, in addition, sn final. Thus every complete transition sequence is maximal, but maximal sequences are not necessarily complete.