Changed default sig.
varlist
;;
+ let rec reloc_subst subst = function
+ | (Terms.Leaf _) as t -> t
+ | Terms.Var i ->
+ (try
+ List.assoc i subst
+ with
+ Not_found -> assert false)
+ | (Terms.Node l) ->
+ Terms.Node (List.map (fun t -> reloc_subst subst t) l)
+;;
+
let rec apply_subst subst = function
| (Terms.Leaf _) as t -> t
| Terms.Var i ->
val lookup :
int -> 'a Terms.substitution -> 'a Terms.foterm
val filter : 'a Terms.substitution -> Terms.varlist -> Terms.varlist
+ val reloc_subst :
+ 'a Terms.substitution -> 'a Terms.foterm -> 'a Terms.foterm
val apply_subst :
'a Terms.substitution -> 'a Terms.foterm -> 'a Terms.foterm
val concat:
;;
let fresh_unit_clause maxvar (id, lit, varlist, proof) =
+ (* prerr_endline
+ ("varlist = " ^ (String.concat "," (List.map string_of_int varlist)));*)
let maxvar, varlist, subst = relocate maxvar varlist Subst.id_subst in
let lit =
match lit with
| Terms.Equation (l,r,ty,o) ->
- let l = Subst.apply_subst subst l in
- let r = Subst.apply_subst subst r in
- let ty = Subst.apply_subst subst ty in
+ let l = Subst.reloc_subst subst l in
+ let r = Subst.reloc_subst subst r in
+ let ty = Subst.reloc_subst subst ty in
Terms.Equation (l,r,ty,o)
| Terms.Predicate p ->
- let p = Subst.apply_subst subst p in
+ let p = Subst.reloc_subst subst p in
Terms.Predicate p
in
let proof =
match proof with
- | Terms.Exact t -> Terms.Exact (Subst.apply_subst subst t)
+ | Terms.Exact t -> Terms.Exact (Subst.reloc_subst subst t)
| Terms.Step (rule,c1,c2,dir,pos,s) ->
Terms.Step(rule,c1,c2,dir,pos,Subst.concat subst s)
in
let path_string_of =
let rec aux arity = function
| Terms.Leaf a -> [Constant (a, arity)]
- | Terms.Var i -> assert (arity = 0); [Variable]
+ | Terms.Var i -> (* assert (arity = 0); *) [Variable]
+ (* FIXME : should this be allowed or not ?
| Terms.Node (Terms.Var _::_) ->
- (* FIXME : should this be allowed or not ? *)
- assert false
+ assert false *)
| Terms.Node ([] | [ _ ] ) -> assert false
| Terms.Node (Terms.Node _::_) -> assert false
| Terms.Node (hd::tl) ->
let set_eqP t = eqPref := fun _ -> t;;
let default_eqP() =
- let uri = NUri.uri_of_string "cic:/matita/ng/Plogic/equality/peq.ind" in
+ let uri = NUri.uri_of_string "cic:/matita/ng/Plogic/equality/eq.ind" in
let ref = NReference.reference_of_spec uri (NReference.Ind(true,0,2)) in
NCic.Const ref
| ( NCic.Meta _ | NCic.Appl _ ), NCic.Const _ -> 1
| NCic.Appl _, NCic.Meta _ -> ~-1
| NCic.Meta _, NCic.Appl _ -> 1
- | _ -> assert false
+ | _ -> Pervasives.compare x y
+ (* was assert false, but why? *)
+
;;
let compare x y =
HExtlib.list_mapi_acc (fun x _ a -> P.mk_goal a x) (bag,maxvar) [t]
in
let (bag,maxvar), passives =
- HExtlib.list_mapi_acc (fun x _ a -> P.mk_passive a x) (bag,maxvar) table
+ HExtlib.list_mapi_acc (fun x _ a -> prerr_endline "there"; P.mk_passive a x) (bag,maxvar) table
in
match
P.paramod ~useage:true ~max_steps:max_int ~timeout:(Unix.gettimeofday () +. 300.0)
let empty_state = P.empty_state
let forward_infer_step s t ty =
- let bag = P.bag_of_state s in
+ let bag = P.bag_of_state s in
+ prerr_endline "here";
let bag,clause = P.mk_passive bag (t,ty) in
if Terms.is_eq_clause clause then
P.forward_infer_step (P.replace_bag s bag) clause 0
let default_sig = function
| Eq ->
- let uri = NUri.uri_of_string "cic:/matita/ng/Plogic/equality/peq.ind" in
+ let uri = NUri.uri_of_string "cic:/matita/ng/Plogic/equality/eq.ind" in
let ref = NReference.reference_of_spec uri (NReference.Ind(true,0,2)) in
NCic.Const ref
| EqInd_l ->
let ref = NReference.reference_of_spec uri (NReference.Def(3)) in
NCic.Const ref
| Refl ->
- let uri = NUri.uri_of_string "cic:/matita/ng/Plogic/equality/peq.ind" in
+ let uri = NUri.uri_of_string "cic:/matita/ng/Plogic/equality/eq.ind" in
let ref = NReference.reference_of_spec uri (NReference.Con(0,1,2)) in
NCic.Const ref
(* let debug c r = prerr_endline r; c *)
let debug c _ = c;;
- let eqP() = debug (!eqsig Eq) "eqp" ;;
+ let eqP() = debug (!eqsig Eq) "eq" ;;
let eq_ind() = debug (!eqsig EqInd_l) "eq_ind" ;;
let eq_ind_r() = debug (!eqsig EqInd_r) "eq_ind_r";;
let eq_refl() = debug (!eqsig Refl) "refl";;