Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5b377f4
first petch to eliminate [core::option]
Lin23299 Sep 5, 2025
bd8a1fc
added hash table for re-polymorphize
Lin23299 Sep 10, 2025
9bbdcb6
wip: trying to match the lid using hash table
Lin23299 Sep 10, 2025
15684eb
wip: passed array2d
Lin23299 Sep 11, 2025
d5880d9
wip: trying to rewrite slice_len using re-ploy
Lin23299 Sep 11, 2025
13f6d25
passed slice_len by updated bonus_check and moving [drop_unused] afte…
Lin23299 Sep 12, 2025
9ce8401
Merge branch 'AeneasVerif:main' into mono
Lin23299 Sep 12, 2025
caaeee8
wip: trying to fix from_fn by adding fn_ptrs into the re-poly map
Lin23299 Sep 12, 2025
674333f
wip: minor fix of slice_copy
Lin23299 Sep 15, 2025
42deeed
wip: trying to find the trait func impl for from_fn
Lin23299 Sep 15, 2025
ff718b0
merge
Lin23299 Sep 16, 2025
300c02c
fixed the name inconsistency caused by [improve_names]
Lin23299 Sep 16, 2025
3c50bda
wip: fixed trivial case of from_fn and map
Lin23299 Sep 16, 2025
ce3f6ef
apply [remove_empty_struct] on the [lid_full_generic], ignored [pass_…
Lin23299 Sep 17, 2025
14c5b20
minor: recorded different name for partial_eq
Lin23299 Sep 17, 2025
164effc
mono for Builtins with const-generics passed
ssyram Sep 26, 2025
7fb38df
mono debug: fixed partial_eq
ssyram Sep 26, 2025
b4c41e8
mono debug: fixed where_clauses_closures
ssyram Sep 26, 2025
5d85eec
fix undefined static inline in where_clauses_closures and where-claus…
Lin23299 Sep 30, 2025
0e19cd8
Merge branch 'main' of https://github.com/AeneasVerif/eurydice into mono
Lin23299 Oct 14, 2025
a299ba6
Merge branch 'AeneasVerif:main' into mono
Lin23299 Oct 17, 2025
5f05727
Merge branch 'AeneasVerif:main' into mono
Lin23299 Oct 21, 2025
b4f2669
added some binder_value for generics
Lin23299 Oct 21, 2025
a3c210d
Merge branch 'AeneasVerif:main' into mono
Lin23299 Oct 22, 2025
3dfad3d
Fix cremepat
KelvinMYYZJ Oct 23, 2025
bdc4c88
Merge branch 'AeneasVerif:main' into mono
Lin23299 Oct 24, 2025
3adc454
fix monomorphized resugar_loops (no step_by)
KelvinMYYZJ Oct 24, 2025
f8c90dc
Merge branch 'resugar_dev' into mono
KelvinMYYZJ Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ clean-and-test:
.PRECIOUS: %.llbc
%.llbc: %.rs .charon_version
# --mir elaborated --add-drop-bounds
$(CHARON) rustc --preset=eurydice --dest-file "$@" $(CHARON_EXTRA) -- $<
$(CHARON) rustc --monomorphize --preset=eurydice --dest-file "$@" $(CHARON_EXTRA) -- $<

out/test-%/main.c: test/main.c
mkdir -p out/test-$*
Expand All @@ -73,7 +73,7 @@ test/issue_105.llbc: CHARON_EXTRA = \
--include=core::cmp::* \
--include=core::convert::*

test/array2d.llbc: CHARON_EXTRA = --include=core::array::equality::*
# test/array2d.llbc: CHARON_EXTRA = --include=core::array::equality::*

test/core_num.llbc: CHARON_EXTRA = \
--include=core::num::*::BITS \
Expand All @@ -83,6 +83,9 @@ test/println.llbc: CHARON_EXTRA = \
--include=core::fmt::Arguments --include=core::fmt::rt::*::new_const \
--include=core::fmt::rt::Argument

# test-where_clauses_closures: CHARON_EXTRA = \
# --include=core::convert::*

test/option.llbc: CHARON_EXTRA = \
--include=core::option::*

Expand Down
9 changes: 6 additions & 3 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ Supported options:|}
(* Must happen now, before Monomorphization.datatypes, because otherwise
MonomorphizationState.state gets filled with lids that later on get eliminated on the basis
that they were empty structs to begin with, which would send Checker off the rails *)
let files = Krml.DataTypes.remove_empty_structs files in
let files = Eurydice.Cleanup2.remove_empty_structs files in
let files = Krml.Monomorphization.datatypes files in
let files = Eurydice.Cleanup2.drop_unused_type files in
(* Cannot use remove_unit_buffers as it is technically incorrect *)
let files = Krml.DataTypes.remove_unit_fields#visit_files () files in
Eurydice.Logging.log "Phase2.13" "%a" pfiles files;
Expand Down Expand Up @@ -264,7 +265,7 @@ Supported options:|}
let errors, files = Krml.Checker.check_everything ~warn:true files in
if errors then
fail __FILE__ __LINE__;
let files = Krml.Inlining.drop_unused files in
(*let files = Krml.Inlining.drop_unused files in*)
let files = Eurydice.Cleanup2.remove_array_temporaries#visit_files () files in
Eurydice.Logging.log "Phase2.25" "%a" pfiles files;
let files = Eurydice.Cleanup2.remove_array_repeats#visit_files false files in
Expand All @@ -289,7 +290,7 @@ Supported options:|}
let files = Eurydice.Cleanup2.remove_array_from_fn files in
Eurydice.Logging.log "Phase2.6" "%a" pfiles files;
(* remove_array_from_fn, above, creates further opportunities for removing unused functions. *)
let files = Krml.Inlining.drop_unused files in
(* let files = Krml.Inlining.drop_unused files in *)
let files = Eurydice.Cleanup2.remove_implicit_array_copies#visit_files () files in
(* Creates opportunities for removing unused variables *)
let files = Eurydice.Cleanup2.remove_assign_return#visit_files () files in
Expand All @@ -312,6 +313,8 @@ Supported options:|}
let files = Eurydice.Cleanup2.float_comments files in
Eurydice.Logging.log "Phase2.95" "%a" pfiles files;
let files = Eurydice.Cleanup2.bonus_cleanups#visit_files [] files in
let files = Krml.Inlining.drop_unused files in
let files = Eurydice.Cleanup2.drop_unused_monoed_func files in
(* Macros stemming from globals -- FIXME why is this not Krml.AstToCStar.mk_macros_set? *)
let files, macros = Eurydice.Cleanup2.build_macros files in

