1234567891011121314151617181920212223242526272829303132333435363738394041(** Symbols and signature for unification rules.
This module provides a signature to be used to handle unification rules.
The signature is not attached to any real lambdapi file and is henceforth
qualified to be a "ghost" signature. *)openCommonopenTermopenSign(** Symbol "≡". *)letequiv:sym=letid=Pos.none"≡"inlets=Sign.add_symbolGhost.signPublicDefinEagerfalseidNonemk_Kind[]inTimed.(s.sym_nota:=Infix(Pratter.Neither,2.0));s(** Symbol ";". *)letcons:sym=letid=Pos.none";"inlets=Sign.add_symbolGhost.signPublicConstEagertrueidNonemk_Kind[]inTimed.(s.sym_nota:=Infix(Pratter.Right,1.0));s(** [unpack eqs] transforms a term of the form
[cons (equiv t u) (cons (equiv v w) ...)]
into a list [[(t,u); (v,w); ...]]. *)letrecunpack:term->(term*term)list=funeqs->matchget_argseqswith|(Symb(s),[v;w])->ifs==consthenmatchget_argsvwith|(Symb(e),[t;u])whene==equiv->(t,u)::unpackw|_->assertfalseelseifs==equivthen[(v,w)]elseassertfalse|_->assertfalse(** [mem s] is true iff [s] belongs to [sign]. *)letmem:sym->bool=funs->s==equiv||s==cons