Skip to content

Commit e115b4a

Browse files
style: single-line inner foralls, one set per line in quantifier macro
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4e103ed commit e115b4a

File tree

1 file changed

+10
-15
lines changed
  • crates/move-prover-boogie-backend/src/boogie_backend/prelude

1 file changed

+10
-15
lines changed

crates/move-prover-boogie-backend/src/boogie_backend/prelude/native.bpl

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,9 +1090,11 @@ axiom (forall t: {{Type}}, k: {{K}} :: {({{impl.fun_exists_inner}}{{SK}}(t, k))}
10901090
{%- set RT = instance.result_type -%}
10911091
{%- set EAA = instance.extra_args_after -%}
10921092
{%- if instance.extra_args_before == "" -%}
1093-
{%- set EAB = "" -%}{%- set CAT = EAA -%}
1093+
{%- set EAB = "" -%}
1094+
{%- set CAT = EAA -%}
10941095
{%- else -%}
1095-
{%- set EAB = instance.extra_args_before ~ ", " -%}{%- set CAT = ", " ~ instance.extra_args_before ~ EAA -%}
1096+
{%- set EAB = instance.extra_args_before ~ ", " -%}
1097+
{%- set CAT = ", " ~ instance.extra_args_before ~ EAA -%}
10961098
{%- endif -%}
10971099

10981100
{%- if instance.qht == "find_indices" %}
@@ -1111,12 +1113,9 @@ axiom (forall {{QP}} :: {$FindIndicesQuantifierHelper_{{FN}}({{QA}})}
11111113
LenVec(res) <= (if start <= end then end - start else 0) &&
11121114
(start >= end ==> res == EmptyVec()) &&
11131115
// soundness: every element is a valid in-range index where FN holds
1114-
(forall i: int :: InRangeVec(res, i) ==>
1115-
start <= ReadVec(res, i) && ReadVec(res, i) < end &&
1116-
{{FN}}({{EAB}}ReadVec(v, ReadVec(res, i)){{EAA}})) &&
1116+
(forall i: int :: InRangeVec(res, i) ==> start <= ReadVec(res, i) && ReadVec(res, i) < end && {{FN}}({{EAB}}ReadVec(v, ReadVec(res, i)){{EAA}})) &&
11171117
// completeness: every matching index in [start, end) is in res
1118-
(forall j: int :: start <= j && j < end && {{FN}}({{EAB}}ReadVec(v, j){{EAA}}) ==>
1119-
ContainsVec(res, j))
1118+
(forall j: int :: start <= j && j < end && {{FN}}({{EAB}}ReadVec(v, j){{EAA}}) ==> ContainsVec(res, j))
11201119
)
11211120
);
11221121
// strict ordering — separate trigger so it only fires when comparing elements
@@ -1171,14 +1170,11 @@ axiom (forall {{QP}} :: {$FilterQuantifierHelper_{{FN}}({{QA}})}
11711170
LenVec(res) <= (if start <= end then end - start else 0) &&
11721171
(start >= end ==> res == EmptyVec()) &&
11731172
// soundness: every element satisfies FN
1174-
(forall i: int :: InRangeVec(res, i) ==>
1175-
{{FN}}({{EAB}}ReadVec(res, i){{EAA}})) &&
1173+
(forall i: int :: InRangeVec(res, i) ==> {{FN}}({{EAB}}ReadVec(res, i){{EAA}})) &&
11761174
// provenance: every element came from v
1177-
(forall i: int :: InRangeVec(res, i) ==>
1178-
ContainsVec(v, ReadVec(res, i))) &&
1175+
(forall i: int :: InRangeVec(res, i) ==> ContainsVec(v, ReadVec(res, i))) &&
11791176
// completeness: every matching v-element is in res
1180-
(forall j: int :: start <= j && j < end && {{FN}}({{EAB}}ReadVec(v, j){{EAA}}) ==>
1181-
ContainsVec(res, ReadVec(v, j)))
1177+
(forall j: int :: start <= j && j < end && {{FN}}({{EAB}}ReadVec(v, j){{EAA}}) ==> ContainsVec(res, ReadVec(v, j)))
11821178
)
11831179
);
11841180
// end-step — compound trigger
@@ -1259,8 +1255,7 @@ axiom (forall {{QP}}:: {$MapQuantifierHelper_{{FN}}({{QA}})}
12591255
$IsValid'{{instance.result_is_valid_suffix}}'(res) &&
12601256
LenVec(res) == (if start <= end then end - start else 0) &&
12611257
(start >= end ==> res == EmptyVec()) &&
1262-
(forall i: int :: start <= i && i < end ==>
1263-
ReadVec(res, i - start) == {{FN}}({{EAB}}ReadVec(v, i){{EAA}}))
1258+
(forall i: int :: start <= i && i < end ==> ReadVec(res, i - start) == {{FN}}({{EAB}}ReadVec(v, i){{EAA}}))
12641259
)
12651260
);
12661261
// end-step — compound trigger

0 commit comments

Comments
 (0)