Skip to content

Commit

Permalink
feat(bounded-ints): add refinement_int macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Franceschino committed Jun 18, 2024
1 parent 0547d73 commit 07660f8
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 68 deletions.
16 changes: 14 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions engine/lib/phases/phase_newtype_as_refinement.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module Make (F : Features.T) =
| App { f = { e = GlobalVar f; _ }; args = [ inner ]; _ }
when Ast.Global_ident.eq_name Hax_lib__Refinement__new f
|| Ast.Global_ident.eq_name Hax_lib__RefineAs__into_checked f
|| Ast.Global_ident.eq_name Hax_lib__Refinement__get_mut f
|| Ast.Global_ident.eq_name Hax_lib__Refinement__get f ->
{ e with e = Ascription { typ = e.typ; e = inner } }
| _ -> super#visit_expr () e
Expand Down
1 change: 1 addition & 0 deletions engine/names/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn dummy_hax_concrete_ident_wrapper<I: core::iter::Iterator<Item = u8>>(x: I, mu
use hax_lib::{RefineAs, Refinement};

fn refinements<T: Refinement, U: RefineAs<T>>(x: T, y: U) -> T {
let _ = x.get_mut();
T::new(x.get());
y.into_checked()
}
Expand Down
2 changes: 2 additions & 0 deletions hax-bounded-integers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ repository.workspace = true
readme.workspace = true

[dependencies]
duplicate = "1.0.0"
hax-lib.workspace = true
paste = "1.0.15"
Loading

0 comments on commit 07660f8

Please sign in to comment.