You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The distinguished level variable for top-level definitions should be explicit in the core language for clean semantics. (It can remain implicit in the surface language.)
One-variable universe polymorphism with cumulativity is enough. Typical ambiguity (as in Coq) and multi-variable universe polymorphism (as in Agda) are overkill.
It is convenient to have the top level for type checking. However, end users should not be allowed to write the top level, and shifting the top level is forbidden.
Displacement Algebras
In Conor McBride’s notes, it was noted that any class of strictly monotone operators on levels closed under identity and composition will work. We codified such a class as a displacement algebra. The classic displacement operators may be recovered by using the following module with non-negative numbers:
moduleI=Mugen.Shift.IntmoduleM=Mugen.Syntax(* The type of universe levels, using integers as displacements and strings as variable names. *)typeulevel = (I.t, string) M.free(* The level representing "x + 10" *)letl : ulevel =M.Free.(shifted (var "x") (I.of_int 10))