Skip to content

Remove termination conditions in invariants#264

Merged
tahina-pro merged 8 commits intoproject-everest:_nik_smt_univs_2025from
tahina-pro:_taramana_smt_univs_20260302_pulse
Mar 16, 2026
Merged

Remove termination conditions in invariants#264
tahina-pro merged 8 commits intoproject-everest:_nik_smt_univs_2025from
tahina-pro:_taramana_smt_univs_20260302_pulse

Conversation

@tahina-pro
Copy link
Copy Markdown
Member

@tahina-pro tahina-pro commented Mar 16, 2026

Following FStarLang/pulse#573, invariant b . <...> is no longer supported. Neither are compound loop termination conditions.

This PR adapts the Pulse combinators in LowParse, CBOR and CDDL accordingly.

This PR has mostly been authored by GitHub Copilot CLI 0.421.0 using Claude Opus 4.6.

tahina-pro and others added 8 commits March 2, 2026 21:36
Remove explicit boolean termination variable from while loop invariants
across all Pulse files. The old syntax 'invariant b . <body using b>'
is replaced with 'invariant <body>', and all 'pure(b == ...)' clauses
referencing the removed boolean are deleted.

Additional fixes required by the new while loop checker:
- Flatten 'if (res) { ... } else { false }' condition blocks to
  'res && ...' expressions to avoid branching in condition blocks
- Use pcont mutable ref pattern in Parse.MapGroup.fst where the
  checker cannot resolve uvars in flattened conditions
- Provide explicit Trade.trans_hyp_r argument in Nondet.fst to
  disambiguate between multiple Trade predicates
- Inline impl_map_group_filter_invariant in MapGroup.fst to avoid
  opaque predicate issues with exists*
- Add explicit assertions and z3rlimit increases where the new
  checker's separate exit condition pure facts require SMT guidance

Files modified (15):
- lowparse/pulse: Recursive.fst, VCList.fst
- cbor/pulse/raw: Copy.fst, Nondet.fst, Compare.Base.fst,
  Nondet.Compare.fst, Insert.fst, Compare.Iterator.fst,
  API.Det.Common.fst
- cbor/pulse/raw/everparse: Format.Parse.fst, UTF8.fst, Nondet.Gen.fst
- cddl/pulse: ArrayGroup.fst, MapGroup.fst, Parse.MapGroup.fst

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…parse into _taramana_smt_univs_20260302_pulse
Update two while loops to use the new invariant syntax from Pulse PR 573:
- Remove explicit boolean variable binding (invariant b. -> invariant)
- Remove pure(b == ...) clauses
- Flatten if/else condition blocks to && expressions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tahina-pro tahina-pro merged commit d210324 into project-everest:_nik_smt_univs_2025 Mar 16, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant