From 5ce9d33ddf09747ce6cf6e3bea70097556b454f4 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 22 Jan 2020 17:29:56 +0100 Subject: Fixing bug (used physical instead of structural inequality) --- backend/Duplicateaux.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml index 66c57cda..67fbf3ad 100644 --- a/backend/Duplicateaux.ml +++ b/backend/Duplicateaux.ml @@ -468,6 +468,7 @@ let rec change_pointers code n n' = function * n': the integer which should contain the duplicate of n * returns: new code, new ptree *) let duplicate code ptree parent n preds n' = + Printf.printf "Duplicating node %d into %d..\n" (P.to_int n) (P.to_int n'); match PTree.get n' code with | Some _ -> failwith "The PTree already has a node n'" | None -> @@ -502,7 +503,7 @@ let tail_duplicate code preds ptree trace = if is_first then (code, ptree) (* first node is never duplicated regardless of its inputs *) else let node_preds = ptree_get_some n preds - in let node_preds_nolast = List.filter (fun e -> e != get_some !last_node) node_preds + in let node_preds_nolast = List.filter (fun e -> e <> get_some !last_node) node_preds in let final_node_preds = match !last_duplicate with | None -> node_preds_nolast | Some n' -> n' :: node_preds_nolast -- cgit