Skip to content

Commit 3a030af

Browse files
Cameron-Lowstrub
authored andcommitted
sim: deadcode should check program variable isn't part of any memory of globals in the current eq.
1 parent bbd50c4 commit 3a030af

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

src/ecPV.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,15 @@ module Mpv2 = struct
698698
Sm.exists check_mp mod_.PV.s_gl
699699
else false
700700

701+
let is_mod_pv' env pv eqo =
702+
if is_glob pv then
703+
let x = get_glob pv in
704+
let check_mp mp =
705+
let restr = NormMp.get_restr_use env mp in
706+
not (NormMp.use_mem_xp x restr) in
707+
Sm.exists check_mp eqo.s_gl
708+
else false
709+
701710
let is_mod_mp env mp mod_ =
702711
let restr = NormMp.get_restr_use env mp in
703712
let check_v pv _ty =

src/ecPV.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ module Mpv2 : sig
194194
val split_nmod : env -> PV.t -> PV.t -> t -> t
195195
val split_mod : env -> PV.t -> PV.t -> t -> t
196196

197+
val is_mod_pv' : env -> prog_var -> t -> bool
197198
val mem_pv_l : env -> prog_var -> t -> bool
198199
val mem_pv_r : env -> prog_var -> t -> bool
199200
end

src/phl/ecPhlEqobs.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ let check_lvalue aux lv =
112112
let check_not_l sim lvl eqo =
113113
let aux pv =
114114
check sim pv sim.sim_ifvl &&
115+
not (Mpv2.is_mod_pv' sim.sim_env pv eqo) &&
115116
not (Mpv2.mem_pv_l sim.sim_env pv eqo) in
116117
check_lvalue aux lvl
117118

118119
let check_not_r sim lvr eqo =
119120
let aux pv =
120121
check sim pv sim.sim_ifvr &&
122+
not (Mpv2.is_mod_pv' sim.sim_env pv eqo) &&
121123
not (Mpv2.mem_pv_r sim.sim_env pv eqo) in
122124
check_lvalue aux lvr
123125

theories/query_counting/Counter.eca

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module Counter(S : System) = {
3434
}.
3535

3636
section.
37-
declare module S <: System.
37+
declare module S <: System { -Counter }.
3838
declare module D <: Distinguisher { -S }.
3939

4040

0 commit comments

Comments
 (0)