bool, int, char, addrtype, t@ype, viewtype, viewt@ype -- program (runtime) typesprop, view -- propositionseff -- effectscls -- class-based inheritancetkind -- external types needed only by namesortdef -- bind names to sorts or subsortsdatasort -- define an algebraic sort constructorstadef -- bind names to static termssta -- bind names to hidden static representations
type, t@ype -- static terms that are types of (dynamic) non-linear program terms
typedef -- bind names to (static) type termsabstype, abst@ype -- bind names to hidden type representationsdatatype -- define an algebraic type constructorviewtype, viewt@ype -- types of (dynamic) linear program terms
viewtypedef -- bind names to (static) viewtype termsabsviewtype, absviewt@ype -- bind names to hidden viewtype representationsdataviewtype -- define an algebraic viewtype constructorprop -- types of (dynamic) classical proof terms
propdef -- bind names to (static) prop termsabsprop -- bind names to hidden prop representationsdataprop -- define an algebraic prop constructorview -- types of (dynamic) linear proof terms
viewdef -- bind names to (static) view termsabsview -- bind names to hidden view representationsdataview -- define an algebraic view constructorval, fun: bind names to program terms
type, t@ypeviewtype, viewt@ypeprval, prfun: bind names to proof terms
propviewLists
datatype list (a:t@ype+, int)functional (immutable) singly-linked list
dataviewtype list_vt (a:viewt@ype+, int)linear (mutable?) singly-linked list
References
Arrays
typedef array (a,n) = @[a][n]
viewdef array_v (a:viewt@ype, l:addr, n:int) = @[a][n]@l
absviewtype arrayptr (a:viewt@ype+, l:addr, n:int) = ptr l
abstype arrayref (a:viewt@ype, n:int) = ptr l
abstype arrszref (a:viewt@ype) = ptr lStrings
abstype string = ptrabstype string (n:int) = stringpersistent read-only strings
absviewtype strptr (l:addr) = ptr
viewtypedef strptr = [l:addr] strptr l
absviewtype strnptr (l:addr, n:int) = ptrviewtypedef strnptr (n:int) = [l:addr] strnptr (l, n)linear mutable strings
abstype strref (l:addr) = ptrpersistent mutable strings
Option types