Skip to content

Commit

Permalink
Merge pull request #254 from Nadrieril/declarationgroup-mixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril authored Jun 21, 2024
2 parents c8ad44f + d3f52e2 commit f264b9d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charon-pin
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This is the commit from https://github.com/AeneasVerif/charon that should be used with this version of aeneas.
81c0edf20eefb55a0b2f2bc5ab029ec96e75a82c
61685783db8135df945e53b302dc3e364b7892ee
7 changes: 7 additions & 0 deletions compiler/FunsAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ let analyze_module (m : crate) (funs_map : fun_decl FunDeclId.Map.t)
let global = GlobalDeclId.Map.find id globals_map in
analyze_fun_decl_group (NonRecGroup global.body);
analyze_decl_groups decls'
| MixedGroup ids :: _ ->
craise_opt_span __FILE__ __LINE__ None
("Mixed declaration groups are not supported yet: ["
^ String.concat ", "
(List.map Charon.PrintGAst.any_decl_id_to_string
(Charon.GAstUtils.g_declaration_group_to_list ids))
^ "]")
in

analyze_decl_groups m.declarations;
Expand Down
2 changes: 1 addition & 1 deletion compiler/Interpreter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module SA = SymbolicAst
let log = Logging.interpreter_log

let compute_contexts (m : crate) : decls_ctx =
let type_decls_list, _, _, _, _ = split_declarations m.declarations in
let type_decls_list, _, _, _, _, _ = split_declarations m.declarations in
let type_decls = m.type_decls in
let fun_decls = m.fun_decls in
let global_decls = m.global_decls in
Expand Down
1 change: 0 additions & 1 deletion compiler/Print.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ open Charon.PrintTypes
open Charon.PrintExpressions
open Charon.PrintLlbcAst.Ast
open Types
open TypesUtils
open Values
open ValuesUtils
open Expressions
Expand Down
3 changes: 3 additions & 0 deletions compiler/Translate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ let extract_definitions (fmt : Format.formatter) (config : gen_config)
| TraitImplGroup id ->
if config.extract_trait_impls && config.extract_transparent then
export_trait_impl id
| MixedGroup _ ->
craise_opt_span __FILE__ __LINE__ None
"Mixed-recursive declaration groups are not supported"
in

(* If we need to export the state type: we try to export it after we defined
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

2 changes: 1 addition & 1 deletion scripts/update-charon-pin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if ! which jq 2> /dev/null 1>&2; then
fi

if [ -L charon ]; then
echo '`./charon` is a symlink; we using the commit there for our new pin.'
echo '`./charon` is a symlink; we will use the commit there for our new pin.'
COMMIT="$(git -C charon rev-parse HEAD)"
nix flake lock --override-input charon "github:aeneasverif/charon/$COMMIT"
else
Expand Down
6 changes: 3 additions & 3 deletions tests/src/mutually-recursive-traits.lean.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Uncaught exception:

Raised at Aeneas__Errors.craise_opt_span in file "Errors.ml", line 47, characters 4-76
Called from Stdlib__List.iter in file "list.ml", line 110, characters 12-15
Called from Aeneas__Translate.extract_definitions in file "Translate.ml", line 836, characters 2-52
Called from Aeneas__Translate.extract_file in file "Translate.ml", line 963, characters 2-36
Called from Aeneas__Translate.translate_crate in file "Translate.ml", line 1512, characters 5-42
Called from Aeneas__Translate.extract_definitions in file "Translate.ml", line 839, characters 2-52
Called from Aeneas__Translate.extract_file in file "Translate.ml", line 966, characters 2-36
Called from Aeneas__Translate.translate_crate in file "Translate.ml", line 1515, characters 5-42
Called from Dune__exe__Main in file "Main.ml", line 317, characters 14-66

0 comments on commit f264b9d

Please sign in to comment.