Skip to content

Commit 96bb950

Browse files
committed
docs(Boole): explain circular queue successor helper
1 parent 5df3164 commit 96bb950

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Cslib/Languages/Boole/examples/circular_queue.lean

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ program Boole;
1616

1717
type Array := Map int int;
1818

19-
// `NextIndex(i, n)` is `(i + 1) mod n`, axiomatized without using `mod`.
19+
// `NextIndex(i, n)` is the usual circular-buffer successor:
20+
// `if i + 1 == n then 0 else i + 1`.
21+
//
22+
// It is axiomatized here because both obvious executable encodings currently
23+
// get in the way of this small example: `mod` is not yet convenient in these
24+
// VCs, and the direct Boole if/else form triggers an integer-valued `ite`
25+
// elaboration issue in the generated VCs.
2026
function NextIndex(i : int, n : int) : int;
2127

2228
axiom (∀ i : int, n : int ::

0 commit comments

Comments
 (0)