Skip to content

Commit

Permalink
rename LemmaRepeatCommutative
Browse files Browse the repository at this point in the history
  • Loading branch information
HSMF committed Dec 4, 2024
1 parent c87b588 commit 1da4e70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bytes/repeat_lemmas.gobra
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ghost
requires n >= 0
ensures b ++ Repeat(b, n) == Repeat(b, n) ++ b
decreases
func LemmaRepeatCommutative(b seq[byte], n int) {
func LemmaRepeatCommutesWithConcat(b seq[byte], n int) {
assert b ++ Repeat(b, n) == Repeat(b, n+1)
lemmaRepeatFlip(b, n+1)
}
Expand All @@ -42,7 +42,7 @@ func LemmaRepeatDoubled(b seq[byte], n int) {
assert Repeat(b, n) ++ Repeat(b, n) == b ++ Repeat(b, n - 1) ++ b ++ Repeat(b, n - 1)
// order of repeating doesn't matter because it's always the same element that is repeated
assert b ++ Repeat(b, n - 1) ++ b ++ Repeat(b, n - 1) == b ++ (Repeat(b, n - 1) ++ b) ++ Repeat(b, n - 1)
LemmaRepeatCommutative(b, n - 1)
LemmaRepeatCommutesWithConcat(b, n - 1)
assert b ++ (Repeat(b, n - 1) ++ b) ++ Repeat(b, n - 1) == b ++ (b ++ Repeat(b, n - 1)) ++ Repeat(b, n - 1)
assert b ++ Repeat(b, n - 1) ++ b ++ Repeat(b, n - 1) == b ++ b ++ Repeat(b, n - 1) ++ Repeat(b, n - 1)
LemmaRepeatDoubled(b, n - 1)
Expand Down

0 comments on commit 1da4e70

Please sign in to comment.