Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lemmas review #71

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lemmas: improve wording and remove extra brackets
asymmetric committed Apr 30, 2020
commit 31268e02cba83e8855e51c1859f884efe396bc4c
15 changes: 8 additions & 7 deletions src/lemmas.k.md
Original file line number Diff line number Diff line change
@@ -101,16 +101,17 @@ rule X modInt Y => X
requires X <Int Y
```

### Commutativity For Bitwise `AND`
### Normal Form for Bitwise `AND`

`K` doesn't know that bitwise `AND` is commutative, so we give it a little helping hand.
These lemmas ensure that the concrete value is always on the left hand-side of
the bitwise `AND`:

```k
rule (X &Int maxUInt32) => (maxUInt32 &Int X)
rule (X &Int maxUInt112) => (maxUInt112 &Int X)
rule (X &Int maxUInt160) => (maxUInt160 &Int X)
rule (X &Int notMaxUInt160) => (notMaxUInt160 &Int X)
rule (X &Int notMaxUInt224) => (notMaxUInt224 &Int X)
rule X &Int maxUInt32 => maxUInt32 &Int X
rule X &Int maxUInt112 => maxUInt112 &Int X
rule X &Int maxUInt160 => maxUInt160 &Int X
rule X &Int notMaxUInt160 => notMaxUInt160 &Int X
rule X &Int notMaxUInt224 => notMaxUInt224 &Int X
```

### Factory pairs array