From 2dc11fb304040762b18c953749f389bfad8ee2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=BChler?= <david.buhler@cea.fr> Date: Mon, 20 Jan 2025 14:33:59 +0100 Subject: [PATCH] [Eva] Removes dead code in eval_terms. --- src/plugins/eva/gui/gui_types.ml | 2 +- src/plugins/eva/legacy/eval_terms.ml | 25 ------------------------- src/plugins/eva/legacy/eval_terms.mli | 1 - 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/plugins/eva/gui/gui_types.ml b/src/plugins/eva/gui/gui_types.ml index e49f3961817..a1dbdfac667 100644 --- a/src/plugins/eva/gui/gui_types.ml +++ b/src/plugins/eva/gui/gui_types.ml @@ -141,7 +141,7 @@ module Make (V: Abstract.Value.External) = struct | GR_Empty -> () | GR_Offsm (offsm, typ) -> pretty_gui_offsetmap_res ?typ fmt offsm | GR_Value (v, typ) -> Eval.Flagged_Value.pretty (V.pretty_typ typ) fmt v - | GR_Status s -> Eval_terms.pretty_predicate_status fmt s + | GR_Status s -> Alarmset.Status.pretty fmt s | GR_Zone z -> Locations.Zone.pretty fmt z let equal_gui_res r1 r2 = match r1, r2 with diff --git a/src/plugins/eva/legacy/eval_terms.ml b/src/plugins/eva/legacy/eval_terms.ml index 029f84e732e..a2ca78a5b40 100644 --- a/src/plugins/eva/legacy/eval_terms.ml +++ b/src/plugins/eva/legacy/eval_terms.ml @@ -28,37 +28,12 @@ open Cvalue type predicate_status = Abstract_interp.Comp.result = True | False | Unknown -let string_of_predicate_status = function - | Unknown -> "unknown" - | True -> "valid" - | False -> "invalid" - -let pretty_predicate_status fmt v = - Format.fprintf fmt "%s" (string_of_predicate_status v) - let join_predicate_status x y = match x, y with | True, True -> True | False, False -> False | True, False | False, True | Unknown, _ | _, Unknown -> Unknown -let _join_list_predicate_status l = - let exception Stop in - try - let r = - List.fold_left - (fun acc e -> - match e, acc with - | Unknown, _ -> raise Stop - | e, None -> Some e - | e, Some eacc -> Some (join_predicate_status eacc e) - ) None l - in - match r with - | None -> True - | Some r -> r - with Stop -> Unknown - (* Type of possible errors during evaluation. See pretty-printer for details *) type logic_evaluation_error = | Unsupported of string diff --git a/src/plugins/eva/legacy/eval_terms.mli b/src/plugins/eva/legacy/eval_terms.mli index bf8dd3212d2..b4a426ed9e2 100644 --- a/src/plugins/eva/legacy/eval_terms.mli +++ b/src/plugins/eva/legacy/eval_terms.mli @@ -28,7 +28,6 @@ open Cvalue (** Evaluating a predicate. [Unknown] is the Top of the lattice *) type predicate_status = Abstract_interp.Comp.result = True | False | Unknown -val pretty_predicate_status : Format.formatter -> predicate_status -> unit val join_predicate_status : predicate_status -> predicate_status -> predicate_status -- GitLab