X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fng_paramodulation%2Forderings.ml;h=d24a5742eeed196035d3c97c9f181e6ab0d35054;hb=48c011f52853dd106dbf9cbbd1b9da61277fba3b;hp=b457832453dd5582b5d44c95c9c292fb68578ac0;hpb=78a7786a2263ecc0440cfcab80b646327364fe2c;p=helm.git diff --git a/matita/components/ng_paramodulation/orderings.ml b/matita/components/ng_paramodulation/orderings.ml index b45783245..d24a5742e 100644 --- a/matita/components/ng_paramodulation/orderings.ml +++ b/matita/components/ng_paramodulation/orderings.ml @@ -363,10 +363,16 @@ module LPO (B : Terms.Blob) = struct let compute_unit_clause_weight = compute_unit_clause_weight;; let compute_goal_weight = compute_goal_weight;; + (*CSC: beware! Imperative cache! *) + let cache = Hashtbl.create 101 + let rec lpo_le s t = eq_foterm s t || lpo_lt s t and lpo_lt s t = + try Hashtbl.find cache (s,t) + with + Not_found -> let res = match s,t with | _, Terms.Var _ -> false | Terms.Var i,_ -> @@ -399,13 +405,18 @@ module LPO (B : Terms.Blob) = struct compare_args tl1 tl2 | _ -> assert false end + in + Hashtbl.add cache (s,t) res; res ;; let lpo s t = + let res = if eq_foterm s t then XEQ else if lpo_lt s t then XLT else if lpo_lt t s then XGT else XINCOMPARABLE + in + Hashtbl.clear cache; res ;;