Commit 880ea5e9 authored by Pietro Abate's avatar Pietro Abate
Browse files

Add clean_type to tallying algorithm

parent e18e076b
...@@ -3260,32 +3260,23 @@ let apply_raw s t = ...@@ -3260,32 +3260,23 @@ let apply_raw s t =
(* cell i of ai contains /\k<=i s_k, cell j of aj contains /\k<=j t_k *) (* cell i of ai contains /\k<=i s_k, cell j of aj contains /\k<=j t_k *)
let ai = ref [| |] let ai = ref [| |]
and aj = ref [| |] in and aj = ref [| |] in
(* let result = ref any in *)
let tallying i j = let tallying i j =
try try
let s = get ai i in let s = get ai i in
let t = arrow (cons (get aj j)) cgamma in let t = arrow (cons (get aj j)) cgamma in
let sl = Tallying.tallying [ (s,t) ] in let sl = Tallying.tallying [ (s,t) ] in
let new_res = let new_res =
List.fold_left (fun tacc e -> Positive.clean_type (
let res = List.fold_left (fun tacc e ->
Tallying.CS.E.fold (fun var subst acc -> let res =
Positive.substitute acc (var,subst) Tallying.CS.E.fold (fun var subst acc ->
) e gamma Positive.substitute acc (var,subst)
in ) e gamma
cap tacc res in
) any sl cap tacc res
) any sl
)
in in
(* Uncomment only if we are looking for the most-precise solution *)
(* if subtype new_res !result && not (subtype !result new_res)
then begin
(* strictly improved the result, continue *)
Format.printf "Found a partial solution at %i, %i: %a@\n@."
i j Print.print new_res;
result := new_res
end
else
*)
raise (Found(new_res,i,j,sl)) raise (Found(new_res,i,j,sl))
with with
Tallying.Step1Fail -> (assert (i == 0 && j == 0); raise (Tallying.UnSatConstr "apply_raw step1")) Tallying.Step1Fail -> (assert (i == 0 && j == 0); raise (Tallying.UnSatConstr "apply_raw step1"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment