Skip to content

cargo-hax-v0.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 09 Nov 15:57
· 14 commits to main since this release
a045d15

Added

Changes to the hax-lib crate:

  • Add implies!, an implication whose right-hand side is evaluated only when
    its left-hand side holds

Lean backend and library:

  • Add models of RangeInclusive and RangeToInclusive
  • Add a model of unsigned_abs for signed integers
  • Add models of contains for Range, RangeFrom, RangeTo and
    RangeToInclusive, and of Range::is_empty

F* backend and library:

  • Add models of RangeInclusive and RangeToInclusive
  • Add a model of unsigned_abs for signed integers
  • Add models of contains for Range, RangeFrom, RangeTo and
    RangeToInclusive, and of Range::is_empty

Fixed

Changes to the hax-lib crate:

  • The Rust semantics of implies is no longer reversed

Changes to the frontend:

  • Impls now list the bounds on the generic parameters of their trait as parent bounds (#1554)

Lean backend and library:

  • v.iter().all(..) and v.iter().any(..) on slices no longer fail with an
    unknown constant

F* backend and library:

  • Iterator::{all, any, find, find_map, position} now take &mut self as in
    std and return the advanced iterator with their result, matching extracted
    call sites
  • Formatter::write_str is now Core_models.Fmt.impl_11__write_str, the name
    extracted client code calls, instead of impl_Formatter__write_str

ProVerif backend and library:

  • Breaking: full re-implementation of the backend under the Rust engine. The library
    scope and its interface with extracted code is also refactored.
  • Reject the code that each Result model would get wrong: by default, a
    Result that is not returned or consumed at once, or code that goes on
    after an Err; with --result-errors, the same for a Result that may
    carry the error of a hand-written model, except that an arm may recover
    from its Err
  • Add #[hax_lib::pv_unchecked_results], which exempts a function from
    these checks
  • #[pv_inverse_of(f)] on g makes g match its argument against f,
    without a reduc, and accepts methods

Changed

Changes to cargo-hax:

  • Breaking: anodized specifications need anodized 0.8.0 or later; hax no
    longer sets anodized_discard_specs

Lean backend and library:

  • Breaking: the Lean library and the extracted Lean files are Lean modules.
    A module can only import modules, so the hand-written models in
    Assumptions/, which the extraction imports, have to become modules too:
    start each file with module, turn its imports into public imports,
    and put @[expose] public section after them.
  • Breaking: the fields start and «end» of ops.range.RangeInclusive are
    now start_ and end_, and RangeInclusive.start and RangeInclusive.end
    are functions
  • Breaking: bump Lean to v4.35.0 and update aeneas. Proofs may need updating:
    if_pos/if_neg no longer rewrite ifs (use ite_eq_left/ite_eq_right),
    and hand-written models that extracted code instantiates must take Type _
    rather than Type parameters
  • Update aeneas to build-2b9e3ea and charon to nightly-2026.10.31

F* backend and library:

  • Breaking: the fields f_start and f_end of t_RangeInclusive are now
    f_start_ and f_end_