You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kmir/src/kmir/kdist/mir-semantics/lemmas/kmir-lemmas.md
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This file contains basic lemmas required for symbolic execution of MIR programs
4
4
5
5
Lemmas are simpliciations of symbolic function application that aims to confirm conditions for rewrite rules to avoid spurious branching on symbolic program parts.
6
6
7
-
Some of the lemmas relate to the control flow implementation in `kmir.md` and will be needed in various proofs (for instance the simplification of list size for partially-symbolic lists of locals or stack frames).
7
+
Some of the lemmas relate to the control flow implementation in `kmir.md` and will be needed in various proofs (for instance the simplification of list size for partially-symbolic lists of locals or stack frames).
8
8
Others are related to helper functions used for integer arithmetic.
9
9
10
10
```k
@@ -20,7 +20,7 @@ module KMIR-LEMMAS
20
20
```
21
21
## Simplifications for lists to avoid spurious branching on error cases in control flow
22
22
23
-
Rewrite rules that look up locals or stack frames require that an index into the respective `List`s in the configuration be within the bounds of the locals list/stack. Therefore, the `size` function on lists needs to be computed. The following simplifications allow for locals and stacks to have concrete values in the beginning but a symbolic rest (of unknown size).
23
+
Rewrite rules that look up locals or stack frames require that an index into the respective `List`s in the configuration be within the bounds of the locals list/stack. Therefore, the `size` function on lists needs to be computed. The following simplifications allow for locals and stacks to have concrete values in the beginning but a symbolic rest (of unknown size).
24
24
The lists used in the semantics are cons-lists, so only rules with a head element match are required.
25
25
26
26
```k
@@ -74,6 +74,24 @@ Definedness of the list and list elements is also guaranteed.
74
74
[simplification]
75
75
```
76
76
77
+
## Simplifications for `enum` Discriminants and Variant Indexes
78
+
79
+
For symbolic enum values, the variant index remains unevaluated but the original (symbolic) discriminant can be restored:
0 commit comments