Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file logic.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127moduleB=Kernel.BasicmoduleT=Kernel.TermmoduletypeLRA_REIFICATION=sigvalaxiom_specification:stringlist*T.termvalrule_specification:stringlist*T.termvalcumul_specification:stringlist*T.termendtypez=Ztype'as=Stype('a,_)op=|True:'a->('a,z)op|False:'a->('a,z)op|Zero:'a->('a,z)op|Succ:'a->('a,zs)op|Minus:'a->('a,zs)op|Eq:'a->('a,zss)op|Max:'a->('a,zss)op|IMax:'a->('a,zss)op|Le:'a->('a,zss)op|Ite:'a->('a,zsss)optype('a,'b)arrow=|Zero:'b->(z,'b)arrow|One:('b->'b)->(zs,'b)arrow|Two:('b->'b->'b)->(zss,'b)arrow|Three:('b->'b->'b->'b)->(zsss,'b)arrowtype('a,'c)k={mk:'b.('a,'b)op->('b,'c)arrow}moduletypeLRA_SPECIFICATION=sigvalmk_axiom:('c,'b)k->'c->'b->'b->'bvalmk_rule:('c,'b)k->'c->'b->'b->'b->'bvalmk_cumul:('c,'b)k->'c->'b->'b->'bendmoduleMakeLraSpecif(Lra:LRA_REIFICATION):LRA_SPECIFICATION=struct(* FIXME: exception handle *)(* FIXME: reify should be called once, not on every constraint *)letrecreify:typecb.c->(string*b)list->(c,b)k->T.term->b=functxenvkt->letreify'=reifyctxenvkinletmk_op0(op:(_,'z)op)=matchk.mkopwithZerof->finletmk_op1opa=matchk.mkopwithOnef->f(reify'a)inletmk_op2opab=matchk.mkopwithTwof->f(reify'a)(reify'b)inletmk_op3opabc=matchk.mkopwithThreef->f(reify'a)(reify'b)(reify'c)inletis_cstsn=B.ident_eq(B.idn)(B.mk_idents)inmatchtwith|DB(_,a,_)->(tryList.assoc(B.string_of_identa)envwithNot_found->failwith"Wrong configuration pattern for rule")|Const(_,n)->ifis_cst"true"nthenmk_op0(Truectx)elseifis_cst"false"nthenmk_op0(Falsectx)elseifis_cst"zero"nthenmk_op0(Zeroctx)elsefailwith"Wrong configuration pattern for rule"|App(Const(_,n),a,[])->ifis_cst"succ"nthenmk_op1(Succctx)aelseifis_cst"minus"nthenmk_op1(Minusctx)aelsefailwith"Wrong configuration pattern for rule"|App(Const(_,n),l,[r])->ifis_cst"eq"nthenmk_op2(Eqctx)lrelseifis_cst"max"nthenmk_op2(Maxctx)lrelseifis_cst"imax"nthenmk_op2(IMaxctx)lrelseifis_cst"le"nthenmk_op2(Lectx)lrelsefailwith"Wrong configuration pattern for rule"|App(Const(_,n),c,[a;b])->ifis_cst"ite"nthenmk_op3(Itectx)cabelsefailwith"Wrong configuration pattern for rule"|_->failwith"Wrong configuration pattern for rule"letmk_env2la'b'=matchlwith[a;b]->[(a,a');(b,b')]|_->assertfalseletmk_env3la'b'c'=matchlwith[a;b;c]->[(a,a');(b,b');(c,c')]|_->assertfalseletmk_axiomk=letmk_axiom=ref(fun__->assertfalse)infunctxab->letbuilt=reffalseinif!builtthen!mk_axiomabelse(built:=true;letargs,term=Lra.axiom_specificationinletenv=mk_env2argsabinreifyctxenvkterm)letmk_rulek=letmk_rule=ref(fun___->assertfalse)infunctxabc->letbuilt=reffalseinif!builtthen!mk_ruleabcelse(built:=true;letargs,term=Lra.rule_specificationinletenv=mk_env3argsabcinreifyctxenvkterm)letmk_cumulk=letmk_cumul=ref(fun__->assertfalse)infunctxab->letbuilt=reffalseinif!builtthen!mk_cumulabelse(built:=true;letargs,term=Lra.cumul_specificationinletenv=mk_env2argsabinreifyctxenvkterm)endtypetheory=(Universes.pred*bool)listmoduletypeQFUF_SPECIFICATION=sigvalenumerate:int->Universes.univlistvalmk_theory:int->theoryend