Module Context.Rel
Representation of contexts that can capture anonymous as well as non-anonymous variables. Individual declarations are then designated by de Bruijn indexes.
module Declaration : sig ... endtype ('constr, 'types) pt= ('constr, 'types) Declaration.pt listRel-context is represented as a list of declarations. Inner-most declarations are at the beginning of the list. Outer-most declarations are at the end of the list.
val empty : ('c, 't) ptempty rel-context
val add : ('c, 't) Declaration.pt -> ('c, 't) pt -> ('c, 't) ptReturn a new rel-context enriched by with a given inner-most declaration.
val length : ('c, 't) pt -> intReturn the number of local declarations in a given rel-context.
val equal : ('c -> 'c -> bool) -> ('c, 'c) pt -> ('c, 'c) pt -> boolCheck whether given two rel-contexts are equal.
val nhyps : ('c, 't) pt -> intReturn the number of local assumptions in a given rel-context.
val lookup : int -> ('c, 't) pt -> ('c, 't) Declaration.ptReturn a declaration designated by a given de Bruijn index.
- raises Not_found
if the designated de Bruijn index outside the range.
val iter : ('c -> unit) -> ('c, 'c) pt -> unitPerform a given action on every declaration in a given rel-context.
val fold_inside : ('a -> ('c, 't) Declaration.pt -> 'a) -> init:'a -> ('c, 't) pt -> 'aReduce all terms in a given rel-context to a single value. Innermost declarations are processed first.
val fold_outside : (('c, 't) Declaration.pt -> 'a -> 'a) -> ('c, 't) pt -> init:'a -> 'aReduce all terms in a given rel-context to a single value. Outermost declarations are processed first.
val to_tags : ('c, 't) pt -> bool listMap a given rel-context to a list where each local assumption is mapped to
trueand each local definition is mapped tofalse.
val drop_bodies : ('c, 't) pt -> ('c, 't) ptTurn all
LocalDefintoLocalAssum, leaveLocalAssumunchanged.
val to_extended_list : (int -> 'r) -> int -> ('c, 't) pt -> 'r listextended_list mk n Γbuilds an instanceargssuch thatΓ,Δ ⊢ args:Γwith n = |Δ| and with the local definitions ofΓskipped inargswheremkis used to build the corresponding variables. Example: forx:T, y:=c, z:Uandn=2, it givesmk 5, mk 3.
val to_extended_vect : (int -> 'r) -> int -> ('c, 't) pt -> 'r arrayextended_vect n Γdoes the same, returning instead an array.