Skip to content
Snippets Groups Projects
Commit 10b6919d authored by BRUN Lelio's avatar BRUN Lelio
Browse files

remove/comment some dead code

parent ac8ff79c
No related branches found
No related tags found
No related merge requests found
......@@ -450,7 +450,7 @@ module PrintSpec = struct
| GhostAssign (v1, v2) ->
pp_ghost (pp_assign m mem_in (pp_c_var_read m)) fmt (v1, v2)
let reset_flag = dummy_var_decl "_reset" Type_predef.type_bool
(* let reset_flag = dummy_var_decl "_reset" Type_predef.type_bool *)
let val_of_expr = function
| Val v ->
......@@ -1159,8 +1159,8 @@ module SrcMod = struct
let pp_contract_arrow_step_name fmt =
fprintf fmt "%s_step_ghost" Arrow.arrow_id
let pp_arrow_reset_ghost mem fmt inst =
fprintf fmt "%t(%a)" pp_contract_arrow_reset_name pp_indirect' (mem, inst)
(* let pp_arrow_reset_ghost mem fmt inst = *)
(* fprintf fmt "%t(%a)" pp_contract_arrow_reset_name pp_indirect' (mem, inst) *)
let pp_is_contract = pp_is_contract
......
......@@ -59,7 +59,7 @@ module EmptyMod = struct
module GhostProto = EmptyGhostProto
let pp_import_spec_prototype _ _ = ()
let pp_set_reset_spec _ _ _ _ _ = ()
(* let pp_set_reset_spec _ _ _ _ _ = () *)
let pp_clear_reset_spec _ _ _ _ = ()
let pp_ghost_reset_spec _ _ _ _ = ()
let pp_step_spec _ _ _ _ _ = ()
......
......@@ -21,8 +21,6 @@ open Utils
exception NormalizationError
let zero = mk_val (Cst (Const_int 0)) Type_predef.type_int
(* Questions:
- where are used the mconst. They contain initialization of constant in
......
......@@ -165,48 +165,48 @@ let rec eliminate m elim instr =
( e_val g,
List.map (fun (l, il) -> l, List.map (eliminate m elim) il) hl ))
let rec fv_value m s v =
match v.value_desc with
| Var v ->
if is_memory m v then s else VSet.add v s
| Fun (_, vl) | Array vl ->
List.fold_left (fv_value m) s vl
| Access (v1, v2) | Power (v1, v2) ->
fv_value m (fv_value m s v1) v2
| _ ->
s
let fv_expr m s = function
| Val v ->
fv_value m s v
| Var v ->
if is_memory m v then s else VSet.add v s
| _ ->
s
let fv_predicate m s = function
| Transition (_, _, _, _, vars, _, _, _) ->
List.fold_left (fv_expr m) s vars
| _ ->
s
let rec fv_formula m s = function
| Equal (e1, e2) | GEqual (e1, e2) ->
fv_expr m (fv_expr m s e1) e2
| And f | Or f ->
List.fold_left (fv_formula m) s f
| Imply (a, b) | ExistsMem (_, a, b) ->
fv_formula m (fv_formula m s a) b
| Exists (xs, a) | Forall (xs, a) ->
VSet.filter (fun v -> not (List.mem v xs)) (fv_formula m s a)
| Ternary (e, a, b) ->
fv_expr m (fv_formula m (fv_formula m s a) b) e
| Predicate p ->
fv_predicate m s p
| Value v ->
fv_value m s v
| _ ->
s
(* let rec fv_value m s v = *)
(* match v.value_desc with *)
(* | Var v -> *)
(* if is_memory m v then s else VSet.add v s *)
(* | Fun (_, vl) | Array vl -> *)
(* List.fold_left (fv_value m) s vl *)
(* | Access (v1, v2) | Power (v1, v2) -> *)
(* fv_value m (fv_value m s v1) v2 *)
(* | _ -> *)
(* s *)
(* let fv_expr m s = function *)
(* | Val v -> *)
(* fv_value m s v *)
(* | Var v -> *)
(* if is_memory m v then s else VSet.add v s *)
(* | _ -> *)
(* s *)
(* let fv_predicate m s = function *)
(* | Transition (_, _, _, _, vars, _, _, _) -> *)
(* List.fold_left (fv_expr m) s vars *)
(* | _ -> *)
(* s *)
(* let rec fv_formula m s = function *)
(* | Equal (e1, e2) | GEqual (e1, e2) -> *)
(* fv_expr m (fv_expr m s e1) e2 *)
(* | And f | Or f -> *)
(* List.fold_left (fv_formula m) s f *)
(* | Imply (a, b) | ExistsMem (_, a, b) -> *)
(* fv_formula m (fv_formula m s a) b *)
(* | Exists (xs, a) | Forall (xs, a) -> *)
(* VSet.filter (fun v -> not (List.mem v xs)) (fv_formula m s a) *)
(* | Ternary (e, a, b) -> *)
(* fv_expr m (fv_formula m (fv_formula m s a) b) e *)
(* | Predicate p -> *)
(* fv_predicate m s p *)
(* | Value v -> *)
(* fv_value m s v *)
(* | _ -> *)
(* s *)
let eliminate_transition m elim t =
(* let tvars = List.filter (fun vd -> not (IMap.mem vd.var_id elim)) t.tvars
......
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