type t = A.t DiscriminationTree.t * (path_string_elem*int) list
let empty = DiscriminationTree.empty, [] ;;
+ let iter (dt, _ ) f =
+ DiscriminationTree.iter (fun _ x -> f x) dt
+ ;;
+
let index (tree,arity) term info =
let arity,ps = path_string_of_term arity term in
let ps_set =
sig
type t
+ val iter : t -> (A.t -> unit) -> unit
val empty : t
val index : t -> Cic.term -> A.elt -> t
} and eval_executable = {ee_go = fun ~disambiguate_tactic ~disambiguate_command
~disambiguate_macro opts status (text,prefix_len,ex) ->
match ex with
- | GrafiteAst.Tactic (_, Some tac, punct) ->
+ | GrafiteAst.Tactic (_(*loc*), Some tac, punct) ->
let tac = apply_tactic ~disambiguate_tactic (text,prefix_len,tac) in
let status = eval_tactical status (tactic_of_ast' tac) in
+ (* CALL auto on every goal, easy way of testing it
+ let auto = GrafiteAst.AutoBatch (loc, ([],["depth","1";"timeout","1"])) in
+ (try
+ let auto = apply_tactic ~disambiguate_tactic ("",0,auto) in
+ let _ = eval_tactical status (tactic_of_ast' auto) in ()
+ with _ -> ()); *)
eval_tactical status
(punctuation_tactical_of_ast (text,prefix_len,punct)),[]
| GrafiteAst.Tactic (_, None, punct) ->
val remove_index : t -> Equality.equality -> t
val index : t -> Equality.equality -> t
val in_index : t -> Equality.equality -> bool
+ val iter : t -> (PosEqSet.t -> unit) -> unit
end
module DT =
val remove_index : t -> Equality.equality -> t
val index : t -> Equality.equality -> t
val in_index : t -> Equality.equality -> bool
+ val iter : t -> (PosEqSet.t -> unit) -> unit
end
module DT : EqualityIndex
(** demodulation, when target is an equality *)
let rec demodulation_equality bag ?from eq_uri newmeta env table target =
+ (*
+ prerr_endline ("demodulation_eq:\n");
+ Index.iter table (fun l ->
+ let l = Index.PosEqSet.elements l in
+ let l =
+ List.map (fun (p,e) ->
+ Utils.string_of_pos p ^ Equality.string_of_equality e) l in
+ prerr_endline (String.concat "\n" l)
+ );
+ *)
let module C = Cic in
let module S = CicSubstitution in
let module M = CicMetaSubst in
| C.Const _, _ -> Lt
| _, C.Const _ -> Gt
- | C.MutInd (u1, _, _), C.MutInd (u2, _, _) -> compare_uris u1 u2
+ | C.MutInd (u1, tno1, _), C.MutInd (u2, tno2, _) ->
+ let res = compare_uris u1 u2 in
+ if res <> Eq then res
+ else
+ let res = compare tno1 tno2 in
+ if res = 0 then Eq else if res < 0 then Lt else Gt
| C.MutInd _, _ -> Lt
| _, C.MutInd _ -> Gt
- | C.MutConstruct (u1, _, _, _), C.MutConstruct (u2, _, _, _) ->
- compare_uris u1 u2
+ | C.MutConstruct (u1, tno1, cno1, _), C.MutConstruct (u2, tno2, cno2, _) ->
+ let res = compare_uris u1 u2 in
+ if res <> Eq then res
+ else
+ let res = compare (tno1,cno1) (tno2,cno2) in
+ if res = 0 then Eq else if res < 0 then Lt else Gt
| C.MutConstruct _, _ -> Lt
| _, C.MutConstruct _ -> Gt
let nonrec_kbo t1 t2 =
let w1 = weight_of_term t1 in
let w2 = weight_of_term t2 in
- (*
+ (*
prerr_endline ("weight1 :"^(string_of_weight w1));
prerr_endline ("weight2 :"^(string_of_weight w2));
*)