X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fng_paramodulation%2Forderings.ml;h=d24a5742eeed196035d3c97c9f181e6ab0d35054;hb=578ba04e1a0812f538729fbc02ea38d2cfd0ed3e;hp=bf033ec662d058ead724ec7195981eedceeffb8f;hpb=7684ad8a8fec35563be35c1d5c797dfab83c1e3f;p=helm.git diff --git a/matita/components/ng_paramodulation/orderings.ml b/matita/components/ng_paramodulation/orderings.ml index bf033ec66..d24a5742e 100644 --- a/matita/components/ng_paramodulation/orderings.ml +++ b/matita/components/ng_paramodulation/orderings.ml @@ -364,13 +364,13 @@ module LPO (B : Terms.Blob) = struct let compute_goal_weight = compute_goal_weight;; (*CSC: beware! Imperative cache! *) - let cache = ref [];; + 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 List.assoc (s,t) !cache + try Hashtbl.find cache (s,t) with Not_found -> let res = match s,t with @@ -406,7 +406,7 @@ module LPO (B : Terms.Blob) = struct | _ -> assert false end in - cache := ((s,t),res)::!cache; res + Hashtbl.add cache (s,t) res; res ;; let lpo s t = @@ -416,7 +416,7 @@ module LPO (B : Terms.Blob) = struct else if lpo_lt t s then XGT else XINCOMPARABLE in - cache := []; res + Hashtbl.clear cache; res ;;