Expand Down
17 changes: 10 additions & 7 deletions cremepat/cremepat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,16 @@ let compile_parse_tree (env : env) loc
(* EApp (ETApp (e, ts), es) *)
ppat_cons_many ~loc "EApp"
[
ppat_cons_many ~loc "ETApp"
[
compile env head;
compile_expr_list_pattern env cgs;
compile_expr_list_pattern env methods;
compile_typ_list_pattern env ts;
];
(if cgs = [] && methods = [] && ts = [] then
compile env head
else
ppat_cons_many ~loc "ETApp"
[
compile env head;
compile_expr_list_pattern env cgs;
compile_expr_list_pattern env methods;
compile_typ_list_pattern env ts;
]);
ppat_list ~loc (List.map (compile env) args);
]
| Addr e -> ppat_cons_one ~loc "EAddrOf" (compile env e)
Expand Down
20 changes: 20 additions & 0 deletions include/eurydice_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ typedef struct {
end) /* x is already at an array type, no need for cast */
#define Eurydice_array_to_subslice(_arraylen, x, r, t, _0, _1) \
EURYDICE_SLICE((t *)x, r.start, r.end)
// The mono version is exactly the same, just with a different name
#define Eurydice_array_to_subslice_mono(_arraylen, x, r, t, _0, _1) \
EURYDICE_SLICE((t *)x, r.start, r.end)

// Same as above, variant for when start and end are statically known
#define Eurydice_array_to_subslice3(x, start, end, t_ptr) \
Expand All @@ -146,6 +149,11 @@ typedef struct {
EURYDICE_SLICE((t *)x, 0, r)
#define Eurydice_array_to_subslice_from(size, x, r, t, _range_t, _0) \
EURYDICE_SLICE((t *)x, r, size)
// The mono versions are exactly the same, just different names
#define Eurydice_array_to_subslice_to_mono(_size, x, r, t, _range_t, _0) \
EURYDICE_SLICE((t *)x, 0, r)
#define Eurydice_array_to_subslice_from_mono(size, x, r, t, _range_t, _0) \
EURYDICE_SLICE((t *)x, r, size)

// Copy a slice with memcopy
#define Eurydice_slice_copy(dst, src, t) \
Expand Down Expand Up @@ -329,6 +337,17 @@ core_convert_num__core__convert__From_u16__for_usize__from(uint16_t x) {
return x;
}

// for monoed where-clauses_simple
static inline uint64_t
core_convert_num__core__convert__From___u64__u16___from(uint16_t x) {
return x;
}

static inline size_t
core_convert_num__core__convert__From___usize__u16___from(uint16_t x) {
return x;
}

static inline uint32_t core_num__u8__count_ones(uint8_t x0) {
#ifdef _MSC_VER
return __popcnt(x0);
Expand Down Expand Up @@ -549,6 +568,7 @@ typedef const char *Prims_string;
// This is temporary. Ultimately we want to be able to extract all of this.

typedef void *core_fmt_Formatter;
typedef void *core_fmt_Formatter_____;
#define core_fmt_rt__core__fmt__rt__Argument__a___new_display(x1, x2, x3, x4) \
NULL

Expand Down
Loading