Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ff29fdd
draft support of rvalue with metadata
ssyram Aug 9, 2025
616877b
unop for ptr-metadata
ssyram Aug 9, 2025
7d31e84
error for fetching meta from generics
ssyram Aug 9, 2025
81bb856
unchanged builtin type of slice
Lin23299 Aug 13, 2025
70db499
updated [typ_of_ty] for fat pointer
Lin23299 Aug 13, 2025
35e19f3
Merge branch 'array_handling' into c-better-unsize
Lin23299 Aug 14, 2025
56811ee
rename c_char_t and c_void_t
Lin23299 Aug 14, 2025
fff533c
defined array_to_subslice_to using abs syntax
Lin23299 Aug 14, 2025
ed85c63
Merge branch 'main' of github.com:AeneasVerif/eurydice into c-better-…
Lin23299 Aug 19, 2025
71f392a
added [remove_unused_builtin] in PreCleanup to remove the funcs writt…
Lin23299 Aug 19, 2025
8056259
updated abstract syntan defs
Lin23299 Aug 20, 2025
8583acd
added other builtin funcs for slice<T>, not tested
Lin23299 Aug 20, 2025
e03ab05
Added simple case for PtrMetadata inheritance
ssyram Aug 20, 2025
4ed93f7
removed dst_def, cleanup and special treatment of dst fields
Lin23299 Aug 21, 2025
c6cd0e2
Merge branch 'main' of github.com:AeneasVerif/eurydice into c-better-…
Lin23299 Aug 22, 2025
b9a9190
more cleanup about dst
Lin23299 Aug 22, 2025
03167e8
updated str, using c_star_t instead of prims_string
Lin23299 Aug 22, 2025
480f94a
updated glue.h, test cases passed
Lin23299 Aug 22, 2025
e4b1af2
removed special case for non-dst field, leaving the [slice_of_dst] case
Lin23299 Aug 25, 2025
01429aa
Merge branch 'AeneasVerif:main' into c-better-unsize
Lin23299 Aug 27, 2025
767bbe1
removed the macro def of slice, replaced slice_of_dst into ECast
Lin23299 Aug 27, 2025
13b8de2
updated testcases following changes in krml
Lin23299 Aug 28, 2025
2875732
simplified taking dst field, removed special cases for Slice which se…
Lin23299 Aug 28, 2025
6317f70
removed [dsts] in [env]
Lin23299 Aug 28, 2025
2a5ecef
removed is_dst_ref in expr_of_place for finding field
Lin23299 Aug 29, 2025
ee08698
using the meta from charon to generalize CastUnsize with test case
Lin23299 Aug 29, 2025
6bd114c
Merge branch 'main' of github.com:AeneasVerif/eurydice into c-better-…
Lin23299 Sep 2, 2025
28fd66c
wip: rewriting slice_to_array
Lin23299 Sep 2, 2025
dad9f88
supported [slice_to_array] using memcpy, added test case in [slice_ar…
Lin23299 Sep 3, 2025
0855373
supported slice_to_ref_array reusing the C choose expression and defi…
Lin23299 Sep 3, 2025
07567ea
fixed memcpy length for slice_to_array
Lin23299 Sep 4, 2025
331a405
cleanup & updated output for charon
Lin23299 Sep 4, 2025
287aebc
Merge branch 'main' of github.com:AeneasVerif/eurydice into c-better-…
Lin23299 Sep 18, 2025
8dcdc6d
Merge remote-tracking branch 'upstream/main' into c-better-unsize
ssyram Oct 2, 2025
aeeb403
Merge branch 'main' of https://github.com/AeneasVerif/eurydice into c…
Lin23299 Oct 8, 2025
54b3558
Merge branch 'AeneasVerif:main' into c-better-unsize
Lin23299 Oct 9, 2025
ce512e4
minors
Lin23299 Oct 9, 2025
639dedd
removed commented-out code in glue.h
Lin23299 Oct 9, 2025
807c3c4
removed add_extra_type_to_slice_index
Lin23299 Oct 9, 2025
21b08bd
correct vtable
ssyram Oct 9, 2025
23c81e8
fixing vtables
ssyram Oct 9, 2025
2a7726e
cleanup
ssyram Oct 9, 2025
becfd61
Merge branch 'main' of https://github.com/AeneasVerif/eurydice into c…
Lin23299 Oct 27, 2025
c209ff9
Refresh
protz 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
1 change: 0 additions & 1 deletion bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ Supported options:|}
[ "Eurydice" ], "slice_len";
[ "Eurydice" ], "slice_copy";
[ "Eurydice" ], "array_eq";
[ "Eurydice" ], "slice_to_array2";
]);

(* Some logic for more precisely tracking readonly functions, so as to remove
Expand Down
15 changes: 15 additions & 0 deletions lib/AstOfLlbc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ let rec expression_of_place (env : env) (p : C.place) : K.expr =
in
let expr = K.with_type place_typ (K.EBound 0) in
K.with_type place_typ (K.EMatch (Unchecked, !*sub_e, [ binders, pattern, expr ]))
(* | PlaceProjection () *)
| _ -> fail "unexpected / ill-typed projection"
end

Expand Down Expand Up @@ -1888,6 +1889,20 @@ let expression_of_rvalue (env : env) (p : C.rvalue) expected_ty : K.expr =
else
failwith
("unknown cast: `" ^ Charon.PrintExpressions.cast_kind_to_string env.format_env ck ^ "`")
(* | UnaryOp (PtrMetadata, e) ->
let e = expression_of_operand env e in begin
match e.typ with
| TApp (lid, [ _; meta_ty ]) when lid = Builtin.dst_ref ->
K.(with_type meta_ty (EField (e, "meta")))
(* In cases like `PtrMetadata(T)` when `T` is a type variable or some types with unresolved type variable,
We cannot tell the correct metadata type from it until fully monomorphized.
But we can surely rely on monomorphized LLBC, and we ignore handling such cases in Eurydice. *)
| ty when has_unresolved_generic ty ->
failwith "Eurydice do not handle ptr-metadata for generic types. Consider using monomorphized LLBC."
(* Otherwise, fetching ptr-metadata from a non-DST simply results in `()`
When a type is fully resolved and it is not `Eurydice::DstRef`, we can be confident that it is not a DST. *)
| _ -> K.with_type TUnit K.EUnit
end *)
| UnaryOp (op, o1) -> mk_op_app (op_of_unop op) (expression_of_operand env o1) []
| BinaryOp (op, o1, o2) ->
mk_op_app (op_of_binop op) (expression_of_operand env o1) [ expression_of_operand env o2 ]
Expand Down
2 changes: 1 addition & 1 deletion test/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn const_eq<const K:usize>(x: [u32; K], y: [u32; K]) -> bool {
pub fn fun(x: &[[u8; 32]]) -> u8 {
x[0][0..1][0]
}

fn init() -> [u8; 32] {
[0u8; 32]
}
Expand Down
2 changes: 2 additions & 0 deletions test/dyn_trait_struct_type.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
trait Trait {
fn method(&self);
}

// impl Trait for i32 {
// fn method(&self) {
// assert!(*self > 0);
// }
// }

fn use_trait(t: &dyn Trait) {
t.method();
}
Expand Down