package universo
A tool for Dedukti to play with universes
Install
Dune Dependency
Authors
Maintainers
Sources
v2.7.tar.gz
sha512=97171b48dd96043d84587581d72edb442f63e7b5ac1695771aa1c3c9074739e15bc7d17678fedb7062acbf403a0bf323d97485c31b92376b80c63b5c2300ee3c
sha256=5e1b6a859dfa1eb2098947a99c7d11ee450f750d96da1720f4834e1505d1096c
doc/src/universo.elaboration/var.ml.html
Source file var.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
module B = Kernel.Basic module F = Common.Files module T = Kernel.Term module U = Common.Universes exception Not_uvar (** prefix for all the universe variables. *) let basename = "?" (** Check if a term should be elaborated by a fresh variable *) let is_pre_var t = match t with T.Const (_, n) when n = U.pvar () -> true | _ -> false (** Check if a term is universe variable, i.e. its ident should be ?11, ?43... *) let is_uvar t = match t with | T.Const (_, n) -> let s = B.string_of_ident (B.id n) in let n = String.length basename in String.length s > n && String.sub s 0 n = basename | _ -> false (** [name_of_uvar t] returns the name of universe variable if [t] is a universe variable, raise [Not_uvar] otherwise *) let name_of_uvar t = match t with T.Const (_, n) when is_uvar t -> n | _ -> raise Not_uvar (** Internal counter use by this module to generate fresh variables *) let counter = ref 0 (** Generate a fresh name for a universe variable *) let fresh () = let name = Format.sprintf "%s%d" basename !counter in incr counter; B.mk_ident name (** [fresh_uvar env ()] returns a fresh term representing a universe variable. Add a new declaration into the module env.md *) let fresh_uvar : F.cout F.t -> unit -> T.term = fun file () -> let id = fresh () in let uvar = B.mk_name file.md id in let uterm = T.mk_Const B.dloc uvar in let sort_type = let md_theory = !U.md_theory in T.mk_Const B.dloc (B.mk_name md_theory (B.mk_ident "Sort")) in Format.fprintf (F.fmt_of_file file) "%a@." Api.Pp.Default.print_entry (Parsers.Entry.Decl ( B.dloc, id, Kernel.Signature.Public, Kernel.Signature.Definable T.Free, sort_type )); uterm
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>