We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here, gospel check succeed because 0 is coerced to an integer.
0
type 'a t (*@ mutable model contents : 'a sequence *) val create : unit -> 'a t (*@ q = create () ensures q.contents = Sequence.empty *) val pop_opt : 'a t -> 'a option (*@ o = pop_opt q modifies q.contents ensures q.contents = match Sequence.length (old q.contents) with | 0 -> Sequence.empty | _ -> Sequence.tl (old q.contents) *)
But, in the generated code, 0 is an int:
let next_state cmd__002_ state__003_ = match cmd__002_ with | Pop_opt -> { contents = ((try match Ortac_runtime.Gospelstdlib.Sequence.length state__003_.contents with | 0 -> Ortac_runtime.Gospelstdlib.Sequence.empty | _ -> Ortac_runtime.Gospelstdlib.Sequence.tl state__003_.contents with | e -> ... }
The text was updated successfully, but these errors were encountered:
Add a guard testing equality for integer constant pattern
0246a95
Fixes ocaml-gospel#172
8a82eb9
Successfully merging a pull request may close this issue.
Here, gospel check succeed because
0
is coerced to an integer.But, in the generated code,
0
is an int:The text was updated successfully, but these errors were encountered: