From ab53681b13ce3e45f1814e99785d133d75dbb5b0 Mon Sep 17 00:00:00 2001 From: Guillaume Claret Date: Tue, 16 Jan 2024 12:45:56 +0100 Subject: [PATCH] wip: add impl as axiom instead of notation --- CoqOfRust/_std/ops.v | 8 +- CoqOfRust/alloc/collections/btree/map.v | 57 +- CoqOfRust/alloc/vec.v | 11 - CoqOfRust/blacklist.txt | 19 - .../conversion/converting_to_string.v | 4 +- .../axiomatized/examples/conversion/from.v | 5 +- .../axiomatized/examples/conversion/into.v | 5 +- .../conversion/try_from_and_try_into.v | 13 +- .../custom_types/enums_testcase_linked_list.v | 18 +- .../custom_types/enums_type_aliases_v2.v | 4 +- .../examples/custom_types/structures.v | 4 +- .../examples/error_handling/boxing_errors.v | 13 +- .../error_handling/combinators_and_then.v | 8 +- .../examples/error_handling/combinators_map.v | 16 +- .../error_handling/defining_an_error_type.v | 13 +- .../other_uses_of_question_mark.v | 8 +- ...g_options_and_defaults_via_get_or_insert.v | 4 +- ...ions_and_defaults_via_get_or_insert_with.v | 4 +- .../unpacking_options_and_defaults_via_or.v | 4 +- ...packing_options_and_defaults_via_or_else.v | 4 +- .../unpacking_options_via_question_mark.v | 16 +- .../examples/error_handling/wrapping_errors.v | 18 +- .../expressions/const_underscore_expression.v | 5 +- .../associated_functions_and_methods.v | 34 +- .../examples/functions/functions_order.v | 30 +- .../generics_associated_types_problem.v | 15 +- .../generics_associated_types_solution.v | 19 +- .../examples/generics/generics_bounds.v | 9 +- .../generics/generics_implementation.v | 10 +- .../generics/generics_new_type_idiom.v | 10 +- .../examples/generics/generics_phantom_type.v | 8 +- ...hantom_type_test_case_unit_clarification.v | 31 +- .../examples/generics/generics_traits.v | 5 +- .../generics/generics_where_clauses.v | 5 +- .../ink_contracts/basic_contract_caller.v | 32 +- .../examples/ink_contracts/call_runtime.v | 71 +-- .../ink_contracts/conditional_compilation.v | 79 +-- .../ink_contracts/contract_terminate.v | 39 +- .../ink_contracts/contract_transfer.v | 54 +- .../examples/ink_contracts/custom_allocator.v | 18 +- .../ink_contracts/custom_environment.v | 48 +- .../axiomatized/examples/ink_contracts/dns.v | 132 +---- .../examples/ink_contracts/e2e_call_runtime.v | 39 +- .../examples/ink_contracts/erc1155.v | 159 ++---- .../examples/ink_contracts/erc20.v | 98 +--- .../examples/ink_contracts/erc721.v | 203 ++----- .../examples/ink_contracts/flipper.v | 18 +- .../examples/ink_contracts/incrementer.v | 17 +- .../lang_err_integration_tests/call_builder.v | 45 +- .../call_builder_delegate.v | 19 +- .../constructors_return_value.v | 49 +- .../lang_err_integration_tests/contract_ref.v | 64 +-- .../integration_flipper.v | 32 +- .../ink_contracts/mapping_integration_tests.v | 102 +--- .../examples/ink_contracts/mother.v | 167 ++---- .../examples/ink_contracts/multisig.v | 250 +++------ .../examples/ink_contracts/payment_channel.v | 167 ++---- .../examples/ink_contracts/set_code_hash.v | 22 +- .../set_code_hash/updated_incrementer.v | 43 +- .../examples/ink_contracts/trait_erc20.v | 112 +--- .../examples/ink_contracts/trait_flipper.v | 13 +- .../ink_contracts/trait_incrementer.v | 22 +- .../ink_contracts/wildcard_selector.v | 15 +- .../examples/modules/struct_visibility.v | 9 +- .../monadic_transformation/example05.v | 5 +- .../axiomatized/examples/primitives/tuples.v | 4 +- .../scoping_rules_borrowing_mutablity.v | 5 +- .../scoping_rules_borrowing_the_ref_pattern.v | 5 +- .../scoping_rules_lifetimes_bounds.v | 4 +- .../scoping_rules_lifetimes_methods.v | 10 +- .../scoping_rules_lifetimes_structs.v | 12 +- .../scoping_rules_lifetimes_traits.v | 9 +- ..._rules_ownership_and_rules_partial_moves.v | 4 +- .../scoping_rules_raii_desctructor.v | 5 +- .../std_library_types/box_stack_heap.v | 9 +- .../hash_map_alternate_or_custom_key_types.v | 17 +- .../examples/std_library_types/result.v | 9 +- .../result_chaining_with_question_mark.v | 9 +- .../std_misc/foreign_function_interface.v | 9 +- .../examples/axiomatized/examples/subtle.v | 391 ++++--------- .../axiomatized/examples/traits/clone.v | 18 +- .../axiomatized/examples/traits/derive.v | 18 +- .../disambiguating_overlapping_traits.v | 8 +- .../axiomatized/examples/traits/drop.v | 5 +- .../axiomatized/examples/traits/hash.v | 7 +- .../axiomatized/examples/traits/iterators.v | 5 +- .../examples/traits/operator_overloading.v | 16 +- .../traits/returning_traits_with_dyn.v | 10 +- .../axiomatized/examples/traits/traits.v | 29 +- .../examples/traits/traits_parms.v | 5 +- .../default/examples/cargo/concurrent_tests.v | 84 +-- .../conversion/converting_to_string.v | 10 +- .../default/examples/conversion/from.v | 5 +- .../default/examples/conversion/into.v | 5 +- .../examples/conversion/parsing_a_string.v | 6 +- .../conversion/try_from_and_try_into.v | 15 +- .../default/examples/custom_types/constants.v | 14 +- .../default/examples/custom_types/enums.v | 20 +- .../examples/custom_types/enums_c_like.v | 24 +- .../custom_types/enums_testcase_linked_list.v | 56 +- .../custom_types/enums_type_aliases_v2.v | 4 +- .../default/examples/custom_types/enums_use.v | 8 +- .../examples/custom_types/structures.v | 40 +- .../error_handling/aliases_for_result.v | 20 +- .../examples/error_handling/boxing_errors.v | 59 +- .../error_handling/combinators_and_then.v | 25 +- .../examples/error_handling/combinators_map.v | 39 +- .../error_handling/defining_an_error_type.v | 57 +- .../examples/error_handling/early_returns.v | 12 +- .../introducing_question_mark.v | 12 +- ...ark_is_an_replacement_for_deprecated_try.v | 12 +- ..._valid_values_and_failures_via_partition.v | 19 +- ...ues_and_failures_via_partition_unwrapped.v | 31 +- ...sults_collect_via_map_err_and_filter_map.v | 32 +- ...esults_fail_entire_operation_via_collect.v | 8 +- .../iterating_over_results_failed.v | 8 +- ...ating_over_results_handle_via_filter_map.v | 14 +- .../map_in_result_via_combinators.v | 20 +- .../error_handling/map_in_result_via_match.v | 12 +- .../error_handling/multiple_error_types.v | 26 +- .../error_handling/option_and_unwrap.v | 14 +- .../other_uses_of_question_mark.v | 34 +- .../default/examples/error_handling/panic.v | 4 +- .../pulling_results_out_of_options.v | 30 +- ...ut_of_options_with_stop_error_processing.v | 44 +- .../error_handling/result_use_in_main.v | 6 +- ...g_options_and_defaults_via_get_or_insert.v | 20 +- ...ions_and_defaults_via_get_or_insert_with.v | 36 +- .../unpacking_options_and_defaults_via_or.v | 20 +- ...packing_options_and_defaults_via_or_else.v | 26 +- .../unpacking_options_via_question_mark.v | 20 +- .../examples/error_handling/wrapping_errors.v | 55 +- .../default/examples/expressions/blocks.v | 12 +- .../expressions/const_underscore_expression.v | 5 +- .../for_and_iterators_into_iter.v | 8 +- .../flow_of_control/for_and_iterators_iter.v | 17 +- .../for_and_iterators_iter_mut.v | 8 +- .../for_and_range_completely_inclusive.v | 16 +- .../for_and_range_inclusive_to_exclusive.v | 14 +- .../examples/flow_of_control/if_else.v | 22 +- .../default/examples/flow_of_control/if_let.v | 18 +- .../flow_of_control/if_let_challenge.v | 2 +- .../flow_of_control/if_let_dont_use_match.v | 4 +- .../if_let_match_enum_values.v | 11 +- .../examples/flow_of_control/infinite_loop.v | 10 +- .../flow_of_control/loop_nesting_and_labels.v | 8 +- .../default/examples/flow_of_control/match.v | 26 +- .../examples/flow_of_control/match_binding.v | 16 +- .../match_binding_destructure_enum_variants.v | 8 +- .../match_destructuring_arrays_slices.v | 32 +- .../match_destructuring_enums.v | 50 +- .../match_destructuring_pointers_ref.v | 16 +- .../match_destructuring_structs.v | 16 +- .../match_destructuring_tuples.v | 18 +- .../match_destructuring_tuples_fixed.v | 18 +- .../examples/flow_of_control/match_guards.v | 16 +- .../match_guards_unreachable.v | 4 +- .../default/examples/flow_of_control/while.v | 11 +- .../examples/flow_of_control/while_let.v | 6 +- .../while_let_match_is_weird.v | 6 +- .../associated_functions_and_methods.v | 74 +-- ...erging_functions_example_sum_odd_numbers.v | 4 +- ...verging_functions_no_info_in_return_type.v | 2 +- .../default/examples/functions/functions.v | 12 +- .../examples/functions/functions_closures.v | 12 +- .../functions_closures_as_input_parameters.v | 16 +- .../functions_closures_as_output_parameters.v | 12 +- .../functions/functions_closures_capturing.v | 14 +- .../functions_closures_example_Iterator_any.v | 34 +- ...earching_through_iterators_Iterator_find.v | 24 +- ...hing_through_iterators_Iterator_position.v | 4 +- ...ions_closures_forced_capturing_with_move.v | 12 +- .../functions_closures_input_functions.v | 4 +- ...s_closures_type_anonymity_define_and_use.v | 4 +- .../examples/functions/functions_order.v | 34 +- .../functions/higher_order_functions.v | 10 +- .../generics_associated_types_problem.v | 35 +- .../generics_associated_types_solution.v | 39 +- .../examples/generics/generics_bounds.v | 25 +- .../generics_bounds_test_case_empty_bounds.v | 8 +- .../generics/generics_implementation.v | 20 +- .../generics/generics_multiple_bounds.v | 18 +- .../generics/generics_new_type_idiom.v | 22 +- .../examples/generics/generics_phantom_type.v | 8 +- ...hantom_type_test_case_unit_clarification.v | 41 +- .../examples/generics/generics_traits.v | 5 +- .../generics/generics_where_clauses.v | 11 +- .../examples/guessing_game/guessing_game.v | 24 +- .../examples/hello_world/formatted_print.v | 72 +-- .../examples/hello_world/hello_world.v | 2 +- .../examples/ink_contracts/Proofs/erc20.v | 3 + .../ink_contracts/basic_contract_caller.v | 36 +- .../examples/ink_contracts/call_runtime.v | 91 ++- .../ink_contracts/conditional_compilation.v | 117 ++-- .../ink_contracts/contract_terminate.v | 49 +- .../ink_contracts/contract_transfer.v | 95 ++-- .../examples/ink_contracts/custom_allocator.v | 22 +- .../ink_contracts/custom_environment.v | 54 +- .../default/examples/ink_contracts/dns.v | 194 ++----- .../examples/ink_contracts/e2e_call_runtime.v | 45 +- .../default/examples/ink_contracts/erc1155.v | 283 ++++------ .../default/examples/ink_contracts/erc20.v | 178 +++--- .../default/examples/ink_contracts/erc721.v | 316 ++++------- .../default/examples/ink_contracts/flipper.v | 20 +- .../examples/ink_contracts/incrementer.v | 19 +- .../lang_err_integration_tests/call_builder.v | 49 +- .../call_builder_delegate.v | 19 +- .../constructors_return_value.v | 59 +- .../lang_err_integration_tests/contract_ref.v | 90 +-- .../integration_flipper.v | 40 +- .../ink_contracts/mapping_integration_tests.v | 162 ++---- .../default/examples/ink_contracts/mother.v | 178 ++---- .../default/examples/ink_contracts/multisig.v | 522 +++++++----------- .../examples/ink_contracts/payment_channel.v | 238 +++----- .../examples/ink_contracts/set_code_hash.v | 34 +- .../set_code_hash/updated_incrementer.v | 63 +-- .../examples/ink_contracts/trait_erc20.v | 198 +++---- .../examples/ink_contracts/trait_flipper.v | 13 +- .../ink_contracts/trait_incrementer.v | 24 +- .../ink_contracts/wildcard_selector.v | 32 +- .../examples/macro_rules/macro_example.v | 2 +- .../macro_rules/macro_rules_designators.v | 20 +- .../examples/macro_rules/macro_rules_dsl.v | 8 +- .../macro_rules/macro_rules_overload.v | 16 +- .../examples/macro_rules/macro_rules_repeat.v | 12 +- .../macro_rules_variadic_interfaces.v | 12 +- .../examples/modules/struct_visibility.v | 15 +- .../default/examples/modules/super_and_self.v | 20 +- .../examples/modules/the_use_as_declaration.v | 12 +- .../default/examples/modules/visibility.v | 68 +-- .../monadic_transformation/example03.v | 2 +- .../monadic_transformation/example05.v | 7 +- .../examples/primitives/arrays_and_slices.v | 50 +- .../examples/primitives/literals_operators.v | 56 +- .../default/examples/primitives/tuples.v | 56 +- .../scoping_rules/scoping_rules_borrowing.v | 10 +- .../scoping_rules_borrowing_aliasing.v | 32 +- .../scoping_rules_borrowing_mutablity.v | 17 +- .../scoping_rules_borrowing_the_ref_pattern.v | 28 +- .../scoping_rules/scoping_rules_lifetimes.v | 8 +- .../scoping_rules_lifetimes_bounds.v | 14 +- .../scoping_rules_lifetimes_coercion.v | 8 +- .../scoping_rules_lifetimes_elision.v | 16 +- .../scoping_rules_lifetimes_functions.v | 10 +- .../scoping_rules_lifetimes_methods.v | 18 +- ...ules_lifetimes_reference_lifetime_static.v | 14 +- .../scoping_rules_lifetimes_structs.v | 42 +- .../scoping_rules_lifetimes_traits.v | 15 +- .../scoping_rules_ownership_and_rules.v | 16 +- ...ping_rules_ownership_and_rules_mutablity.v | 16 +- ..._rules_ownership_and_rules_partial_moves.v | 26 +- .../scoping_rules/scoping_rules_raii.v | 6 +- .../scoping_rules_raii_desctructor.v | 9 +- .../default/examples/std_library_types/arc.v | 9 +- .../std_library_types/box_stack_heap.v | 61 +- .../examples/std_library_types/hash_map.v | 80 ++- .../hash_map_alternate_or_custom_key_types.v | 57 +- .../std_library_types/hash_map_hash_set.v | 70 ++- .../examples/std_library_types/option.v | 37 +- .../examples/std_library_types/panic.v | 4 +- .../default/examples/std_library_types/rc.v | 64 +-- .../examples/std_library_types/result.v | 39 +- .../result_chaining_with_question_mark.v | 30 +- .../examples/std_library_types/strings.v | 43 +- .../strings_byte_strings_as_non_utf8.v | 25 +- .../strings_literals_and_escapes.v | 16 +- .../strings_raw_string_literals.v | 13 +- .../examples/std_library_types/vectors.v | 59 +- .../default/examples/std_misc/channels.v | 65 ++- .../examples/std_misc/child_processes.v | 30 +- .../examples/std_misc/child_processes_pipes.v | 44 +- .../examples/std_misc/child_processes_wait.v | 22 +- .../examples/std_misc/file_io_create.v | 28 +- .../default/examples/std_misc/file_io_open.v | 31 +- .../examples/std_misc/file_io_read_lines.v | 19 +- .../file_io_read_lines_efficient_method.v | 12 +- .../examples/std_misc/filesystem_operations.v | 137 ++--- .../std_misc/foreign_function_interface.v | 37 +- .../examples/default/examples/std_misc/path.v | 24 +- .../examples/std_misc/program_arguments.v | 14 +- .../std_misc/program_arguments_parsing.v | 27 +- .../default/examples/std_misc/threads.v | 21 +- .../std_misc/threads_test_case_map_reduce.v | 54 +- CoqOfRust/examples/default/examples/subtle.v | 493 ++++++----------- CoqOfRust/examples/default/examples/test0.v | 22 +- .../examples/default/examples/traits/clone.v | 46 +- .../examples/default/examples/traits/derive.v | 30 +- .../disambiguating_overlapping_traits.v | 8 +- .../examples/default/examples/traits/drop.v | 19 +- .../examples/default/examples/traits/hash.v | 9 +- .../traits/impl_trait_as_return_type.v | 6 +- .../default/examples/traits/iterators.v | 54 +- .../examples/traits/operator_overloading.v | 32 +- .../traits/returning_traits_with_dyn.v | 26 +- .../default/examples/traits/supertraits.v | 10 +- .../examples/default/examples/traits/traits.v | 49 +- .../default/examples/traits/traits_parms.v | 5 +- .../default/examples/types/aliasing.v | 9 +- .../examples/default/examples/types/casting.v | 70 +-- .../default/examples/types/inference.v | 8 +- .../default/examples/types/literals.v | 20 +- .../calling_unsafe_functions.v | 8 +- .../inline_assembly_clobbered_registers.v | 10 +- ...ssembly_symbol_operands_and_abi_clobbers.v | 4 +- .../variable_bindings/declare_first.v | 9 +- .../examples/variable_bindings/mutability.v | 10 +- .../examples/variable_bindings/scope.v | 8 +- .../variable_bindings/variable_bindings.v | 12 +- .../variable_bindings/variable_shadowing.v | 18 +- CoqOfRust/lib/lib.v | 6 +- lib/src/coq.rs | 22 + lib/src/expression.rs | 22 +- lib/src/top_level.rs | 46 +- 313 files changed, 4234 insertions(+), 7142 deletions(-) diff --git a/CoqOfRust/_std/ops.v b/CoqOfRust/_std/ops.v index c52b97aa6..238d6d6b0 100644 --- a/CoqOfRust/_std/ops.v +++ b/CoqOfRust/_std/ops.v @@ -239,12 +239,16 @@ pub trait Generator { } *) Module Generator. - Class Trait (Self : Set) (R : option Set) (Yield Return : Set) : Set := { - R := defaultType R unit; + Class Trait (Self : Set) {R Yield Return : Set} : Set := { + R := R; Yield := Yield; Return := Return; resume : Pin (mut_ref Self) -> R -> GeneratorState Yield Return; }. + + Module Default. + Definition R : Set := unit. + End Default. End Generator. (* diff --git a/CoqOfRust/alloc/collections/btree/map.v b/CoqOfRust/alloc/collections/btree/map.v index d55293b6f..b021d2295 100644 --- a/CoqOfRust/alloc/collections/btree/map.v +++ b/CoqOfRust/alloc/collections/btree/map.v @@ -33,7 +33,6 @@ where Module Cursor. Parameter t : Set -> Set -> Set. End Cursor. -Definition Cursor := Cursor.t. (* pub struct CursorMut<'a, K, V, A = Global> @@ -45,8 +44,6 @@ where Module CursorMut. Parameter t : Set -> Set -> Set -> Set. End CursorMut. -Definition CursorMut (K V : Set) (A : option Set) := - CursorMut.t K V (defaultType A alloc.Global.t). (* pub struct DrainFilter<'a, K, V, F, A = Global> @@ -61,11 +58,6 @@ Module DrainFilter. `{core.clone.Clone.Trait A}, Set. End DrainFilter. -Definition DrainFilter (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - DrainFilter.t K V (defaultType A alloc.Global.t). (* pub struct OccupiedEntry<'a, K, V, A = Global> @@ -79,11 +71,6 @@ Module OccupiedEntry. `{core.clone.Clone.Trait A}, Set. End OccupiedEntry. -Definition OccupiedEntry (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - OccupiedEntry.t K V (defaultType A alloc.Global.t). (* pub struct OccupiedError<'a, K, V, A = Global> @@ -101,15 +88,10 @@ Module OccupiedError. `{alloc.Allocator.Trait A} `{core.clone.Clone.Trait A} : Set := { - entry : OccupiedEntry K V (Some A); + entry : OccupiedEntry.t K V A; value : V; }. End OccupiedError. -Definition OccupiedError (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - OccupiedError.t K V (defaultType A alloc.Global.t). (* pub struct BTreeMap @@ -127,11 +109,6 @@ Module BTreeMap. Definition A : Set := alloc.Global.t. End Default. End BTreeMap. -Definition BTreeMap (K V A : Set) - {H0 : alloc.Allocator.Trait A} - {H1 : core.clone.Clone.Trait A} : - Set := - M.Val (BTreeMap.t K V A). (* pub struct IntoIter @@ -145,11 +122,6 @@ Module IntoIter. `{core.clone.Clone.Trait A}, Set. End IntoIter. -Definition IntoIter (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - IntoIter.t K V (defaultType A alloc.Global.t). (* pub struct IntoKeys @@ -163,11 +135,6 @@ Module IntoKeys. `{core.clone.Clone.Trait A}, Set. End IntoKeys. -Definition IntoKeys (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - IntoKeys.t K V (defaultType A alloc.Global.t). (* pub struct IntoValues @@ -181,11 +148,6 @@ Module IntoValues. `{core.clone.Clone.Trait A}, Set. End IntoValues. -Definition IntoValues (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - IntoValues.t K V (defaultType A alloc.Global.t). (* pub struct Iter<'a, K, V> @@ -197,7 +159,6 @@ where Module Iter. Parameter t : Set -> Set -> Set. End Iter. -Definition Iter := Iter.t. (* pub struct IterMut<'a, K, V> @@ -209,13 +170,11 @@ where Module IterMut. Parameter t : Set -> Set -> Set. End IterMut. -Definition IterMut := IterMut.t. (* pub struct Keys<'a, K, V> { /* private fields */ } *) Module Keys. Parameter t : Set -> Set -> Set. End Keys. -Definition Keys := Keys.t. (* pub struct Range<'a, K, V> @@ -227,7 +186,6 @@ where Module Range. Parameter t : Set -> Set -> Set. End Range. -Definition Range := Range.t. (* pub struct RangeMut<'a, K, V> @@ -239,7 +197,6 @@ where Module RangeMut. Parameter t : Set -> Set -> Set. End RangeMut. -Definition RangeMut := RangeMut.t. (* pub struct VacantEntry<'a, K, V, A = Global> @@ -253,23 +210,16 @@ Module VacantEntry. `{core.clone.Clone.Trait A}, Set. End VacantEntry. -Definition VacantEntry (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - VacantEntry.t K V (defaultType A alloc.Global.t). (* pub struct Values<'a, K, V> { /* private fields */ } *) Module Values. Parameter t : Set -> Set -> Set. End Values. -Definition Values := Values.t. (* pub struct ValuesMut<'a, K, V> { /* private fields */ } *) Module ValuesMut. Parameter t : Set -> Set -> Set. End ValuesMut. -Definition ValuesMut := ValuesMut.t. (* ********ENUMS******** *) (* @@ -297,8 +247,3 @@ Module Entry. | Occupied . End Entry. -Definition Entry (K V : Set) (A : option Set) - `{alloc.Allocator.Trait (defaultType A alloc.Global.t)} - `{core.clone.Clone.Trait (defaultType A alloc.Global.t)} - : Set := - Entry.t K V (defaultType A alloc.Global.t). diff --git a/CoqOfRust/alloc/vec.v b/CoqOfRust/alloc/vec.v index 478baec16..aa864a239 100644 --- a/CoqOfRust/alloc/vec.v +++ b/CoqOfRust/alloc/vec.v @@ -27,11 +27,6 @@ where Module DrainFilter. Parameter t : forall (T F A : Set), Set. End DrainFilter. -Definition DrainFilter (T F : Set) (A : option Set) - `{Allocator.Trait (defaultType A alloc.Global.t)} - `{FnMut.Trait F (mut_ref T -> bool)} - : Set := - DrainFilter.t T F (defaultType A alloc.Global.t). (* let A_type := (defaultType A Global) in let traits @@ -50,8 +45,6 @@ where Module Drain. Parameter t : forall (T A : Set), Set. End Drain. -Definition Drain (T : Set) (A : option Set) : Set := - Drain.t T (defaultType A alloc.Global.t). (* let A_type := (defaultType A Global) in let traits @@ -71,8 +64,6 @@ Module into_iter. Module IntoIter. Parameter t : forall (T A : Set), Set. End IntoIter. - Definition IntoIter (T : Set) (A : option Set) := - IntoIter.t T (defaultType A alloc.Global.t). (* let A_type := (defaultType A Global) in let traits @@ -94,8 +85,6 @@ where Module Splice. Parameter t : forall (I A : Set), Set. End Splice. -Definition Splice (I : Set) (A : option Set) := - Splice.t I (defaultType A alloc.Global.t). (* BUGGED: same as above *) (* diff --git a/CoqOfRust/blacklist.txt b/CoqOfRust/blacklist.txt index daf3581ba..1d01cb822 100644 --- a/CoqOfRust/blacklist.txt +++ b/CoqOfRust/blacklist.txt @@ -44,17 +44,11 @@ examples/axiomatized/examples/traits/returning_traits_with_dyn.v examples/axiomatized/examples/traits/supertraits.v examples/axiomatized/examples/traits/traits_parms.v examples/axiomatized/examples/traits/traits.v -examples/default/examples/conversion/parsing_a_string.v examples/default/examples/conversion/try_from_and_try_into.v examples/default/examples/custom_types/enums_c_like.v examples/default/examples/custom_types/enums_testcase_linked_list.v examples/default/examples/custom_types/structures.v -examples/default/examples/error_handling/aliases_for_result.v examples/default/examples/error_handling/boxing_errors.v -examples/default/examples/error_handling/defining_an_error_type.v -examples/default/examples/error_handling/early_returns.v -examples/default/examples/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v -examples/default/examples/error_handling/introducing_question_mark.v examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v examples/default/examples/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v @@ -63,14 +57,10 @@ examples/default/examples/error_handling/iterating_over_results_failed.v examples/default/examples/error_handling/iterating_over_results_handle_via_filter_map.v examples/default/examples/error_handling/map_in_result_via_combinators.v examples/default/examples/error_handling/map_in_result_via_match.v -examples/default/examples/error_handling/multiple_error_types.v examples/default/examples/error_handling/other_uses_of_question_mark.v examples/default/examples/error_handling/pulling_results_out_of_options_with_stop_error_processing.v -examples/default/examples/error_handling/pulling_results_out_of_options.v -examples/default/examples/error_handling/result_use_in_main.v examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v examples/default/examples/error_handling/unpacking_options_and_defaults_via_or_else.v -examples/default/examples/error_handling/unpacking_options_and_defaults_via_or.v examples/default/examples/error_handling/unpacking_options_via_question_mark.v examples/default/examples/error_handling/wrapping_errors.v examples/default/examples/flow_of_control/for_and_iterators_iter_mut.v @@ -102,7 +92,6 @@ examples/default/examples/generics/generics_phantom_type_test_case_unit_clarific examples/default/examples/generics/generics_phantom_type.v examples/default/examples/generics/generics.v examples/default/examples/guessing_game/guessing_game.v -examples/default/examples/hello_world/formatted_print.v examples/default/examples/macro_rules/macro_rules_designators.v examples/default/examples/macro_rules/macro_rules_repeat.v examples/default/examples/modules/struct_visibility.v @@ -110,12 +99,10 @@ examples/default/examples/modules/super_and_self.v examples/default/examples/modules/the_use_as_declaration.v examples/default/examples/modules/visibility.v examples/default/examples/primitives/arrays_and_slices.v -examples/default/examples/primitives/literals_operators.v examples/default/examples/primitives/tuples.v examples/default/examples/scoping_rules/scoping_rules_borrowing.v examples/default/examples/scoping_rules/scoping_rules_lifetimes_bounds.v examples/default/examples/scoping_rules/scoping_rules_lifetimes_structs.v -examples/default/examples/scoping_rules/scoping_rules_lifetimes_traits.v examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v examples/default/examples/std_library_types/arc.v @@ -123,26 +110,20 @@ examples/default/examples/std_library_types/box_stack_heap.v examples/default/examples/std_library_types/hash_map_alternate_or_custom_key_types.v examples/default/examples/std_library_types/hash_map_hash_set.v examples/default/examples/std_library_types/hash_map.v -examples/default/examples/std_library_types/option.v examples/default/examples/std_library_types/rc.v examples/default/examples/std_library_types/result_chaining_with_question_mark.v examples/default/examples/std_library_types/result.v -examples/default/examples/std_library_types/strings_byte_strings_as_non_utf8.v examples/default/examples/std_library_types/strings_literals_and_escapes.v examples/default/examples/std_library_types/strings_raw_string_literals.v examples/default/examples/std_library_types/strings.v examples/default/examples/std_library_types/vectors.v examples/default/examples/std_misc/channels.v examples/default/examples/std_misc/child_processes_pipes.v -examples/default/examples/std_misc/child_processes_wait.v examples/default/examples/std_misc/child_processes.v -examples/default/examples/std_misc/file_io_create.v -examples/default/examples/std_misc/file_io_open.v examples/default/examples/std_misc/file_io_read_lines_efficient_method.v examples/default/examples/std_misc/file_io_read_lines.v examples/default/examples/std_misc/filesystem_operations.v examples/default/examples/std_misc/foreign_function_interface.v -examples/default/examples/std_misc/path.v examples/default/examples/std_misc/program_arguments_parsing.v examples/default/examples/std_misc/program_arguments.v examples/default/examples/std_misc/threads_test_case_map_reduce.v diff --git a/CoqOfRust/examples/axiomatized/examples/conversion/converting_to_string.v b/CoqOfRust/examples/axiomatized/examples/conversion/converting_to_string.v index dbf92c938..2371ba454 100644 --- a/CoqOfRust/examples/axiomatized/examples/conversion/converting_to_string.v +++ b/CoqOfRust/examples/axiomatized/examples/conversion/converting_to_string.v @@ -24,9 +24,7 @@ Section Impl_core_fmt_Display_for_converting_to_string_Circle_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/conversion/from.v b/CoqOfRust/examples/axiomatized/examples/conversion/from.v index 3e008fa9d..3b742c7b7 100644 --- a/CoqOfRust/examples/axiomatized/examples/conversion/from.v +++ b/CoqOfRust/examples/axiomatized/examples/conversion/from.v @@ -23,10 +23,7 @@ Section Impl_core_convert_From_i32_t_for_from_Number_t. *) Parameter from : i32.t -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := i32.t) := { core.convert.From.from := from; diff --git a/CoqOfRust/examples/axiomatized/examples/conversion/into.v b/CoqOfRust/examples/axiomatized/examples/conversion/into.v index efc89582a..6df059c09 100644 --- a/CoqOfRust/examples/axiomatized/examples/conversion/into.v +++ b/CoqOfRust/examples/axiomatized/examples/conversion/into.v @@ -23,10 +23,7 @@ Section Impl_core_convert_From_i32_t_for_into_Number_t. *) Parameter from : i32.t -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := i32.t) := { core.convert.From.from := from; diff --git a/CoqOfRust/examples/axiomatized/examples/conversion/try_from_and_try_into.v b/CoqOfRust/examples/axiomatized/examples/conversion/try_from_and_try_into.v index b9433396c..fd3392487 100644 --- a/CoqOfRust/examples/axiomatized/examples/conversion/try_from_and_try_into.v +++ b/CoqOfRust/examples/axiomatized/examples/conversion/try_from_and_try_into.v @@ -22,9 +22,7 @@ Section Impl_core_fmt_Debug_for_try_from_and_try_into_EvenNumber_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -51,9 +49,7 @@ Section Impl_core_cmp_PartialEq_for_try_from_and_try_into_EvenNumber_t. Parameter eq : (ref Self) -> (ref try_from_and_try_into.EvenNumber.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -84,10 +80,7 @@ Section Impl_core_convert_TryFrom_i32_t_for_try_from_and_try_into_EvenNumber_t. *) Parameter try_from : i32.t -> M (core.result.Result.t Self Error.t). - Global Instance AssociatedFunction_try_from : - Notations.DoubleColon Self "try_from" := { - Notations.double_colon := try_from; - }. + Axiom try_from_is_impl : impl Self "try_from" = try_from. Global Instance ℐ : core.convert.TryFrom.Trait Self (T := i32.t) := { core.convert.TryFrom.Error := Error; diff --git a/CoqOfRust/examples/axiomatized/examples/custom_types/enums_testcase_linked_list.v b/CoqOfRust/examples/axiomatized/examples/custom_types/enums_testcase_linked_list.v index 3cdb1ac68..1ae6a60f7 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom_types/enums_testcase_linked_list.v +++ b/CoqOfRust/examples/axiomatized/examples/custom_types/enums_testcase_linked_list.v @@ -35,9 +35,7 @@ Section Impl_enums_testcase_linked_list_List_t. *) Parameter new : M enums_testcase_linked_list.List.t. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn prepend(self, elem: u32) -> List { @@ -47,10 +45,7 @@ Section Impl_enums_testcase_linked_list_List_t. *) Parameter prepend : Self -> u32.t -> M enums_testcase_linked_list.List.t. - Global Instance AssociatedFunction_prepend : - Notations.DoubleColon Self "prepend" := { - Notations.double_colon := prepend; - }. + Axiom prepend_is_impl : impl Self "prepend" = prepend. (* fn len(&self) -> u32 { @@ -72,9 +67,7 @@ Section Impl_enums_testcase_linked_list_List_t. *) Parameter len : (ref Self) -> M u32.t. - Global Instance AssociatedFunction_len : Notations.DoubleColon Self "len" := { - Notations.double_colon := len; - }. + Axiom len_is_impl : impl Self "len" = len. (* fn stringify(&self) -> String { @@ -92,10 +85,7 @@ Section Impl_enums_testcase_linked_list_List_t. *) Parameter stringify : (ref Self) -> M alloc.string.String.t. - Global Instance AssociatedFunction_stringify : - Notations.DoubleColon Self "stringify" := { - Notations.double_colon := stringify; - }. + Axiom stringify_is_impl : impl Self "stringify" = stringify. End Impl_enums_testcase_linked_list_List_t. End Impl_enums_testcase_linked_list_List_t. diff --git a/CoqOfRust/examples/axiomatized/examples/custom_types/enums_type_aliases_v2.v b/CoqOfRust/examples/axiomatized/examples/custom_types/enums_type_aliases_v2.v index 54a98bd94..38a59a83f 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom_types/enums_type_aliases_v2.v +++ b/CoqOfRust/examples/axiomatized/examples/custom_types/enums_type_aliases_v2.v @@ -22,8 +22,6 @@ Section Impl_enums_type_aliases_v2_VeryVerboseEnumOfThingsToDoWithNumbers_t. *) Parameter run : (ref Self) -> i32.t -> i32.t -> M i32.t. - Global Instance AssociatedFunction_run : Notations.DoubleColon Self "run" := { - Notations.double_colon := run; - }. + Axiom run_is_impl : impl Self "run" = run. End Impl_enums_type_aliases_v2_VeryVerboseEnumOfThingsToDoWithNumbers_t. End Impl_enums_type_aliases_v2_VeryVerboseEnumOfThingsToDoWithNumbers_t. diff --git a/CoqOfRust/examples/axiomatized/examples/custom_types/structures.v b/CoqOfRust/examples/axiomatized/examples/custom_types/structures.v index f141e969a..19c6c8274 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom_types/structures.v +++ b/CoqOfRust/examples/axiomatized/examples/custom_types/structures.v @@ -25,9 +25,7 @@ Section Impl_core_fmt_Debug_for_structures_Person_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/boxing_errors.v b/CoqOfRust/examples/axiomatized/examples/error_handling/boxing_errors.v index f46c85953..eef8bfad4 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/boxing_errors.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/boxing_errors.v @@ -23,9 +23,7 @@ Section Impl_core_fmt_Debug_for_boxing_errors_EmptyVec_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -42,10 +40,7 @@ Section Impl_core_clone_Clone_for_boxing_errors_EmptyVec_t. *) Parameter clone : (ref Self) -> M boxing_errors.EmptyVec.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -66,9 +61,7 @@ Section Impl_core_fmt_Display_for_boxing_errors_EmptyVec_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_and_then.v b/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_and_then.v index 26f468a48..d45abdb47 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_and_then.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_and_then.v @@ -18,9 +18,7 @@ Section Impl_core_fmt_Debug_for_combinators_and_then_Food_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -45,9 +43,7 @@ Section Impl_core_fmt_Debug_for_combinators_and_then_Day_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_map.v b/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_map.v index 3ef78aba9..90fdaa098 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_map.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/combinators_map.v @@ -18,9 +18,7 @@ Section Impl_core_fmt_Debug_for_combinators_map_Food_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -49,9 +47,7 @@ Section Impl_core_fmt_Debug_for_combinators_map_Peeled_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -80,9 +76,7 @@ Section Impl_core_fmt_Debug_for_combinators_map_Chopped_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -111,9 +105,7 @@ Section Impl_core_fmt_Debug_for_combinators_map_Cooked_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/defining_an_error_type.v b/CoqOfRust/examples/axiomatized/examples/error_handling/defining_an_error_type.v index b03e26caf..c3bfe3614 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/defining_an_error_type.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/defining_an_error_type.v @@ -17,9 +17,7 @@ Section Impl_core_fmt_Debug_for_defining_an_error_type_DoubleError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -36,10 +34,7 @@ Section Impl_core_clone_Clone_for_defining_an_error_type_DoubleError_t. *) Parameter clone : (ref Self) -> M defining_an_error_type.DoubleError.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -63,9 +58,7 @@ Section Impl_core_fmt_Display_for_defining_an_error_type_DoubleError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/other_uses_of_question_mark.v b/CoqOfRust/examples/axiomatized/examples/error_handling/other_uses_of_question_mark.v index 14ac237c3..0c286bb82 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/other_uses_of_question_mark.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/other_uses_of_question_mark.v @@ -23,9 +23,7 @@ Section Impl_core_fmt_Debug_for_other_uses_of_question_mark_EmptyVec_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -45,9 +43,7 @@ Section Impl_core_fmt_Display_for_other_uses_of_question_mark_EmptyVec_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v index ab7699aeb..14a3e2b4e 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v @@ -21,9 +21,7 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_get_or_insert Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v index 7d1d4a01d..43279eec9 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v @@ -21,9 +21,7 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_get_or_insert Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or.v b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or.v index e1a2c62c2..4cef95da1 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or.v @@ -20,9 +20,7 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_or_Fruit_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or_else.v b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or_else.v index 2c89e8ef4..8bbaee93e 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or_else.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_and_defaults_via_or_else.v @@ -20,9 +20,7 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_or_else_Fruit Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_via_question_mark.v b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_via_question_mark.v index 478488c7b..f8c299bb6 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_via_question_mark.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/unpacking_options_via_question_mark.v @@ -35,10 +35,7 @@ Section Impl_core_clone_Clone_for_unpacking_options_via_question_mark_Job_t. *) Parameter clone : (ref Self) -> M unpacking_options_via_question_mark.Job.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -82,10 +79,7 @@ Section Impl_core_clone_Clone_for_unpacking_options_via_question_mark_PhoneNumbe Parameter clone : (ref Self) -> M unpacking_options_via_question_mark.PhoneNumber.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -117,10 +111,8 @@ Section Impl_unpacking_options_via_question_mark_Person_t. *) Parameter work_phone_area_code : (ref Self) -> M (core.option.Option.t u8.t). - Global Instance AssociatedFunction_work_phone_area_code : - Notations.DoubleColon Self "work_phone_area_code" := { - Notations.double_colon := work_phone_area_code; - }. + Axiom work_phone_area_code_is_impl : + impl Self "work_phone_area_code" = work_phone_area_code. End Impl_unpacking_options_via_question_mark_Person_t. End Impl_unpacking_options_via_question_mark_Person_t. diff --git a/CoqOfRust/examples/axiomatized/examples/error_handling/wrapping_errors.v b/CoqOfRust/examples/axiomatized/examples/error_handling/wrapping_errors.v index 2f1468ada..f0663f2b9 100644 --- a/CoqOfRust/examples/axiomatized/examples/error_handling/wrapping_errors.v +++ b/CoqOfRust/examples/axiomatized/examples/error_handling/wrapping_errors.v @@ -24,9 +24,7 @@ Section Impl_core_fmt_Debug_for_wrapping_errors_DoubleError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -51,9 +49,7 @@ Section Impl_core_fmt_Display_for_wrapping_errors_DoubleError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; @@ -78,10 +74,7 @@ Section Impl_core_error_Error_for_wrapping_errors_DoubleError_t. *) Parameter source : (ref Self) -> M (core.option.Option.t (ref _ (* dyn *))). - Global Instance AssociatedFunction_source : - Notations.DoubleColon Self "source" := { - Notations.double_colon := source; - }. + Axiom source_is_impl : impl Self "source" = source. Global Instance ℐ : core.error.Error.Required.Trait Self := { core.error.Error.source := Datatypes.Some source; @@ -105,10 +98,7 @@ Section Impl_core_convert_From_core_num_error_ParseIntError_t_for_wrapping_error Parameter from : core.num.error.ParseIntError.t -> M wrapping_errors.DoubleError.t. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := core.num.error.ParseIntError.t) := { diff --git a/CoqOfRust/examples/axiomatized/examples/expressions/const_underscore_expression.v b/CoqOfRust/examples/axiomatized/examples/expressions/const_underscore_expression.v index ec90790b1..a8099591c 100644 --- a/CoqOfRust/examples/axiomatized/examples/expressions/const_underscore_expression.v +++ b/CoqOfRust/examples/axiomatized/examples/expressions/const_underscore_expression.v @@ -43,10 +43,7 @@ Section Impl_const_underscore_expression_BarTrait_for_const_underscore_expressio *) Parameter show : Self -> M alloc.string.String.t. - Global Instance AssociatedFunction_show : - Notations.DoubleColon Self "show" := { - Notations.double_colon := show; - }. + Axiom show_is_impl : impl Self "show" = show. Global Instance ℐ : const_underscore_expression.BarTrait.Trait Self := { const_underscore_expression.BarTrait.show := show; diff --git a/CoqOfRust/examples/axiomatized/examples/functions/associated_functions_and_methods.v b/CoqOfRust/examples/axiomatized/examples/functions/associated_functions_and_methods.v index 94065a31a..1cdb0e8e1 100644 --- a/CoqOfRust/examples/axiomatized/examples/functions/associated_functions_and_methods.v +++ b/CoqOfRust/examples/axiomatized/examples/functions/associated_functions_and_methods.v @@ -26,10 +26,7 @@ Section Impl_associated_functions_and_methods_Point_t. *) Parameter origin : M associated_functions_and_methods.Point.t. - Global Instance AssociatedFunction_origin : - Notations.DoubleColon Self "origin" := { - Notations.double_colon := origin; - }. + Axiom origin_is_impl : impl Self "origin" = origin. (* fn new(x: f64, y: f64) -> Point { @@ -38,9 +35,7 @@ Section Impl_associated_functions_and_methods_Point_t. *) Parameter new : f64.t -> f64.t -> M associated_functions_and_methods.Point.t. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_associated_functions_and_methods_Point_t. End Impl_associated_functions_and_methods_Point_t. @@ -69,10 +64,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. *) Parameter get_p1 : (ref Self) -> M associated_functions_and_methods.Point.t. - Global Instance AssociatedFunction_get_p1 : - Notations.DoubleColon Self "get_p1" := { - Notations.double_colon := get_p1; - }. + Axiom get_p1_is_impl : impl Self "get_p1" = get_p1. (* fn area(&self) -> f64 { @@ -87,10 +79,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. *) Parameter area : (ref Self) -> M f64.t. - Global Instance AssociatedFunction_area : - Notations.DoubleColon Self "area" := { - Notations.double_colon := area; - }. + Axiom area_is_impl : impl Self "area" = area. (* fn perimeter(&self) -> f64 { @@ -102,10 +91,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. *) Parameter perimeter : (ref Self) -> M f64.t. - Global Instance AssociatedFunction_perimeter : - Notations.DoubleColon Self "perimeter" := { - Notations.double_colon := perimeter; - }. + Axiom perimeter_is_impl : impl Self "perimeter" = perimeter. (* fn translate(&mut self, x: f64, y: f64) { @@ -118,10 +104,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. *) Parameter translate : (mut_ref Self) -> f64.t -> f64.t -> M unit. - Global Instance AssociatedFunction_translate : - Notations.DoubleColon Self "translate" := { - Notations.double_colon := translate; - }. + Axiom translate_is_impl : impl Self "translate" = translate. End Impl_associated_functions_and_methods_Rectangle_t. End Impl_associated_functions_and_methods_Rectangle_t. @@ -155,10 +138,7 @@ Section Impl_associated_functions_and_methods_Pair_t. *) Parameter destroy : Self -> M unit. - Global Instance AssociatedFunction_destroy : - Notations.DoubleColon Self "destroy" := { - Notations.double_colon := destroy; - }. + Axiom destroy_is_impl : impl Self "destroy" = destroy. End Impl_associated_functions_and_methods_Pair_t. End Impl_associated_functions_and_methods_Pair_t. diff --git a/CoqOfRust/examples/axiomatized/examples/functions/functions_order.v b/CoqOfRust/examples/axiomatized/examples/functions/functions_order.v index a956e7609..919754d60 100644 --- a/CoqOfRust/examples/axiomatized/examples/functions/functions_order.v +++ b/CoqOfRust/examples/axiomatized/examples/functions/functions_order.v @@ -32,10 +32,7 @@ Section Impl_functions_order_SomeType_t. *) Parameter meth2 : Self -> M unit. - Global Instance AssociatedFunction_meth2 : - Notations.DoubleColon Self "meth2" := { - Notations.double_colon := meth2; - }. + Axiom meth2_is_impl : impl Self "meth2" = meth2. (* pub fn meth1(self) { @@ -44,10 +41,7 @@ Section Impl_functions_order_SomeType_t. *) Parameter meth1 : Self -> M unit. - Global Instance AssociatedFunction_meth1 : - Notations.DoubleColon Self "meth1" := { - Notations.double_colon := meth1; - }. + Axiom meth1_is_impl : impl Self "meth1" = meth1. End Impl_functions_order_SomeType_t. End Impl_functions_order_SomeType_t. @@ -70,10 +64,7 @@ Section Impl_functions_order_SomeTrait_for_functions_order_SomeType_t. *) Parameter some_trait_bar : (ref Self) -> M unit. - Global Instance AssociatedFunction_some_trait_bar : - Notations.DoubleColon Self "some_trait_bar" := { - Notations.double_colon := some_trait_bar; - }. + Axiom some_trait_bar_is_impl : impl Self "some_trait_bar" = some_trait_bar. (* fn some_trait_foo(&self) { @@ -82,10 +73,7 @@ Section Impl_functions_order_SomeTrait_for_functions_order_SomeType_t. *) Parameter some_trait_foo : (ref Self) -> M unit. - Global Instance AssociatedFunction_some_trait_foo : - Notations.DoubleColon Self "some_trait_foo" := { - Notations.double_colon := some_trait_foo; - }. + Axiom some_trait_foo_is_impl : impl Self "some_trait_foo" = some_trait_foo. Global Instance ℐ : functions_order.SomeTrait.Trait Self := { functions_order.SomeTrait.some_trait_bar := some_trait_bar; @@ -103,20 +91,14 @@ Section Impl_functions_order_SomeTrait_for_functions_order_OtherType_t. *) Parameter some_trait_foo : (ref Self) -> M unit. - Global Instance AssociatedFunction_some_trait_foo : - Notations.DoubleColon Self "some_trait_foo" := { - Notations.double_colon := some_trait_foo; - }. + Axiom some_trait_foo_is_impl : impl Self "some_trait_foo" = some_trait_foo. (* fn some_trait_bar(&self) {} *) Parameter some_trait_bar : (ref Self) -> M unit. - Global Instance AssociatedFunction_some_trait_bar : - Notations.DoubleColon Self "some_trait_bar" := { - Notations.double_colon := some_trait_bar; - }. + Axiom some_trait_bar_is_impl : impl Self "some_trait_bar" = some_trait_bar. Global Instance ℐ : functions_order.SomeTrait.Trait Self := { functions_order.SomeTrait.some_trait_foo := some_trait_foo; diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_problem.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_problem.v index d525ad4c5..afbba083e 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_problem.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_problem.v @@ -37,10 +37,7 @@ Section Impl_generics_associated_types_problem_Contains_i32_t_i32_t_for_generics *) Parameter contains : (ref Self) -> (ref i32.t) -> (ref i32.t) -> M bool.t. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn first(&self) -> i32 { @@ -49,10 +46,7 @@ Section Impl_generics_associated_types_problem_Contains_i32_t_i32_t_for_generics *) Parameter first : (ref Self) -> M i32.t. - Global Instance AssociatedFunction_first : - Notations.DoubleColon Self "first" := { - Notations.double_colon := first; - }. + Axiom first_is_impl : impl Self "first" = first. (* fn last(&self) -> i32 { @@ -61,10 +55,7 @@ Section Impl_generics_associated_types_problem_Contains_i32_t_i32_t_for_generics *) Parameter last : (ref Self) -> M i32.t. - Global Instance AssociatedFunction_last : - Notations.DoubleColon Self "last" := { - Notations.double_colon := last; - }. + Axiom last_is_impl : impl Self "last" = last. Global Instance ℐ : generics_associated_types_problem.Contains.Trait Self diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_solution.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_solution.v index 0aca9a222..ef106af11 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_solution.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_associated_types_solution.v @@ -56,10 +56,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated *) Parameter contains : (ref Self) -> (ref i32.t) -> (ref i32.t) -> M bool.t. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn first(&self) -> i32 { @@ -68,10 +65,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated *) Parameter first : (ref Self) -> M i32.t. - Global Instance AssociatedFunction_first : - Notations.DoubleColon Self "first" := { - Notations.double_colon := first; - }. + Axiom first_is_impl : impl Self "first" = first. (* fn last(&self) -> i32 { @@ -80,10 +74,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated *) Parameter last : (ref Self) -> M i32.t. - Global Instance AssociatedFunction_last : - Notations.DoubleColon Self "last" := { - Notations.double_colon := last; - }. + Axiom last_is_impl : impl Self "last" = last. (* fn a(&self) -> i32 { @@ -92,9 +83,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated *) Parameter a : (ref Self) -> M i32.t. - Global Instance AssociatedFunction_a : Notations.DoubleColon Self "a" := { - Notations.double_colon := a; - }. + Axiom a_is_impl : impl Self "a" = a. Global Instance ℐ : generics_associated_types_solution.Contains.Trait Self := { diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_bounds.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_bounds.v index 26bf133c6..7d70bb433 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_bounds.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_bounds.v @@ -34,9 +34,7 @@ Section Impl_core_fmt_Debug_for_generics_bounds_Rectangle_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -70,10 +68,7 @@ Section Impl_generics_bounds_HasArea_for_generics_bounds_Rectangle_t. *) Parameter area : (ref Self) -> M f64.t. - Global Instance AssociatedFunction_area : - Notations.DoubleColon Self "area" := { - Notations.double_colon := area; - }. + Axiom area_is_impl : impl Self "area" = area. Global Instance ℐ : generics_bounds.HasArea.Trait Self := { generics_bounds.HasArea.area := area; diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_implementation.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_implementation.v index 176f0cf59..26250e48c 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_implementation.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_implementation.v @@ -38,10 +38,7 @@ Section Impl_generics_implementation_Val_t. *) Parameter value : (ref Self) -> M (ref f64.t). - Global Instance AssociatedFunction_value : - Notations.DoubleColon Self "value" := { - Notations.double_colon := value; - }. + Axiom value_is_impl : impl Self "value" = value. End Impl_generics_implementation_Val_t. End Impl_generics_implementation_Val_t. @@ -58,10 +55,7 @@ Section Impl_generics_implementation_GenVal_t_T. *) Parameter value : (ref Self) -> M (ref T). - Global Instance AssociatedFunction_value : - Notations.DoubleColon Self "value" := { - Notations.double_colon := value; - }. + Axiom value_is_impl : impl Self "value" = value. End Impl_generics_implementation_GenVal_t_T. End Impl_generics_implementation_GenVal_t_T. diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_new_type_idiom.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_new_type_idiom.v index 0de58a132..13eb9e687 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_new_type_idiom.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_new_type_idiom.v @@ -34,10 +34,7 @@ Section Impl_generics_new_type_idiom_Years_t. *) Parameter to_days : (ref Self) -> M generics_new_type_idiom.Days.t. - Global Instance AssociatedFunction_to_days : - Notations.DoubleColon Self "to_days" := { - Notations.double_colon := to_days; - }. + Axiom to_days_is_impl : impl Self "to_days" = to_days. End Impl_generics_new_type_idiom_Years_t. End Impl_generics_new_type_idiom_Years_t. @@ -52,10 +49,7 @@ Section Impl_generics_new_type_idiom_Days_t. *) Parameter to_years : (ref Self) -> M generics_new_type_idiom.Years.t. - Global Instance AssociatedFunction_to_years : - Notations.DoubleColon Self "to_years" := { - Notations.double_colon := to_years; - }. + Axiom to_years_is_impl : impl Self "to_years" = to_years. End Impl_generics_new_type_idiom_Days_t. End Impl_generics_new_type_idiom_Days_t. diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type.v index 16efc6279..f2b45c37b 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type.v @@ -47,9 +47,7 @@ Section Impl_core_cmp_PartialEq_for_generics_phantom_type_PhantomTuple_t_A_B. (ref (generics_phantom_type.PhantomTuple.t A B)) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -108,9 +106,7 @@ Section Impl_core_cmp_PartialEq_for_generics_phantom_type_PhantomStruct_t_A_B. (ref (generics_phantom_type.PhantomStruct.t A B)) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type_test_case_unit_clarification.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type_test_case_unit_clarification.v index fbec8ba81..2132d93b1 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type_test_case_unit_clarification.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_phantom_type_test_case_unit_clarification.v @@ -17,9 +17,7 @@ Section Impl_core_fmt_Debug_for_generics_phantom_type_test_case_unit_clarificati Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -38,10 +36,7 @@ Section Impl_core_clone_Clone_for_generics_phantom_type_test_case_unit_clarifica Parameter clone : (ref Self) -> M generics_phantom_type_test_case_unit_clarification.Inch.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -76,9 +71,7 @@ Section Impl_core_fmt_Debug_for_generics_phantom_type_test_case_unit_clarificati Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -97,10 +90,7 @@ Section Impl_core_clone_Clone_for_generics_phantom_type_test_case_unit_clarifica Parameter clone : (ref Self) -> M generics_phantom_type_test_case_unit_clarification.Mm.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -150,9 +140,7 @@ Section Impl_core_fmt_Debug_for_generics_phantom_type_test_case_unit_clarificati Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -176,10 +164,7 @@ Section Impl_core_clone_Clone_for_generics_phantom_type_test_case_unit_clarifica (ref Self) -> M (generics_phantom_type_test_case_unit_clarification.Length.t Unit). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -226,9 +211,7 @@ Section Impl_core_ops_arith_Add_for_generics_phantom_type_test_case_unit_clarifi (generics_phantom_type_test_case_unit_clarification.Length.t Unit) -> M (generics_phantom_type_test_case_unit_clarification.Length.t Unit). - Global Instance AssociatedFunction_add : Notations.DoubleColon Self "add" := { - Notations.double_colon := add; - }. + Axiom add_is_impl : impl Self "add" = add. Global Instance ℐ : core.ops.arith.Add.Trait Self diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_traits.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_traits.v index c507c8f47..aac4435a0 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_traits.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_traits.v @@ -33,10 +33,7 @@ Section Impl_generics_traits_DoubleDrop_T_for_U. *) Parameter double_drop : Self -> T -> M unit. - Global Instance AssociatedFunction_double_drop : - Notations.DoubleColon Self "double_drop" := { - Notations.double_colon := double_drop; - }. + Axiom double_drop_is_impl : impl Self "double_drop" = double_drop. Global Instance ℐ : generics_traits.DoubleDrop.Trait Self (T := T) := { generics_traits.DoubleDrop.double_drop := double_drop; diff --git a/CoqOfRust/examples/axiomatized/examples/generics/generics_where_clauses.v b/CoqOfRust/examples/axiomatized/examples/generics/generics_where_clauses.v index e969287a1..417f8b31d 100644 --- a/CoqOfRust/examples/axiomatized/examples/generics/generics_where_clauses.v +++ b/CoqOfRust/examples/axiomatized/examples/generics/generics_where_clauses.v @@ -25,10 +25,7 @@ Section Impl_generics_where_clauses_PrintInOption_for_T. *) Parameter print_in_option : Self -> M unit. - Global Instance AssociatedFunction_print_in_option : - Notations.DoubleColon Self "print_in_option" := { - Notations.double_colon := print_in_option; - }. + Axiom print_in_option_is_impl : impl Self "print_in_option" = print_in_option. Global Instance ℐ : generics_where_clauses.PrintInOption.Trait Self := { generics_where_clauses.PrintInOption.print_in_option := print_in_option; diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/basic_contract_caller.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/basic_contract_caller.v index 903dbe966..9b5b2303d 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/basic_contract_caller.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/basic_contract_caller.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_basic_contract_caller_AccountId_t. *) Parameter default : M basic_contract_caller.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_basic_contract_caller_AccountId_t. *) Parameter clone : (ref Self) -> M basic_contract_caller.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -91,9 +85,7 @@ Section Impl_basic_contract_caller_OtherContract_t. *) Parameter new : bool.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn flip(&mut self) { @@ -102,10 +94,7 @@ Section Impl_basic_contract_caller_OtherContract_t. *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -114,9 +103,7 @@ Section Impl_basic_contract_caller_OtherContract_t. *) Parameter get : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_basic_contract_caller_OtherContract_t. End Impl_basic_contract_caller_OtherContract_t. @@ -151,9 +138,7 @@ Section Impl_basic_contract_caller_BasicContractCaller_t. *) Parameter new : ltac:(basic_contract_caller.Hash) -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn flip_and_get(&mut self) -> bool { @@ -163,9 +148,6 @@ Section Impl_basic_contract_caller_BasicContractCaller_t. *) Parameter flip_and_get : (mut_ref Self) -> M bool.t. - Global Instance AssociatedFunction_flip_and_get : - Notations.DoubleColon Self "flip_and_get" := { - Notations.double_colon := flip_and_get; - }. + Axiom flip_and_get_is_impl : impl Self "flip_and_get" = flip_and_get. End Impl_basic_contract_caller_BasicContractCaller_t. End Impl_basic_contract_caller_BasicContractCaller_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v index d4efe9ff5..bb7b646f8 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_call_runtime_AccountId_t. *) Parameter default : M call_runtime.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_call_runtime_AccountId_t. *) Parameter clone : (ref Self) -> M call_runtime.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -92,10 +86,7 @@ Section Impl_core_convert_From_call_runtime_AccountId_t_for_call_runtime_MultiAd *) Parameter from : call_runtime.AccountId.t -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := call_runtime.AccountId.t) := { @@ -157,10 +148,7 @@ Section Impl_core_default_Default_for_call_runtime_RuntimeCaller_t. *) Parameter default : M call_runtime.RuntimeCaller.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -183,9 +171,7 @@ Section Impl_core_fmt_Debug_for_call_runtime_RuntimeError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -211,9 +197,7 @@ Section Impl_core_cmp_PartialEq_for_call_runtime_RuntimeError_t. *) Parameter eq : (ref Self) -> (ref call_runtime.RuntimeError.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -242,10 +226,8 @@ Section Impl_core_cmp_Eq_for_call_runtime_RuntimeError_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -274,10 +256,7 @@ Section Impl_core_convert_From_call_runtime_EnvError_t_for_call_runtime_RuntimeE *) Parameter from : call_runtime.EnvError.t -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := call_runtime.EnvError.t) := { @@ -301,10 +280,9 @@ Section Impl_call_runtime_Env_t. (ref Call) -> M (core.result.Result.t unit call_runtime.EnvError.t). - Global Instance AssociatedFunction_call_runtime {Call : Set} : - Notations.DoubleColon Self "call_runtime" := { - Notations.double_colon := call_runtime (Call := Call); - }. + Axiom call_runtime_is_impl : + forall {Call : Set}, + impl Self "call_runtime" = call_runtime (Call := Call). End Impl_call_runtime_Env_t. End Impl_call_runtime_Env_t. @@ -319,10 +297,7 @@ Section Impl_call_runtime_RuntimeCaller_t. *) Parameter init_env : M call_runtime.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -331,9 +306,7 @@ Section Impl_call_runtime_RuntimeCaller_t. *) Parameter env : (ref Self) -> M call_runtime.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -342,9 +315,7 @@ Section Impl_call_runtime_RuntimeCaller_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn transfer_through_runtime( @@ -366,10 +337,8 @@ Section Impl_call_runtime_RuntimeCaller_t. ltac:(call_runtime.Balance) -> M (core.result.Result.t unit call_runtime.RuntimeError.t). - Global Instance AssociatedFunction_transfer_through_runtime : - Notations.DoubleColon Self "transfer_through_runtime" := { - Notations.double_colon := transfer_through_runtime; - }. + Axiom transfer_through_runtime_is_impl : + impl Self "transfer_through_runtime" = transfer_through_runtime. (* pub fn call_nonexistent_extrinsic(&mut self) -> Result<(), RuntimeError> { @@ -380,9 +349,7 @@ Section Impl_call_runtime_RuntimeCaller_t. (mut_ref Self) -> M (core.result.Result.t unit call_runtime.RuntimeError.t). - Global Instance AssociatedFunction_call_nonexistent_extrinsic : - Notations.DoubleColon Self "call_nonexistent_extrinsic" := { - Notations.double_colon := call_nonexistent_extrinsic; - }. + Axiom call_nonexistent_extrinsic_is_impl : + impl Self "call_nonexistent_extrinsic" = call_nonexistent_extrinsic. End Impl_call_runtime_RuntimeCaller_t. End Impl_call_runtime_RuntimeCaller_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v index eba9579ab..1ef074751 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_conditional_compilation_AccountId_t. *) Parameter default : M conditional_compilation.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_conditional_compilation_AccountId_t. *) Parameter clone : (ref Self) -> M conditional_compilation.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -151,10 +145,7 @@ Section Impl_conditional_compilation_Env_t. *) Parameter caller : (ref Self) -> M conditional_compilation.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -164,10 +155,7 @@ Section Impl_conditional_compilation_Env_t. Parameter emit_event : (ref Self) -> conditional_compilation.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. (* fn block_number(&self) -> BlockNumber { @@ -177,10 +165,7 @@ Section Impl_conditional_compilation_Env_t. Parameter block_number : (ref Self) -> M ltac:(conditional_compilation.BlockNumber). - Global Instance AssociatedFunction_block_number : - Notations.DoubleColon Self "block_number" := { - Notations.double_colon := block_number; - }. + Axiom block_number_is_impl : impl Self "block_number" = block_number. End Impl_conditional_compilation_Env_t. End Impl_conditional_compilation_Env_t. @@ -206,10 +191,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter init_env : M conditional_compilation.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -218,9 +200,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter env : (ref Self) -> M conditional_compilation.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -231,9 +211,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_foo(value: bool) -> Self { @@ -242,10 +220,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter new_foo : bool.t -> M Self. - Global Instance AssociatedFunction_new_foo : - Notations.DoubleColon Self "new_foo" := { - Notations.double_colon := new_foo; - }. + Axiom new_foo_is_impl : impl Self "new_foo" = new_foo. (* pub fn new_bar(value: bool) -> Self { @@ -254,10 +229,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter new_bar : bool.t -> M Self. - Global Instance AssociatedFunction_new_bar : - Notations.DoubleColon Self "new_bar" := { - Notations.double_colon := new_bar; - }. + Axiom new_bar_is_impl : impl Self "new_bar" = new_bar. (* pub fn new_foo_bar(value: bool) -> Self { @@ -266,10 +238,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter new_foo_bar : bool.t -> M Self. - Global Instance AssociatedFunction_new_foo_bar : - Notations.DoubleColon Self "new_foo_bar" := { - Notations.double_colon := new_foo_bar; - }. + Axiom new_foo_bar_is_impl : impl Self "new_foo_bar" = new_foo_bar. (* pub fn inherent_flip_foo(&mut self) { @@ -283,10 +252,8 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter inherent_flip_foo : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_inherent_flip_foo : - Notations.DoubleColon Self "inherent_flip_foo" := { - Notations.double_colon := inherent_flip_foo; - }. + Axiom inherent_flip_foo_is_impl : + impl Self "inherent_flip_foo" = inherent_flip_foo. (* pub fn inherent_flip_bar(&mut self) { @@ -302,10 +269,8 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Parameter inherent_flip_bar : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_inherent_flip_bar : - Notations.DoubleColon Self "inherent_flip_bar" := { - Notations.double_colon := inherent_flip_bar; - }. + Axiom inherent_flip_bar_is_impl : + impl Self "inherent_flip_bar" = inherent_flip_bar. End Impl_conditional_compilation_ConditionalCompilation_t. End Impl_conditional_compilation_ConditionalCompilation_t. @@ -320,10 +285,7 @@ Section Impl_conditional_compilation_Flip_for_conditional_compilation_Conditiona *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* fn get(&self) -> bool { @@ -332,9 +294,7 @@ Section Impl_conditional_compilation_Flip_for_conditional_compilation_Conditiona *) Parameter get : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn push_foo(&mut self, value: bool) { @@ -348,10 +308,7 @@ Section Impl_conditional_compilation_Flip_for_conditional_compilation_Conditiona *) Parameter push_foo : (mut_ref Self) -> bool.t -> M unit. - Global Instance AssociatedFunction_push_foo : - Notations.DoubleColon Self "push_foo" := { - Notations.double_colon := push_foo; - }. + Axiom push_foo_is_impl : impl Self "push_foo" = push_foo. Global Instance ℐ : conditional_compilation.Flip.Trait Self := { conditional_compilation.Flip.flip := flip; diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v index 1fc3c92d3..f98da87ad 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_contract_terminate_AccountId_t. *) Parameter default : M contract_terminate.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_contract_terminate_AccountId_t. *) Parameter clone : (ref Self) -> M contract_terminate.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -84,10 +78,7 @@ Section Impl_contract_terminate_Env_t. *) Parameter caller : (ref Self) -> M contract_terminate.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn terminate_contract(&self, _account: AccountId) { @@ -97,10 +88,8 @@ Section Impl_contract_terminate_Env_t. Parameter terminate_contract : (ref Self) -> contract_terminate.AccountId.t -> M unit. - Global Instance AssociatedFunction_terminate_contract : - Notations.DoubleColon Self "terminate_contract" := { - Notations.double_colon := terminate_contract; - }. + Axiom terminate_contract_is_impl : + impl Self "terminate_contract" = terminate_contract. End Impl_contract_terminate_Env_t. End Impl_contract_terminate_Env_t. @@ -121,10 +110,7 @@ Section Impl_contract_terminate_JustTerminate_t. *) Parameter init_env : M contract_terminate.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -133,9 +119,7 @@ Section Impl_contract_terminate_JustTerminate_t. *) Parameter env : (ref Self) -> M contract_terminate.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -144,9 +128,7 @@ Section Impl_contract_terminate_JustTerminate_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn terminate_me(&mut self) { @@ -155,9 +137,6 @@ Section Impl_contract_terminate_JustTerminate_t. *) Parameter terminate_me : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_terminate_me : - Notations.DoubleColon Self "terminate_me" := { - Notations.double_colon := terminate_me; - }. + Axiom terminate_me_is_impl : impl Self "terminate_me" = terminate_me. End Impl_contract_terminate_JustTerminate_t. End Impl_contract_terminate_JustTerminate_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v index 5812e3dc8..d4b9cfa6e 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_contract_transfer_AccountId_t. *) Parameter default : M contract_transfer.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_contract_transfer_AccountId_t. *) Parameter clone : (ref Self) -> M contract_transfer.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -86,10 +80,7 @@ Section Impl_contract_transfer_Env_t. *) Parameter caller : (ref Self) -> M contract_transfer.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn balance(&self) -> Balance { @@ -98,10 +89,7 @@ Section Impl_contract_transfer_Env_t. *) Parameter balance : (ref Self) -> M ltac:(contract_transfer.Balance). - Global Instance AssociatedFunction_balance : - Notations.DoubleColon Self "balance" := { - Notations.double_colon := balance; - }. + Axiom balance_is_impl : impl Self "balance" = balance. (* fn transfer(&mut self, _to: AccountId, _value: Balance) -> Result<(), ()> { @@ -114,10 +102,7 @@ Section Impl_contract_transfer_Env_t. ltac:(contract_transfer.Balance) -> M (core.result.Result.t unit unit). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn transferred_value(&self) -> Balance { @@ -127,10 +112,8 @@ Section Impl_contract_transfer_Env_t. Parameter transferred_value : (ref Self) -> M ltac:(contract_transfer.Balance). - Global Instance AssociatedFunction_transferred_value : - Notations.DoubleColon Self "transferred_value" := { - Notations.double_colon := transferred_value; - }. + Axiom transferred_value_is_impl : + impl Self "transferred_value" = transferred_value. End Impl_contract_transfer_Env_t. End Impl_contract_transfer_Env_t. @@ -151,10 +134,7 @@ Section Impl_contract_transfer_GiveMe_t. *) Parameter init_env : M contract_transfer.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -163,9 +143,7 @@ Section Impl_contract_transfer_GiveMe_t. *) Parameter env : (ref Self) -> M contract_transfer.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -174,9 +152,7 @@ Section Impl_contract_transfer_GiveMe_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn give_me(&mut self, value: Balance) { @@ -197,10 +173,7 @@ Section Impl_contract_transfer_GiveMe_t. Parameter give_me : (mut_ref Self) -> ltac:(contract_transfer.Balance) -> M unit. - Global Instance AssociatedFunction_give_me : - Notations.DoubleColon Self "give_me" := { - Notations.double_colon := give_me; - }. + Axiom give_me_is_impl : impl Self "give_me" = give_me. (* pub fn was_it_ten(&self) { @@ -210,9 +183,6 @@ Section Impl_contract_transfer_GiveMe_t. *) Parameter was_it_ten : (ref Self) -> M unit. - Global Instance AssociatedFunction_was_it_ten : - Notations.DoubleColon Self "was_it_ten" := { - Notations.double_colon := was_it_ten; - }. + Axiom was_it_ten_is_impl : impl Self "was_it_ten" = was_it_ten. End Impl_contract_transfer_GiveMe_t. End Impl_contract_transfer_GiveMe_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v index 5f709f988..d7d901246 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v @@ -25,9 +25,7 @@ Section Impl_custom_allocator_CustomAllocator_t. *) Parameter new : bool.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn default() -> Self { @@ -36,10 +34,7 @@ Section Impl_custom_allocator_CustomAllocator_t. *) Parameter default : M Self. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. (* pub fn flip(&mut self) { @@ -48,10 +43,7 @@ Section Impl_custom_allocator_CustomAllocator_t. *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -60,8 +52,6 @@ Section Impl_custom_allocator_CustomAllocator_t. *) Parameter get : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_custom_allocator_CustomAllocator_t. End Impl_custom_allocator_CustomAllocator_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v index 60eeb240c..65d8e836a 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_custom_environment_AccountId_t. *) Parameter default : M custom_environment.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_custom_environment_AccountId_t. *) Parameter clone : (ref Self) -> M custom_environment.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -90,10 +84,7 @@ Section Impl_core_default_Default_for_custom_environment_Topics_t. *) Parameter default : M custom_environment.Topics.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -143,10 +134,7 @@ Section Impl_core_default_Default_for_custom_environment_EventWithTopics_t. *) Parameter default : M custom_environment.EventWithTopics.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -176,10 +164,7 @@ Section Impl_custom_environment_Env_t. *) Parameter caller : (ref Self) -> M custom_environment.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -188,10 +173,7 @@ Section Impl_custom_environment_Env_t. *) Parameter emit_event : (ref Self) -> custom_environment.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_custom_environment_Env_t. End Impl_custom_environment_Env_t. @@ -206,10 +188,7 @@ Section Impl_custom_environment_Topics_t. *) Parameter init_env : M custom_environment.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -218,9 +197,7 @@ Section Impl_custom_environment_Topics_t. *) Parameter env : (ref Self) -> M custom_environment.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -229,9 +206,7 @@ Section Impl_custom_environment_Topics_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn trigger(&mut self) { @@ -241,9 +216,6 @@ Section Impl_custom_environment_Topics_t. *) Parameter trigger : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_trigger : - Notations.DoubleColon Self "trigger" := { - Notations.double_colon := trigger; - }. + Axiom trigger_is_impl : impl Self "trigger" = trigger. End Impl_custom_environment_Topics_t. End Impl_custom_environment_Topics_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v index 12bec1af2..46dc05ca2 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_dns_Mapping_t_K_V. *) Parameter default : M (dns.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,10 +53,7 @@ Section Impl_dns_Mapping_t_K_V. *) Parameter contains : (ref Self) -> (ref K) -> M bool.t. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -68,9 +62,7 @@ Section Impl_dns_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -79,10 +71,7 @@ Section Impl_dns_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn new() -> Mapping { @@ -91,9 +80,7 @@ Section Impl_dns_Mapping_t_K_V. *) Parameter new : M (dns.Mapping.t K V). - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn remove(&self, _key: K) { @@ -102,10 +89,7 @@ Section Impl_dns_Mapping_t_K_V. *) Parameter remove : (ref Self) -> K -> M unit. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -114,10 +98,7 @@ Section Impl_dns_Mapping_t_K_V. *) Parameter size : (ref Self) -> K -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -126,10 +107,7 @@ Section Impl_dns_Mapping_t_K_V. *) Parameter take : (ref Self) -> K -> M (core.option.Option.t V). - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_dns_Mapping_t_K_V. End Impl_dns_Mapping_t_K_V. @@ -153,10 +131,7 @@ Section Impl_core_default_Default_for_dns_AccountId_t. *) Parameter default : M dns.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -173,10 +148,7 @@ Section Impl_core_clone_Clone_for_dns_AccountId_t. *) Parameter clone : (ref Self) -> M dns.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -212,9 +184,7 @@ Section Impl_core_cmp_PartialEq_for_dns_AccountId_t. *) Parameter eq : (ref Self) -> (ref dns.AccountId.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -236,10 +206,7 @@ Section Impl_core_convert_From_array_u8_t_for_dns_AccountId_t. *) Parameter from : (array u8.t) -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -360,10 +327,7 @@ Section Impl_dns_Env_t. *) Parameter caller : (ref Self) -> M dns.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -372,10 +336,7 @@ Section Impl_dns_Env_t. *) Parameter emit_event : (ref Self) -> dns.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_dns_Env_t. End Impl_dns_Env_t. @@ -429,10 +390,7 @@ Section Impl_core_default_Default_for_dns_DomainNameService_t. *) Parameter default : M Self. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -464,9 +422,7 @@ Section Impl_core_cmp_PartialEq_for_dns_Error_t. *) Parameter eq : (ref Self) -> (ref dns.Error.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -495,10 +451,8 @@ Section Impl_core_cmp_Eq_for_dns_Error_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -520,10 +474,7 @@ Section Impl_dns_DomainNameService_t. *) Parameter init_env : M dns.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -532,9 +483,7 @@ Section Impl_dns_DomainNameService_t. *) Parameter env : (ref Self) -> M dns.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -543,9 +492,7 @@ Section Impl_dns_DomainNameService_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn register(&mut self, name: Hash) -> Result<()> { @@ -564,10 +511,7 @@ Section Impl_dns_DomainNameService_t. Parameter register : (mut_ref Self) -> ltac:(dns.Hash) -> M ltac:(dns.Result unit). - Global Instance AssociatedFunction_register : - Notations.DoubleColon Self "register" := { - Notations.double_colon := register; - }. + Axiom register_is_impl : impl Self "register" = register. (* fn get_owner_or_default(&self, name: Hash) -> AccountId { @@ -579,10 +523,8 @@ Section Impl_dns_DomainNameService_t. Parameter get_owner_or_default : (ref Self) -> ltac:(dns.Hash) -> M dns.AccountId.t. - Global Instance AssociatedFunction_get_owner_or_default : - Notations.DoubleColon Self "get_owner_or_default" := { - Notations.double_colon := get_owner_or_default; - }. + Axiom get_owner_or_default_is_impl : + impl Self "get_owner_or_default" = get_owner_or_default. (* pub fn set_address(&mut self, name: Hash, new_address: AccountId) -> Result<()> { @@ -610,10 +552,7 @@ Section Impl_dns_DomainNameService_t. dns.AccountId.t -> M ltac:(dns.Result unit). - Global Instance AssociatedFunction_set_address : - Notations.DoubleColon Self "set_address" := { - Notations.double_colon := set_address; - }. + Axiom set_address_is_impl : impl Self "set_address" = set_address. (* pub fn transfer(&mut self, name: Hash, to: AccountId) -> Result<()> { @@ -642,10 +581,7 @@ Section Impl_dns_DomainNameService_t. dns.AccountId.t -> M ltac:(dns.Result unit). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn get_address_or_default(&self, name: Hash) -> AccountId { @@ -657,10 +593,8 @@ Section Impl_dns_DomainNameService_t. Parameter get_address_or_default : (ref Self) -> ltac:(dns.Hash) -> M dns.AccountId.t. - Global Instance AssociatedFunction_get_address_or_default : - Notations.DoubleColon Self "get_address_or_default" := { - Notations.double_colon := get_address_or_default; - }. + Axiom get_address_or_default_is_impl : + impl Self "get_address_or_default" = get_address_or_default. (* pub fn get_address(&self, name: Hash) -> AccountId { @@ -669,10 +603,7 @@ Section Impl_dns_DomainNameService_t. *) Parameter get_address : (ref Self) -> ltac:(dns.Hash) -> M dns.AccountId.t. - Global Instance AssociatedFunction_get_address : - Notations.DoubleColon Self "get_address" := { - Notations.double_colon := get_address; - }. + Axiom get_address_is_impl : impl Self "get_address" = get_address. (* pub fn get_owner(&self, name: Hash) -> AccountId { @@ -681,9 +612,6 @@ Section Impl_dns_DomainNameService_t. *) Parameter get_owner : (ref Self) -> ltac:(dns.Hash) -> M dns.AccountId.t. - Global Instance AssociatedFunction_get_owner : - Notations.DoubleColon Self "get_owner" := { - Notations.double_colon := get_owner; - }. + Axiom get_owner_is_impl : impl Self "get_owner" = get_owner. End Impl_dns_DomainNameService_t. End Impl_dns_DomainNameService_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/e2e_call_runtime.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/e2e_call_runtime.v index d952e9889..1b53168dd 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/e2e_call_runtime.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/e2e_call_runtime.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_e2e_call_runtime_AccountId_t. *) Parameter default : M e2e_call_runtime.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_e2e_call_runtime_AccountId_t. *) Parameter clone : (ref Self) -> M e2e_call_runtime.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -86,10 +80,7 @@ Section Impl_e2e_call_runtime_Env_t. *) Parameter balance : (ref Self) -> M ltac:(e2e_call_runtime.Balance). - Global Instance AssociatedFunction_balance : - Notations.DoubleColon Self "balance" := { - Notations.double_colon := balance; - }. + Axiom balance_is_impl : impl Self "balance" = balance. End Impl_e2e_call_runtime_Env_t. End Impl_e2e_call_runtime_Env_t. @@ -108,10 +99,7 @@ Section Impl_core_default_Default_for_e2e_call_runtime_Contract_t. *) Parameter default : M e2e_call_runtime.Contract.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -130,10 +118,7 @@ Section Impl_e2e_call_runtime_Contract_t. *) Parameter init_env : M e2e_call_runtime.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -142,9 +127,7 @@ Section Impl_e2e_call_runtime_Contract_t. *) Parameter env : (ref Self) -> M e2e_call_runtime.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -153,9 +136,7 @@ Section Impl_e2e_call_runtime_Contract_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn get_contract_balance(&self) -> Balance { @@ -165,9 +146,7 @@ Section Impl_e2e_call_runtime_Contract_t. Parameter get_contract_balance : (ref Self) -> M ltac:(e2e_call_runtime.Balance). - Global Instance AssociatedFunction_get_contract_balance : - Notations.DoubleColon Self "get_contract_balance" := { - Notations.double_colon := get_contract_balance; - }. + Axiom get_contract_balance_is_impl : + impl Self "get_contract_balance" = get_contract_balance. End Impl_e2e_call_runtime_Contract_t. End Impl_e2e_call_runtime_Contract_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v index 7e96c48ba..9c14324fe 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_erc1155_Mapping_t_K_V. *) Parameter default : M (erc1155.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,10 +53,7 @@ Section Impl_erc1155_Mapping_t_K_V. *) Parameter contains : (ref Self) -> (ref K) -> M bool.t. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -68,9 +62,7 @@ Section Impl_erc1155_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -79,10 +71,7 @@ Section Impl_erc1155_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn remove(&self, _key: K) { @@ -91,10 +80,7 @@ Section Impl_erc1155_Mapping_t_K_V. *) Parameter remove : (ref Self) -> K -> M unit. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -103,10 +89,7 @@ Section Impl_erc1155_Mapping_t_K_V. *) Parameter size : (ref Self) -> K -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -115,10 +98,7 @@ Section Impl_erc1155_Mapping_t_K_V. *) Parameter take : (ref Self) -> K -> M (core.option.Option.t V). - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_erc1155_Mapping_t_K_V. End Impl_erc1155_Mapping_t_K_V. @@ -142,10 +122,7 @@ Section Impl_core_default_Default_for_erc1155_AccountId_t. *) Parameter default : M erc1155.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -162,10 +139,7 @@ Section Impl_core_clone_Clone_for_erc1155_AccountId_t. *) Parameter clone : (ref Self) -> M erc1155.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -201,9 +175,7 @@ Section Impl_core_cmp_PartialEq_for_erc1155_AccountId_t. *) Parameter eq : (ref Self) -> (ref erc1155.AccountId.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -225,10 +197,7 @@ Section Impl_core_convert_From_array_u8_t_for_erc1155_AccountId_t. *) Parameter from : (array u8.t) -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -290,9 +259,7 @@ Section Impl_core_cmp_PartialEq_for_erc1155_Error_t. *) Parameter eq : (ref Self) -> (ref erc1155.Error.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -321,10 +288,8 @@ Section Impl_core_cmp_Eq_for_erc1155_Error_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -509,10 +474,7 @@ Section Impl_erc1155_Env_t. *) Parameter caller : (ref Self) -> M erc1155.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -521,10 +483,7 @@ Section Impl_erc1155_Env_t. *) Parameter emit_event : (ref Self) -> erc1155.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_erc1155_Env_t. End Impl_erc1155_Env_t. @@ -564,10 +523,7 @@ Section Impl_core_default_Default_for_erc1155_Contract_t. *) Parameter default : M erc1155.Contract.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -586,10 +542,7 @@ Section Impl_erc1155_Contract_t. *) Parameter init_env : M erc1155.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -598,9 +551,7 @@ Section Impl_erc1155_Contract_t. *) Parameter env : (ref Self) -> M erc1155.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -609,9 +560,7 @@ Section Impl_erc1155_Contract_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn create(&mut self, value: Balance) -> TokenId { @@ -637,10 +586,7 @@ Section Impl_erc1155_Contract_t. Parameter create : (mut_ref Self) -> ltac:(erc1155.Balance) -> M ltac:(erc1155.TokenId). - Global Instance AssociatedFunction_create : - Notations.DoubleColon Self "create" := { - Notations.double_colon := create; - }. + Axiom create_is_impl : impl Self "create" = create. (* pub fn mint(&mut self, token_id: TokenId, value: Balance) -> Result<()> { @@ -667,10 +613,7 @@ Section Impl_erc1155_Contract_t. ltac:(erc1155.Balance) -> M ltac:(erc1155.Result unit). - Global Instance AssociatedFunction_mint : - Notations.DoubleColon Self "mint" := { - Notations.double_colon := mint; - }. + Axiom mint_is_impl : impl Self "mint" = mint. (* fn perform_transfer( @@ -709,10 +652,8 @@ Section Impl_erc1155_Contract_t. ltac:(erc1155.Balance) -> M unit. - Global Instance AssociatedFunction_perform_transfer : - Notations.DoubleColon Self "perform_transfer" := { - Notations.double_colon := perform_transfer; - }. + Axiom perform_transfer_is_impl : + impl Self "perform_transfer" = perform_transfer. (* fn transfer_acceptance_check( @@ -797,10 +738,8 @@ Section Impl_erc1155_Contract_t. (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A) -> M unit. - Global Instance AssociatedFunction_transfer_acceptance_check : - Notations.DoubleColon Self "transfer_acceptance_check" := { - Notations.double_colon := transfer_acceptance_check; - }. + Axiom transfer_acceptance_check_is_impl : + impl Self "transfer_acceptance_check" = transfer_acceptance_check. End Impl_erc1155_Contract_t. End Impl_erc1155_Contract_t. @@ -816,10 +755,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. Parameter is_approved_for_all : (ref Self) -> erc1155.AccountId.t -> erc1155.AccountId.t -> M bool.t. - Global Instance AssociatedFunction_is_approved_for_all : - Notations.DoubleColon Self "is_approved_for_all" := { - Notations.double_colon := is_approved_for_all; - }. + Axiom is_approved_for_all_is_impl : + impl Self "is_approved_for_all" = is_approved_for_all. (* fn balance_of(&self, owner: AccountId, token_id: TokenId) -> Balance { @@ -832,10 +769,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. ltac:(erc1155.TokenId) -> M ltac:(erc1155.Balance). - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* fn safe_transfer_from( @@ -871,10 +805,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A) -> M ltac:(erc1155.Result unit). - Global Instance AssociatedFunction_safe_transfer_from : - Notations.DoubleColon Self "safe_transfer_from" := { - Notations.double_colon := safe_transfer_from; - }. + Axiom safe_transfer_from_is_impl : + impl Self "safe_transfer_from" = safe_transfer_from. (* fn safe_batch_transfer_from( @@ -923,10 +855,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A) -> M ltac:(erc1155.Result unit). - Global Instance AssociatedFunction_safe_batch_transfer_from : - Notations.DoubleColon Self "safe_batch_transfer_from" := { - Notations.double_colon := safe_batch_transfer_from; - }. + Axiom safe_batch_transfer_from_is_impl : + impl Self "safe_batch_transfer_from" = safe_batch_transfer_from. (* fn balance_of_batch(&self, owners: Vec, token_ids: Vec) -> Vec { @@ -946,10 +876,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (alloc.vec.Vec.t ltac:(erc1155.TokenId) alloc.vec.Vec.Default.A) -> M (alloc.vec.Vec.t ltac:(erc1155.Balance) alloc.vec.Vec.Default.A). - Global Instance AssociatedFunction_balance_of_batch : - Notations.DoubleColon Self "balance_of_batch" := { - Notations.double_colon := balance_of_batch; - }. + Axiom balance_of_batch_is_impl : + impl Self "balance_of_batch" = balance_of_batch. (* fn set_approval_for_all(&mut self, operator: AccountId, approved: bool) -> Result<()> { @@ -977,10 +905,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. bool.t -> M ltac:(erc1155.Result unit). - Global Instance AssociatedFunction_set_approval_for_all : - Notations.DoubleColon Self "set_approval_for_all" := { - Notations.double_colon := set_approval_for_all; - }. + Axiom set_approval_for_all_is_impl : + impl Self "set_approval_for_all" = set_approval_for_all. Global Instance ℐ : erc1155.Erc1155.Trait Self := { erc1155.Erc1155.is_approved_for_all := is_approved_for_all; @@ -1029,10 +955,7 @@ Section Impl_erc1155_Erc1155TokenReceiver_for_erc1155_Contract_t. (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A) -> M (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A). - Global Instance AssociatedFunction_on_received : - Notations.DoubleColon Self "on_received" := { - Notations.double_colon := on_received; - }. + Axiom on_received_is_impl : impl Self "on_received" = on_received. (* fn on_batch_received( @@ -1066,10 +989,8 @@ Section Impl_erc1155_Erc1155TokenReceiver_for_erc1155_Contract_t. (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A) -> M (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A). - Global Instance AssociatedFunction_on_batch_received : - Notations.DoubleColon Self "on_batch_received" := { - Notations.double_colon := on_batch_received; - }. + Axiom on_batch_received_is_impl : + impl Self "on_batch_received" = on_batch_received. Global Instance ℐ : erc1155.Erc1155TokenReceiver.Trait Self := { erc1155.Erc1155TokenReceiver.on_received := on_received; diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v index b54b75e73..a761ca5d6 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_erc20_Mapping_t_K_V. *) Parameter default : M (erc20.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,9 +53,7 @@ Section Impl_erc20_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) { @@ -67,10 +62,7 @@ Section Impl_erc20_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M unit. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. End Impl_erc20_Mapping_t_K_V. End Impl_erc20_Mapping_t_K_V. @@ -94,10 +86,7 @@ Section Impl_core_default_Default_for_erc20_AccountId_t. *) Parameter default : M erc20.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -114,10 +103,7 @@ Section Impl_core_clone_Clone_for_erc20_AccountId_t. *) Parameter clone : (ref Self) -> M erc20.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -183,10 +169,7 @@ Section Impl_core_default_Default_for_erc20_Erc20_t. *) Parameter default : M erc20.Erc20.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -267,10 +250,7 @@ Section Impl_erc20_Env_t. *) Parameter caller : (ref Self) -> M erc20.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -279,10 +259,7 @@ Section Impl_erc20_Env_t. *) Parameter emit_event : (ref Self) -> erc20.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_erc20_Env_t. End Impl_erc20_Env_t. @@ -297,10 +274,7 @@ Section Impl_erc20_Erc20_t. *) Parameter init_env : M erc20.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -309,9 +283,7 @@ Section Impl_erc20_Erc20_t. *) Parameter env : (ref Self) -> M erc20.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. End Impl_erc20_Erc20_t. End Impl_erc20_Erc20_t. @@ -338,9 +310,7 @@ Section Impl_erc20_Erc20_t_2. *) Parameter new : ltac:(erc20.Balance) -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn total_supply(&self) -> Balance { @@ -349,10 +319,7 @@ Section Impl_erc20_Erc20_t_2. *) Parameter total_supply : (ref Self) -> M ltac:(erc20.Balance). - Global Instance AssociatedFunction_total_supply : - Notations.DoubleColon Self "total_supply" := { - Notations.double_colon := total_supply; - }. + Axiom total_supply_is_impl : impl Self "total_supply" = total_supply. (* fn balance_of_impl(&self, owner: &AccountId) -> Balance { @@ -362,10 +329,7 @@ Section Impl_erc20_Erc20_t_2. Parameter balance_of_impl : (ref Self) -> (ref erc20.AccountId.t) -> M ltac:(erc20.Balance). - Global Instance AssociatedFunction_balance_of_impl : - Notations.DoubleColon Self "balance_of_impl" := { - Notations.double_colon := balance_of_impl; - }. + Axiom balance_of_impl_is_impl : impl Self "balance_of_impl" = balance_of_impl. (* fn balance_of(&self, owner: AccountId) -> Balance { @@ -375,10 +339,7 @@ Section Impl_erc20_Erc20_t_2. Parameter balance_of : (ref Self) -> erc20.AccountId.t -> M ltac:(erc20.Balance). - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* fn allowance_impl(&self, owner: &AccountId, spender: &AccountId) -> Balance { @@ -391,10 +352,7 @@ Section Impl_erc20_Erc20_t_2. (ref erc20.AccountId.t) -> M ltac:(erc20.Balance). - Global Instance AssociatedFunction_allowance_impl : - Notations.DoubleColon Self "allowance_impl" := { - Notations.double_colon := allowance_impl; - }. + Axiom allowance_impl_is_impl : impl Self "allowance_impl" = allowance_impl. (* fn allowance(&self, owner: AccountId, spender: AccountId) -> Balance { @@ -407,10 +365,7 @@ Section Impl_erc20_Erc20_t_2. erc20.AccountId.t -> M ltac:(erc20.Balance). - Global Instance AssociatedFunction_allowance : - Notations.DoubleColon Self "allowance" := { - Notations.double_colon := allowance; - }. + Axiom allowance_is_impl : impl Self "allowance" = allowance. (* fn transfer_from_to(&mut self, from: &AccountId, to: &AccountId, value: Balance) -> Result<()> { @@ -437,10 +392,8 @@ Section Impl_erc20_Erc20_t_2. ltac:(erc20.Balance) -> M ltac:(erc20.Result unit). - Global Instance AssociatedFunction_transfer_from_to : - Notations.DoubleColon Self "transfer_from_to" := { - Notations.double_colon := transfer_from_to; - }. + Axiom transfer_from_to_is_impl : + impl Self "transfer_from_to" = transfer_from_to. (* fn transfer(&mut self, to: AccountId, value: Balance) -> Result<()> { @@ -454,10 +407,7 @@ Section Impl_erc20_Erc20_t_2. ltac:(erc20.Balance) -> M ltac:(erc20.Result unit). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn approve(&mut self, spender: AccountId, value: Balance) -> Result<()> { @@ -477,10 +427,7 @@ Section Impl_erc20_Erc20_t_2. ltac:(erc20.Balance) -> M ltac:(erc20.Result unit). - Global Instance AssociatedFunction_approve : - Notations.DoubleColon Self "approve" := { - Notations.double_colon := approve; - }. + Axiom approve_is_impl : impl Self "approve" = approve. (* fn transfer_from(&mut self, from: AccountId, to: AccountId, value: Balance) -> Result<()> { @@ -501,9 +448,6 @@ Section Impl_erc20_Erc20_t_2. ltac:(erc20.Balance) -> M ltac:(erc20.Result unit). - Global Instance AssociatedFunction_transfer_from : - Notations.DoubleColon Self "transfer_from" := { - Notations.double_colon := transfer_from; - }. + Axiom transfer_from_is_impl : impl Self "transfer_from" = transfer_from. End Impl_erc20_Erc20_t_2. End Impl_erc20_Erc20_t_2. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v index e09844a38..1172f74ff 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_erc721_Mapping_t_K_V. *) Parameter default : M (erc721.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,10 +53,7 @@ Section Impl_erc721_Mapping_t_K_V. *) Parameter contains : (ref Self) -> (ref K) -> M bool.t. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -68,9 +62,7 @@ Section Impl_erc721_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -79,10 +71,7 @@ Section Impl_erc721_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn remove(&self, _key: K) { @@ -91,10 +80,7 @@ Section Impl_erc721_Mapping_t_K_V. *) Parameter remove : (ref Self) -> K -> M unit. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -103,10 +89,7 @@ Section Impl_erc721_Mapping_t_K_V. *) Parameter size : (ref Self) -> K -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -115,10 +98,7 @@ Section Impl_erc721_Mapping_t_K_V. *) Parameter take : (ref Self) -> K -> M (core.option.Option.t V). - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_erc721_Mapping_t_K_V. End Impl_erc721_Mapping_t_K_V. @@ -142,10 +122,7 @@ Section Impl_core_default_Default_for_erc721_AccountId_t. *) Parameter default : M erc721.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -162,10 +139,7 @@ Section Impl_core_clone_Clone_for_erc721_AccountId_t. *) Parameter clone : (ref Self) -> M erc721.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -201,9 +175,7 @@ Section Impl_core_cmp_PartialEq_for_erc721_AccountId_t. *) Parameter eq : (ref Self) -> (ref erc721.AccountId.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -225,10 +197,7 @@ Section Impl_core_convert_From_array_u8_t_for_erc721_AccountId_t. *) Parameter from : (array u8.t) -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -289,10 +258,7 @@ Section Impl_core_default_Default_for_erc721_Erc721_t. *) Parameter default : M erc721.Erc721.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -329,9 +295,7 @@ Section Impl_core_cmp_PartialEq_for_erc721_Error_t. *) Parameter eq : (ref Self) -> (ref erc721.Error.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -360,10 +324,8 @@ Section Impl_core_cmp_Eq_for_erc721_Error_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -381,10 +343,7 @@ Section Impl_core_clone_Clone_for_erc721_Error_t. *) Parameter clone : (ref Self) -> M erc721.Error.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -496,10 +455,7 @@ Section Impl_erc721_Env_t. *) Parameter caller : (ref Self) -> M erc721.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -508,10 +464,7 @@ Section Impl_erc721_Env_t. *) Parameter emit_event : (ref Self) -> erc721.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_erc721_Env_t. End Impl_erc721_Env_t. @@ -526,10 +479,7 @@ Section Impl_erc721_Erc721_t. *) Parameter init_env : M erc721.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -538,9 +488,7 @@ Section Impl_erc721_Erc721_t. *) Parameter env : (ref Self) -> M erc721.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -549,9 +497,7 @@ Section Impl_erc721_Erc721_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn balance_of_or_zero(&self, of: &AccountId) -> u32 { @@ -561,10 +507,8 @@ Section Impl_erc721_Erc721_t. Parameter balance_of_or_zero : (ref Self) -> (ref erc721.AccountId.t) -> M u32.t. - Global Instance AssociatedFunction_balance_of_or_zero : - Notations.DoubleColon Self "balance_of_or_zero" := { - Notations.double_colon := balance_of_or_zero; - }. + Axiom balance_of_or_zero_is_impl : + impl Self "balance_of_or_zero" = balance_of_or_zero. (* fn clear_approval(&mut self, id: TokenId) { @@ -573,10 +517,7 @@ Section Impl_erc721_Erc721_t. *) Parameter clear_approval : (mut_ref Self) -> ltac:(erc721.TokenId) -> M unit. - Global Instance AssociatedFunction_clear_approval : - Notations.DoubleColon Self "clear_approval" := { - Notations.double_colon := clear_approval; - }. + Axiom clear_approval_is_impl : impl Self "clear_approval" = clear_approval. (* fn approved_for_all(&self, owner: AccountId, operator: AccountId) -> bool { @@ -586,10 +527,8 @@ Section Impl_erc721_Erc721_t. Parameter approved_for_all : (ref Self) -> erc721.AccountId.t -> erc721.AccountId.t -> M bool.t. - Global Instance AssociatedFunction_approved_for_all : - Notations.DoubleColon Self "approved_for_all" := { - Notations.double_colon := approved_for_all; - }. + Axiom approved_for_all_is_impl : + impl Self "approved_for_all" = approved_for_all. (* pub fn owner_of(&self, id: TokenId) -> Option { @@ -601,10 +540,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.option.Option.t erc721.AccountId.t). - Global Instance AssociatedFunction_owner_of : - Notations.DoubleColon Self "owner_of" := { - Notations.double_colon := owner_of; - }. + Axiom owner_of_is_impl : impl Self "owner_of" = owner_of. (* fn approved_or_owner(&self, from: Option, id: TokenId) -> bool { @@ -624,10 +560,8 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M bool.t. - Global Instance AssociatedFunction_approved_or_owner : - Notations.DoubleColon Self "approved_or_owner" := { - Notations.double_colon := approved_or_owner; - }. + Axiom approved_or_owner_is_impl : + impl Self "approved_or_owner" = approved_or_owner. (* fn exists(&self, id: TokenId) -> bool { @@ -636,10 +570,7 @@ Section Impl_erc721_Erc721_t. *) Parameter exists_ : (ref Self) -> ltac:(erc721.TokenId) -> M bool.t. - Global Instance AssociatedFunction_exists_ : - Notations.DoubleColon Self "exists_" := { - Notations.double_colon := exists_; - }. + Axiom exists__is_impl : impl Self "exists_" = exists_. (* pub fn balance_of(&self, owner: AccountId) -> u32 { @@ -648,10 +579,7 @@ Section Impl_erc721_Erc721_t. *) Parameter balance_of : (ref Self) -> erc721.AccountId.t -> M u32.t. - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* pub fn get_approved(&self, id: TokenId) -> Option { @@ -663,10 +591,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.option.Option.t erc721.AccountId.t). - Global Instance AssociatedFunction_get_approved : - Notations.DoubleColon Self "get_approved" := { - Notations.double_colon := get_approved; - }. + Axiom get_approved_is_impl : impl Self "get_approved" = get_approved. (* pub fn is_approved_for_all(&self, owner: AccountId, operator: AccountId) -> bool { @@ -676,10 +601,8 @@ Section Impl_erc721_Erc721_t. Parameter is_approved_for_all : (ref Self) -> erc721.AccountId.t -> erc721.AccountId.t -> M bool.t. - Global Instance AssociatedFunction_is_approved_for_all : - Notations.DoubleColon Self "is_approved_for_all" := { - Notations.double_colon := is_approved_for_all; - }. + Axiom is_approved_for_all_is_impl : + impl Self "is_approved_for_all" = is_approved_for_all. (* fn approve_for_all(&mut self, to: AccountId, approved: bool) -> Result<(), Error> { @@ -708,10 +631,7 @@ Section Impl_erc721_Erc721_t. bool.t -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_approve_for_all : - Notations.DoubleColon Self "approve_for_all" := { - Notations.double_colon := approve_for_all; - }. + Axiom approve_for_all_is_impl : impl Self "approve_for_all" = approve_for_all. (* pub fn set_approval_for_all(&mut self, to: AccountId, approved: bool) -> Result<(), Error> { @@ -725,10 +645,8 @@ Section Impl_erc721_Erc721_t. bool.t -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_set_approval_for_all : - Notations.DoubleColon Self "set_approval_for_all" := { - Notations.double_colon := set_approval_for_all; - }. + Axiom set_approval_for_all_is_impl : + impl Self "set_approval_for_all" = set_approval_for_all. (* fn approve_for(&mut self, to: &AccountId, id: TokenId) -> Result<(), Error> { @@ -765,10 +683,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_approve_for : - Notations.DoubleColon Self "approve_for" := { - Notations.double_colon := approve_for; - }. + Axiom approve_for_is_impl : impl Self "approve_for" = approve_for. (* pub fn approve(&mut self, to: AccountId, id: TokenId) -> Result<(), Error> { @@ -782,10 +697,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_approve : - Notations.DoubleColon Self "approve" := { - Notations.double_colon := approve; - }. + Axiom approve_is_impl : impl Self "approve" = approve. (* fn remove_token_from(&mut self, from: &AccountId, id: TokenId) -> Result<(), Error> { @@ -815,10 +727,8 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_remove_token_from : - Notations.DoubleColon Self "remove_token_from" := { - Notations.double_colon := remove_token_from; - }. + Axiom remove_token_from_is_impl : + impl Self "remove_token_from" = remove_token_from. (* fn add_token_to(&mut self, to: &AccountId, id: TokenId) -> Result<(), Error> { @@ -853,10 +763,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_add_token_to : - Notations.DoubleColon Self "add_token_to" := { - Notations.double_colon := add_token_to; - }. + Axiom add_token_to_is_impl : impl Self "add_token_to" = add_token_to. (* fn transfer_token_from( @@ -890,10 +797,8 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_transfer_token_from : - Notations.DoubleColon Self "transfer_token_from" := { - Notations.double_colon := transfer_token_from; - }. + Axiom transfer_token_from_is_impl : + impl Self "transfer_token_from" = transfer_token_from. (* pub fn transfer(&mut self, destination: AccountId, id: TokenId) -> Result<(), Error> { @@ -908,10 +813,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* pub fn transfer_from( @@ -931,10 +833,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_transfer_from : - Notations.DoubleColon Self "transfer_from" := { - Notations.double_colon := transfer_from; - }. + Axiom transfer_from_is_impl : impl Self "transfer_from" = transfer_from. (* pub fn mint(&mut self, id: TokenId) -> Result<(), Error> { @@ -953,10 +852,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_mint : - Notations.DoubleColon Self "mint" := { - Notations.double_colon := mint; - }. + Axiom mint_is_impl : impl Self "mint" = mint. (* pub fn burn(&mut self, id: TokenId) -> Result<(), Error> { @@ -993,9 +889,6 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_burn : - Notations.DoubleColon Self "burn" := { - Notations.double_colon := burn; - }. + Axiom burn_is_impl : impl Self "burn" = burn. End Impl_erc721_Erc721_t. End Impl_erc721_Erc721_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v index 55f5de369..bc4a721cb 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v @@ -23,9 +23,7 @@ Section Impl_flipper_Flipper_t. *) Parameter new : bool.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -34,10 +32,7 @@ Section Impl_flipper_Flipper_t. *) Parameter new_default : M Self. - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn flip(&mut self) { @@ -46,10 +41,7 @@ Section Impl_flipper_Flipper_t. *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -58,8 +50,6 @@ Section Impl_flipper_Flipper_t. *) Parameter get : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_flipper_Flipper_t. End Impl_flipper_Flipper_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v index 4f0e0a9b6..7e29dbd92 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v @@ -23,9 +23,7 @@ Section Impl_incrementer_Incrementer_t. *) Parameter new : i32.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -34,10 +32,7 @@ Section Impl_incrementer_Incrementer_t. *) Parameter new_default : M Self. - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn inc(&mut self, by: i32) { @@ -46,9 +41,7 @@ Section Impl_incrementer_Incrementer_t. *) Parameter inc : (mut_ref Self) -> i32.t -> M unit. - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* pub fn get(&self) -> i32 { @@ -57,8 +50,6 @@ Section Impl_incrementer_Incrementer_t. *) Parameter get : (ref Self) -> M i32.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_incrementer_Incrementer_t. End Impl_incrementer_Incrementer_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder.v index d9ab95cb5..2de9f9943 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_call_builder_AccountId_t. *) Parameter default : M call_builder.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_call_builder_AccountId_t. *) Parameter clone : (ref Self) -> M call_builder.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -89,9 +83,7 @@ Section Impl_call_builder_Selector_t. *) Parameter new : (array u8.t) -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_call_builder_Selector_t. End Impl_call_builder_Selector_t. @@ -110,10 +102,7 @@ Section Impl_core_default_Default_for_call_builder_CallBuilderTest_t. *) Parameter default : M call_builder.CallBuilderTest.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -132,9 +121,7 @@ Section Impl_call_builder_CallBuilderTest_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn call(&mut self, address: AccountId, selector: [u8; 4]) -> Option { @@ -161,10 +148,7 @@ Section Impl_call_builder_CallBuilderTest_t. (array u8.t) -> M (core.option.Option.t call_builder.LangError.t). - Global Instance AssociatedFunction_call : - Notations.DoubleColon Self "call" := { - Notations.double_colon := call; - }. + Axiom call_is_impl : impl Self "call" = call. (* pub fn invoke(&mut self, address: AccountId, selector: [u8; 4]) { @@ -180,10 +164,7 @@ Section Impl_call_builder_CallBuilderTest_t. Parameter invoke : (mut_ref Self) -> call_builder.AccountId.t -> (array u8.t) -> M unit. - Global Instance AssociatedFunction_invoke : - Notations.DoubleColon Self "invoke" := { - Notations.double_colon := invoke; - }. + Axiom invoke_is_impl : impl Self "invoke" = invoke. (* pub fn call_instantiate( @@ -222,10 +203,8 @@ Section Impl_call_builder_CallBuilderTest_t. bool.t -> M (core.option.Option.t call_builder.LangError.t). - Global Instance AssociatedFunction_call_instantiate : - Notations.DoubleColon Self "call_instantiate" := { - Notations.double_colon := call_instantiate; - }. + Axiom call_instantiate_is_impl : + impl Self "call_instantiate" = call_instantiate. (* pub fn call_instantiate_fallible( @@ -261,9 +240,7 @@ Section Impl_call_builder_CallBuilderTest_t. bool.t -> M (core.option.Option.t unit). - Global Instance AssociatedFunction_call_instantiate_fallible : - Notations.DoubleColon Self "call_instantiate_fallible" := { - Notations.double_colon := call_instantiate_fallible; - }. + Axiom call_instantiate_fallible_is_impl : + impl Self "call_instantiate_fallible" = call_instantiate_fallible. End Impl_call_builder_CallBuilderTest_t. End Impl_call_builder_CallBuilderTest_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v index 1d0139a2d..ab1db9e4b 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v @@ -28,10 +28,7 @@ Section Impl_core_default_Default_for_call_builder_delegate_CallBuilderDelegateT *) Parameter default : M call_builder_delegate.CallBuilderDelegateTest.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -50,9 +47,7 @@ Section Impl_call_builder_delegate_CallBuilderDelegateTest_t. *) Parameter new : i32.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn delegate(&mut self, code_hash: Hash, selector: [u8; 4]) -> Option { @@ -79,10 +74,7 @@ Section Impl_call_builder_delegate_CallBuilderDelegateTest_t. (array u8.t) -> M (core.option.Option.t call_builder_delegate.LangError.t). - Global Instance AssociatedFunction_delegate : - Notations.DoubleColon Self "delegate" := { - Notations.double_colon := delegate; - }. + Axiom delegate_is_impl : impl Self "delegate" = delegate. (* pub fn invoke(&mut self, code_hash: Hash, selector: [u8; 4]) -> i32 { @@ -102,9 +94,6 @@ Section Impl_call_builder_delegate_CallBuilderDelegateTest_t. (array u8.t) -> M i32.t. - Global Instance AssociatedFunction_invoke : - Notations.DoubleColon Self "invoke" := { - Notations.double_colon := invoke; - }. + Axiom invoke_is_impl : impl Self "invoke" = invoke. End Impl_call_builder_delegate_CallBuilderDelegateTest_t. End Impl_call_builder_delegate_CallBuilderDelegateTest_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v index 18f67e9b7..a61d8805b 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_constructors_return_value_AccountId_t. *) Parameter default : M constructors_return_value.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_constructors_return_value_AccountId_t. *) Parameter clone : (ref Self) -> M constructors_return_value.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -73,10 +67,7 @@ Section Impl_core_convert_From_array_u8_t_for_constructors_return_value_AccountI *) Parameter from : (array u8.t) -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -121,9 +112,7 @@ Section Impl_core_fmt_Debug_for_constructors_return_value_ConstructorError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -148,10 +137,8 @@ Section Impl_constructors_return_value_ReturnFlags_t. *) Parameter new_with_reverted : bool.t -> M Self. - Global Instance AssociatedFunction_new_with_reverted : - Notations.DoubleColon Self "new_with_reverted" := { - Notations.double_colon := new_with_reverted; - }. + Axiom new_with_reverted_is_impl : + impl Self "new_with_reverted" = new_with_reverted. End Impl_constructors_return_value_ReturnFlags_t. End Impl_constructors_return_value_ReturnFlags_t. @@ -175,9 +162,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. *) Parameter new : bool.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn try_new(succeed: bool) -> Result { @@ -195,10 +180,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. Self constructors_return_value.ConstructorError.t). - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn revert_new(_init_value: bool) -> Self { @@ -210,10 +192,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. *) Parameter revert_new : bool.t -> M Self. - Global Instance AssociatedFunction_revert_new : - Notations.DoubleColon Self "revert_new" := { - Notations.double_colon := revert_new; - }. + Axiom revert_new_is_impl : impl Self "revert_new" = revert_new. (* pub fn try_revert_new(init_value: bool) -> Result { @@ -236,10 +215,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. Self constructors_return_value.ConstructorError.t). - Global Instance AssociatedFunction_try_revert_new : - Notations.DoubleColon Self "try_revert_new" := { - Notations.double_colon := try_revert_new; - }. + Axiom try_revert_new_is_impl : impl Self "try_revert_new" = try_revert_new. (* pub fn get_value(&self) -> bool { @@ -248,9 +224,6 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. *) Parameter get_value : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get_value : - Notations.DoubleColon Self "get_value" := { - Notations.double_colon := get_value; - }. + Axiom get_value_is_impl : impl Self "get_value" = get_value. End Impl_constructors_return_value_ConstructorsReturnValue_t. End Impl_constructors_return_value_ConstructorsReturnValue_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/contract_ref.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/contract_ref.v index 845f30332..9019236ae 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/contract_ref.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/contract_ref.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_contract_ref_AccountId_t. *) Parameter default : M contract_ref.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_contract_ref_AccountId_t. *) Parameter clone : (ref Self) -> M contract_ref.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -104,9 +98,7 @@ Section Impl_core_fmt_Debug_for_contract_ref_FlipperError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -125,10 +117,7 @@ Section Impl_contract_ref_FlipperRef_t. *) Parameter init_env : M contract_ref.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -137,9 +126,7 @@ Section Impl_contract_ref_FlipperRef_t. *) Parameter env : (ref Self) -> M contract_ref.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(init_value: bool) -> Self { @@ -148,9 +135,7 @@ Section Impl_contract_ref_FlipperRef_t. *) Parameter new : bool.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -159,10 +144,7 @@ Section Impl_contract_ref_FlipperRef_t. *) Parameter new_default : M Self. - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn try_new(succeed: bool) -> Result { @@ -176,10 +158,7 @@ Section Impl_contract_ref_FlipperRef_t. Parameter try_new : bool.t -> M (core.result.Result.t Self contract_ref.FlipperError.t). - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn flip(&mut self) { @@ -188,10 +167,7 @@ Section Impl_contract_ref_FlipperRef_t. *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -200,9 +176,7 @@ Section Impl_contract_ref_FlipperRef_t. *) Parameter get : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_contract_ref_FlipperRef_t. End Impl_contract_ref_FlipperRef_t. @@ -237,9 +211,7 @@ Section Impl_contract_ref_ContractRef_t. *) Parameter new : u32.t -> ltac:(contract_ref.Hash) -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn try_new(version: u32, flipper_code_hash: Hash, succeed: bool) -> Self { @@ -261,10 +233,7 @@ Section Impl_contract_ref_ContractRef_t. *) Parameter try_new : u32.t -> ltac:(contract_ref.Hash) -> bool.t -> M Self. - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn flip(&mut self) { @@ -273,10 +242,7 @@ Section Impl_contract_ref_ContractRef_t. *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&mut self) -> bool { @@ -285,8 +251,6 @@ Section Impl_contract_ref_ContractRef_t. *) Parameter get : (mut_ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_contract_ref_ContractRef_t. End Impl_contract_ref_ContractRef_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v index afc715e00..f0c4de7d4 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v @@ -28,9 +28,7 @@ Section Impl_core_fmt_Debug_for_integration_flipper_FlipperError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -49,9 +47,7 @@ Section Impl_integration_flipper_Flipper_t. *) Parameter new : bool.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -60,10 +56,7 @@ Section Impl_integration_flipper_Flipper_t. *) Parameter new_default : M Self. - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn try_new(succeed: bool) -> Result { @@ -78,10 +71,7 @@ Section Impl_integration_flipper_Flipper_t. bool.t -> M (core.result.Result.t Self integration_flipper.FlipperError.t). - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn flip(&mut self) { @@ -90,10 +80,7 @@ Section Impl_integration_flipper_Flipper_t. *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -102,9 +89,7 @@ Section Impl_integration_flipper_Flipper_t. *) Parameter get : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* pub fn err_flip(&mut self) -> Result<(), ()> { @@ -114,9 +99,6 @@ Section Impl_integration_flipper_Flipper_t. *) Parameter err_flip : (mut_ref Self) -> M (core.result.Result.t unit unit). - Global Instance AssociatedFunction_err_flip : - Notations.DoubleColon Self "err_flip" := { - Notations.double_colon := err_flip; - }. + Axiom err_flip_is_impl : impl Self "err_flip" = err_flip. End Impl_integration_flipper_Flipper_t. End Impl_integration_flipper_Flipper_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/mapping_integration_tests.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/mapping_integration_tests.v index f00d2f216..71f35ddd0 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/mapping_integration_tests.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/mapping_integration_tests.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_mapping_integration_tests_Mapping_t_K_V. *) Parameter default : M (mapping_integration_tests.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,10 +53,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. *) Parameter contains : (ref Self) -> (ref K) -> M bool.t. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -68,9 +62,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -79,10 +71,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn new() -> Mapping { @@ -91,9 +80,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. *) Parameter new : M (mapping_integration_tests.Mapping.t K V). - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn remove(&self, _key: K) { @@ -102,10 +89,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. *) Parameter remove : (ref Self) -> K -> M unit. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -114,10 +98,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. *) Parameter size : (ref Self) -> K -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -126,10 +107,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. *) Parameter take : (ref Self) -> K -> M (core.option.Option.t V). - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_mapping_integration_tests_Mapping_t_K_V. End Impl_mapping_integration_tests_Mapping_t_K_V. @@ -153,10 +131,7 @@ Section Impl_core_default_Default_for_mapping_integration_tests_AccountId_t. *) Parameter default : M mapping_integration_tests.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -173,10 +148,7 @@ Section Impl_core_clone_Clone_for_mapping_integration_tests_AccountId_t. *) Parameter clone : (ref Self) -> M mapping_integration_tests.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -218,10 +190,7 @@ Section Impl_mapping_integration_tests_Env_t. *) Parameter caller : (ref Self) -> M mapping_integration_tests.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. End Impl_mapping_integration_tests_Env_t. End Impl_mapping_integration_tests_Env_t. @@ -250,10 +219,7 @@ Section Impl_core_default_Default_for_mapping_integration_tests_Mappings_t. *) Parameter default : M mapping_integration_tests.Mappings.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -272,10 +238,7 @@ Section Impl_mapping_integration_tests_Mappings_t. *) Parameter init_env : M mapping_integration_tests.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env() -> Env { @@ -284,9 +247,7 @@ Section Impl_mapping_integration_tests_Mappings_t. *) Parameter env : M mapping_integration_tests.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -296,9 +257,7 @@ Section Impl_mapping_integration_tests_Mappings_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn get_balance(&self) -> Option { @@ -310,10 +269,7 @@ Section Impl_mapping_integration_tests_Mappings_t. (ref Self) -> M (core.option.Option.t ltac:(mapping_integration_tests.Balance)). - Global Instance AssociatedFunction_get_balance : - Notations.DoubleColon Self "get_balance" := { - Notations.double_colon := get_balance; - }. + Axiom get_balance_is_impl : impl Self "get_balance" = get_balance. (* pub fn insert_balance(&mut self, value: Balance) -> Option { @@ -326,10 +282,7 @@ Section Impl_mapping_integration_tests_Mappings_t. ltac:(mapping_integration_tests.Balance) -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_insert_balance : - Notations.DoubleColon Self "insert_balance" := { - Notations.double_colon := insert_balance; - }. + Axiom insert_balance_is_impl : impl Self "insert_balance" = insert_balance. (* pub fn size_balance(&mut self) -> Option { @@ -339,10 +292,7 @@ Section Impl_mapping_integration_tests_Mappings_t. *) Parameter size_balance : (mut_ref Self) -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_size_balance : - Notations.DoubleColon Self "size_balance" := { - Notations.double_colon := size_balance; - }. + Axiom size_balance_is_impl : impl Self "size_balance" = size_balance. (* pub fn contains_balance(&self) -> bool { @@ -352,10 +302,8 @@ Section Impl_mapping_integration_tests_Mappings_t. *) Parameter contains_balance : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_contains_balance : - Notations.DoubleColon Self "contains_balance" := { - Notations.double_colon := contains_balance; - }. + Axiom contains_balance_is_impl : + impl Self "contains_balance" = contains_balance. (* pub fn remove_balance(&mut self) { @@ -365,10 +313,7 @@ Section Impl_mapping_integration_tests_Mappings_t. *) Parameter remove_balance : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_remove_balance : - Notations.DoubleColon Self "remove_balance" := { - Notations.double_colon := remove_balance; - }. + Axiom remove_balance_is_impl : impl Self "remove_balance" = remove_balance. (* pub fn take_balance(&mut self) -> Option { @@ -380,9 +325,6 @@ Section Impl_mapping_integration_tests_Mappings_t. (mut_ref Self) -> M (core.option.Option.t ltac:(mapping_integration_tests.Balance)). - Global Instance AssociatedFunction_take_balance : - Notations.DoubleColon Self "take_balance" := { - Notations.double_colon := take_balance; - }. + Axiom take_balance_is_impl : impl Self "take_balance" = take_balance. End Impl_mapping_integration_tests_Mappings_t. End Impl_mapping_integration_tests_Mappings_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v index 798a4e75c..e050e963d 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_mother_Mapping_t_K_V. *) Parameter default : M (mother.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,9 +53,7 @@ Section Impl_mother_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) { @@ -67,10 +62,7 @@ Section Impl_mother_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M unit. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. End Impl_mother_Mapping_t_K_V. End Impl_mother_Mapping_t_K_V. @@ -94,10 +86,7 @@ Section Impl_core_default_Default_for_mother_AccountId_t. *) Parameter default : M mother.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -114,10 +103,7 @@ Section Impl_core_clone_Clone_for_mother_AccountId_t. *) Parameter clone : (ref Self) -> M mother.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -153,9 +139,7 @@ Section Impl_core_cmp_PartialEq_for_mother_AccountId_t. *) Parameter eq : (ref Self) -> (ref mother.AccountId.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -184,10 +168,8 @@ Section Impl_core_cmp_Eq_for_mother_AccountId_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -238,10 +220,7 @@ Section Impl_core_default_Default_for_mother_Bids_t. *) Parameter default : M mother.Bids.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -267,9 +246,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Bids_t. *) Parameter eq : (ref Self) -> (ref mother.Bids.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -298,10 +275,8 @@ Section Impl_core_cmp_Eq_for_mother_Bids_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -319,10 +294,7 @@ Section Impl_core_clone_Clone_for_mother_Bids_t. *) Parameter clone : (ref Self) -> M mother.Bids.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -356,9 +328,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Outline_t. *) Parameter eq : (ref Self) -> (ref mother.Outline.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -387,10 +357,8 @@ Section Impl_core_cmp_Eq_for_mother_Outline_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -408,10 +376,7 @@ Section Impl_core_clone_Clone_for_mother_Outline_t. *) Parameter clone : (ref Self) -> M mother.Outline.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -463,9 +428,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Status_t. *) Parameter eq : (ref Self) -> (ref mother.Status.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -494,10 +457,8 @@ Section Impl_core_cmp_Eq_for_mother_Status_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -515,10 +476,7 @@ Section Impl_core_clone_Clone_for_mother_Status_t. *) Parameter clone : (ref Self) -> M mother.Status.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -578,9 +536,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Auction_t. *) Parameter eq : (ref Self) -> (ref mother.Auction.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -609,10 +565,8 @@ Section Impl_core_cmp_Eq_for_mother_Auction_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -630,10 +584,7 @@ Section Impl_core_clone_Clone_for_mother_Auction_t. *) Parameter clone : (ref Self) -> M mother.Auction.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -661,10 +612,7 @@ Section Impl_core_default_Default_for_mother_Auction_t. *) Parameter default : M mother.Auction.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -701,9 +649,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Failure_t. *) Parameter eq : (ref Self) -> (ref mother.Failure.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -732,10 +678,8 @@ Section Impl_core_cmp_Eq_for_mother_Failure_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -778,10 +722,7 @@ Section Impl_mother_Env_t. *) Parameter caller : (ref Self) -> M mother.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -790,10 +731,7 @@ Section Impl_mother_Env_t. *) Parameter emit_event : (ref Self) -> mother.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_mother_Env_t. End Impl_mother_Env_t. @@ -824,10 +762,7 @@ Section Impl_core_default_Default_for_mother_Mother_t. *) Parameter default : M mother.Mother.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -846,10 +781,7 @@ Section Impl_mother_Mother_t. *) Parameter init_env : M mother.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -858,9 +790,7 @@ Section Impl_mother_Mother_t. *) Parameter env : (ref Self) -> M mother.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(auction: Auction) -> Self { @@ -872,9 +802,7 @@ Section Impl_mother_Mother_t. *) Parameter new : mother.Auction.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -883,10 +811,7 @@ Section Impl_mother_Mother_t. *) Parameter new_default : M Self. - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn failed_new(fail: bool) -> Result { @@ -900,10 +825,7 @@ Section Impl_mother_Mother_t. Parameter failed_new : bool.t -> M (core.result.Result.t Self mother.Failure.t). - Global Instance AssociatedFunction_failed_new : - Notations.DoubleColon Self "failed_new" := { - Notations.double_colon := failed_new; - }. + Axiom failed_new_is_impl : impl Self "failed_new" = failed_new. (* pub fn echo_auction(&mut self, auction: Auction) -> Auction { @@ -916,10 +838,7 @@ Section Impl_mother_Mother_t. Parameter echo_auction : (mut_ref Self) -> mother.Auction.t -> M mother.Auction.t. - Global Instance AssociatedFunction_echo_auction : - Notations.DoubleColon Self "echo_auction" := { - Notations.double_colon := echo_auction; - }. + Axiom echo_auction_is_impl : impl Self "echo_auction" = echo_auction. (* pub fn revert_or_trap(&mut self, fail: Option) -> Result<(), Failure> { @@ -939,10 +858,7 @@ Section Impl_mother_Mother_t. (core.option.Option.t mother.Failure.t) -> M (core.result.Result.t unit mother.Failure.t). - Global Instance AssociatedFunction_revert_or_trap : - Notations.DoubleColon Self "revert_or_trap" := { - Notations.double_colon := revert_or_trap; - }. + Axiom revert_or_trap_is_impl : impl Self "revert_or_trap" = revert_or_trap. (* pub fn debug_log(&mut self, _message: String) { @@ -951,9 +867,6 @@ Section Impl_mother_Mother_t. *) Parameter debug_log : (mut_ref Self) -> alloc.string.String.t -> M unit. - Global Instance AssociatedFunction_debug_log : - Notations.DoubleColon Self "debug_log" := { - Notations.double_colon := debug_log; - }. + Axiom debug_log_is_impl : impl Self "debug_log" = debug_log. End Impl_mother_Mother_t. End Impl_mother_Mother_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v index 8d28a4825..45b34091e 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_multisig_Mapping_t_K_V. *) Parameter default : M (multisig.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,10 +53,7 @@ Section Impl_multisig_Mapping_t_K_V. *) Parameter contains : (ref Self) -> (ref K) -> M bool.t. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -68,9 +62,7 @@ Section Impl_multisig_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -79,10 +71,7 @@ Section Impl_multisig_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn remove(&self, _key: K) { @@ -91,10 +80,7 @@ Section Impl_multisig_Mapping_t_K_V. *) Parameter remove : (ref Self) -> K -> M unit. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -103,10 +89,7 @@ Section Impl_multisig_Mapping_t_K_V. *) Parameter size : (ref Self) -> K -> M (core.option.Option.t u32.t). - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -115,10 +98,7 @@ Section Impl_multisig_Mapping_t_K_V. *) Parameter take : (ref Self) -> K -> M (core.option.Option.t V). - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_multisig_Mapping_t_K_V. End Impl_multisig_Mapping_t_K_V. @@ -142,10 +122,7 @@ Section Impl_core_default_Default_for_multisig_AccountId_t. *) Parameter default : M multisig.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -163,9 +140,7 @@ Section Impl_core_fmt_Debug_for_multisig_AccountId_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -182,10 +157,7 @@ Section Impl_core_clone_Clone_for_multisig_AccountId_t. *) Parameter clone : (ref Self) -> M multisig.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -221,9 +193,7 @@ Section Impl_core_cmp_PartialEq_for_multisig_AccountId_t. *) Parameter eq : (ref Self) -> (ref multisig.AccountId.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -252,10 +222,8 @@ Section Impl_core_cmp_Eq_for_multisig_AccountId_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -276,10 +244,7 @@ Section Impl_core_cmp_PartialOrd_for_multisig_AccountId_t. (ref multisig.AccountId.t) -> M (core.option.Option.t core.cmp.Ordering.t). - Global Instance AssociatedFunction_partial_cmp : - Notations.DoubleColon Self "partial_cmp" := { - Notations.double_colon := partial_cmp; - }. + Axiom partial_cmp_is_impl : impl Self "partial_cmp" = partial_cmp. Global Instance ℐ : core.cmp.PartialOrd.Required.Trait Self @@ -303,9 +268,7 @@ Section Impl_core_cmp_Ord_for_multisig_AccountId_t. Parameter cmp : (ref Self) -> (ref multisig.AccountId.t) -> M core.cmp.Ordering.t. - Global Instance AssociatedFunction_cmp : Notations.DoubleColon Self "cmp" := { - Notations.double_colon := cmp; - }. + Axiom cmp_is_impl : impl Self "cmp" = cmp. Global Instance ℐ : core.cmp.Ord.Required.Trait Self := { core.cmp.Ord.cmp := cmp; @@ -371,10 +334,7 @@ Section Impl_core_clone_Clone_for_multisig_ConfirmationStatus_t. *) Parameter clone : (ref Self) -> M multisig.ConfirmationStatus.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -435,10 +395,7 @@ Section Impl_core_default_Default_for_multisig_Transaction_t. *) Parameter default : M multisig.Transaction.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -460,10 +417,7 @@ Section Impl_core_clone_Clone_for_multisig_Error_t. *) Parameter clone : (ref Self) -> M multisig.Error.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -499,9 +453,7 @@ Section Impl_core_cmp_PartialEq_for_multisig_Error_t. *) Parameter eq : (ref Self) -> (ref multisig.Error.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -530,10 +482,8 @@ Section Impl_core_cmp_Eq_for_multisig_Error_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -570,10 +520,7 @@ Section Impl_core_default_Default_for_multisig_Transactions_t. *) Parameter default : M multisig.Transactions.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -773,10 +720,7 @@ Section Impl_multisig_Env_t. *) Parameter caller : (ref Self) -> M multisig.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -785,10 +729,7 @@ Section Impl_multisig_Env_t. *) Parameter emit_event : (ref Self) -> multisig.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. (* fn transferred_value(&self) -> Balance { @@ -797,10 +738,8 @@ Section Impl_multisig_Env_t. *) Parameter transferred_value : (ref Self) -> M ltac:(multisig.Balance). - Global Instance AssociatedFunction_transferred_value : - Notations.DoubleColon Self "transferred_value" := { - Notations.double_colon := transferred_value; - }. + Axiom transferred_value_is_impl : + impl Self "transferred_value" = transferred_value. (* fn account_id(&self) -> AccountId { @@ -809,10 +748,7 @@ Section Impl_multisig_Env_t. *) Parameter account_id : (ref Self) -> M multisig.AccountId.t. - Global Instance AssociatedFunction_account_id : - Notations.DoubleColon Self "account_id" := { - Notations.double_colon := account_id; - }. + Axiom account_id_is_impl : impl Self "account_id" = account_id. End Impl_multisig_Env_t. End Impl_multisig_Env_t. @@ -870,10 +806,7 @@ Section Impl_core_default_Default_for_multisig_Multisig_t. *) Parameter default : M multisig.Multisig.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -899,10 +832,7 @@ Section Impl_multisig_Multisig_t. *) Parameter init_env : M multisig.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -911,9 +841,7 @@ Section Impl_multisig_Multisig_t. *) Parameter env : (ref Self) -> M multisig.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(requirement: u32, mut owners: Vec) -> Self { @@ -937,9 +865,7 @@ Section Impl_multisig_Multisig_t. (alloc.vec.Vec.t multisig.AccountId.t alloc.vec.Vec.Default.A) -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn ensure_confirmed(&self, trans_id: TransactionId) { @@ -954,10 +880,8 @@ Section Impl_multisig_Multisig_t. Parameter ensure_confirmed : (ref Self) -> ltac:(multisig.TransactionId) -> M unit. - Global Instance AssociatedFunction_ensure_confirmed : - Notations.DoubleColon Self "ensure_confirmed" := { - Notations.double_colon := ensure_confirmed; - }. + Axiom ensure_confirmed_is_impl : + impl Self "ensure_confirmed" = ensure_confirmed. (* fn ensure_transaction_exists(&self, trans_id: TransactionId) { @@ -969,10 +893,8 @@ Section Impl_multisig_Multisig_t. Parameter ensure_transaction_exists : (ref Self) -> ltac:(multisig.TransactionId) -> M unit. - Global Instance AssociatedFunction_ensure_transaction_exists : - Notations.DoubleColon Self "ensure_transaction_exists" := { - Notations.double_colon := ensure_transaction_exists; - }. + Axiom ensure_transaction_exists_is_impl : + impl Self "ensure_transaction_exists" = ensure_transaction_exists. (* fn ensure_owner(&self, owner: &AccountId) { @@ -981,10 +903,7 @@ Section Impl_multisig_Multisig_t. *) Parameter ensure_owner : (ref Self) -> (ref multisig.AccountId.t) -> M unit. - Global Instance AssociatedFunction_ensure_owner : - Notations.DoubleColon Self "ensure_owner" := { - Notations.double_colon := ensure_owner; - }. + Axiom ensure_owner_is_impl : impl Self "ensure_owner" = ensure_owner. (* fn ensure_caller_is_owner(&self) { @@ -993,10 +912,8 @@ Section Impl_multisig_Multisig_t. *) Parameter ensure_caller_is_owner : (ref Self) -> M unit. - Global Instance AssociatedFunction_ensure_caller_is_owner : - Notations.DoubleColon Self "ensure_caller_is_owner" := { - Notations.double_colon := ensure_caller_is_owner; - }. + Axiom ensure_caller_is_owner_is_impl : + impl Self "ensure_caller_is_owner" = ensure_caller_is_owner. (* fn ensure_from_wallet(&self) { @@ -1005,10 +922,8 @@ Section Impl_multisig_Multisig_t. *) Parameter ensure_from_wallet : (ref Self) -> M unit. - Global Instance AssociatedFunction_ensure_from_wallet : - Notations.DoubleColon Self "ensure_from_wallet" := { - Notations.double_colon := ensure_from_wallet; - }. + Axiom ensure_from_wallet_is_impl : + impl Self "ensure_from_wallet" = ensure_from_wallet. (* fn ensure_no_owner(&self, owner: &AccountId) { @@ -1018,10 +933,7 @@ Section Impl_multisig_Multisig_t. Parameter ensure_no_owner : (ref Self) -> (ref multisig.AccountId.t) -> M unit. - Global Instance AssociatedFunction_ensure_no_owner : - Notations.DoubleColon Self "ensure_no_owner" := { - Notations.double_colon := ensure_no_owner; - }. + Axiom ensure_no_owner_is_impl : impl Self "ensure_no_owner" = ensure_no_owner. (* pub fn add_owner(&mut self, new_owner: AccountId) { @@ -1036,10 +948,7 @@ Section Impl_multisig_Multisig_t. *) Parameter add_owner : (mut_ref Self) -> multisig.AccountId.t -> M unit. - Global Instance AssociatedFunction_add_owner : - Notations.DoubleColon Self "add_owner" := { - Notations.double_colon := add_owner; - }. + Axiom add_owner_is_impl : impl Self "add_owner" = add_owner. (* fn owner_index(&self, owner: &AccountId) -> u32 { @@ -1051,10 +960,7 @@ Section Impl_multisig_Multisig_t. *) Parameter owner_index : (ref Self) -> (ref multisig.AccountId.t) -> M u32.t. - Global Instance AssociatedFunction_owner_index : - Notations.DoubleColon Self "owner_index" := { - Notations.double_colon := owner_index; - }. + Axiom owner_index_is_impl : impl Self "owner_index" = owner_index. (* fn clean_owner_confirmations(&mut self, owner: &AccountId) { @@ -1072,10 +978,8 @@ Section Impl_multisig_Multisig_t. Parameter clean_owner_confirmations : (mut_ref Self) -> (ref multisig.AccountId.t) -> M unit. - Global Instance AssociatedFunction_clean_owner_confirmations : - Notations.DoubleColon Self "clean_owner_confirmations" := { - Notations.double_colon := clean_owner_confirmations; - }. + Axiom clean_owner_confirmations_is_impl : + impl Self "clean_owner_confirmations" = clean_owner_confirmations. (* pub fn remove_owner(&mut self, owner: AccountId) { @@ -1095,10 +999,7 @@ Section Impl_multisig_Multisig_t. *) Parameter remove_owner : (mut_ref Self) -> multisig.AccountId.t -> M unit. - Global Instance AssociatedFunction_remove_owner : - Notations.DoubleColon Self "remove_owner" := { - Notations.double_colon := remove_owner; - }. + Axiom remove_owner_is_impl : impl Self "remove_owner" = remove_owner. (* pub fn replace_owner(&mut self, old_owner: AccountId, new_owner: AccountId) { @@ -1119,10 +1020,7 @@ Section Impl_multisig_Multisig_t. Parameter replace_owner : (mut_ref Self) -> multisig.AccountId.t -> multisig.AccountId.t -> M unit. - Global Instance AssociatedFunction_replace_owner : - Notations.DoubleColon Self "replace_owner" := { - Notations.double_colon := replace_owner; - }. + Axiom replace_owner_is_impl : impl Self "replace_owner" = replace_owner. (* pub fn change_requirement(&mut self, new_requirement: u32) { @@ -1137,10 +1035,8 @@ Section Impl_multisig_Multisig_t. *) Parameter change_requirement : (mut_ref Self) -> u32.t -> M unit. - Global Instance AssociatedFunction_change_requirement : - Notations.DoubleColon Self "change_requirement" := { - Notations.double_colon := change_requirement; - }. + Axiom change_requirement_is_impl : + impl Self "change_requirement" = change_requirement. (* fn confirm_by_caller( @@ -1182,10 +1078,8 @@ Section Impl_multisig_Multisig_t. ltac:(multisig.TransactionId) -> M multisig.ConfirmationStatus.t. - Global Instance AssociatedFunction_confirm_by_caller : - Notations.DoubleColon Self "confirm_by_caller" := { - Notations.double_colon := confirm_by_caller; - }. + Axiom confirm_by_caller_is_impl : + impl Self "confirm_by_caller" = confirm_by_caller. (* pub fn submit_transaction( @@ -1213,10 +1107,8 @@ Section Impl_multisig_Multisig_t. multisig.Transaction.t -> M (ltac:(multisig.TransactionId) * multisig.ConfirmationStatus.t). - Global Instance AssociatedFunction_submit_transaction : - Notations.DoubleColon Self "submit_transaction" := { - Notations.double_colon := submit_transaction; - }. + Axiom submit_transaction_is_impl : + impl Self "submit_transaction" = submit_transaction. (* fn take_transaction(&mut self, trans_id: TransactionId) -> Option { @@ -1243,10 +1135,8 @@ Section Impl_multisig_Multisig_t. ltac:(multisig.TransactionId) -> M (core.option.Option.t multisig.Transaction.t). - Global Instance AssociatedFunction_take_transaction : - Notations.DoubleColon Self "take_transaction" := { - Notations.double_colon := take_transaction; - }. + Axiom take_transaction_is_impl : + impl Self "take_transaction" = take_transaction. (* pub fn cancel_transaction(&mut self, trans_id: TransactionId) { @@ -1261,10 +1151,8 @@ Section Impl_multisig_Multisig_t. Parameter cancel_transaction : (mut_ref Self) -> ltac:(multisig.TransactionId) -> M unit. - Global Instance AssociatedFunction_cancel_transaction : - Notations.DoubleColon Self "cancel_transaction" := { - Notations.double_colon := cancel_transaction; - }. + Axiom cancel_transaction_is_impl : + impl Self "cancel_transaction" = cancel_transaction. (* pub fn confirm_transaction(&mut self, trans_id: TransactionId) -> ConfirmationStatus { @@ -1278,10 +1166,8 @@ Section Impl_multisig_Multisig_t. ltac:(multisig.TransactionId) -> M multisig.ConfirmationStatus.t. - Global Instance AssociatedFunction_confirm_transaction : - Notations.DoubleColon Self "confirm_transaction" := { - Notations.double_colon := confirm_transaction; - }. + Axiom confirm_transaction_is_impl : + impl Self "confirm_transaction" = confirm_transaction. (* pub fn revoke_confirmation(&mut self, trans_id: TransactionId) { @@ -1306,10 +1192,8 @@ Section Impl_multisig_Multisig_t. Parameter revoke_confirmation : (mut_ref Self) -> ltac:(multisig.TransactionId) -> M unit. - Global Instance AssociatedFunction_revoke_confirmation : - Notations.DoubleColon Self "revoke_confirmation" := { - Notations.double_colon := revoke_confirmation; - }. + Axiom revoke_confirmation_is_impl : + impl Self "revoke_confirmation" = revoke_confirmation. (* pub fn invoke_transaction(&mut self, trans_id: TransactionId) -> Result<(), Error> { @@ -1343,10 +1227,8 @@ Section Impl_multisig_Multisig_t. ltac:(multisig.TransactionId) -> M (core.result.Result.t unit multisig.Error.t). - Global Instance AssociatedFunction_invoke_transaction : - Notations.DoubleColon Self "invoke_transaction" := { - Notations.double_colon := invoke_transaction; - }. + Axiom invoke_transaction_is_impl : + impl Self "invoke_transaction" = invoke_transaction. (* pub fn eval_transaction(&mut self, trans_id: TransactionId) -> Result, Error> { @@ -1382,9 +1264,7 @@ Section Impl_multisig_Multisig_t. (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A) multisig.Error.t). - Global Instance AssociatedFunction_eval_transaction : - Notations.DoubleColon Self "eval_transaction" := { - Notations.double_colon := eval_transaction; - }. + Axiom eval_transaction_is_impl : + impl Self "eval_transaction" = eval_transaction. End Impl_multisig_Multisig_t. End Impl_multisig_Multisig_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v index a3a0af255..6b127cbc6 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_payment_channel_AccountId_t. *) Parameter default : M payment_channel.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_payment_channel_AccountId_t. *) Parameter clone : (ref Self) -> M payment_channel.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -80,9 +74,7 @@ Section Impl_core_cmp_PartialEq_for_payment_channel_AccountId_t. *) Parameter eq : (ref Self) -> (ref payment_channel.AccountId.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -111,10 +103,8 @@ Section Impl_core_cmp_Eq_for_payment_channel_AccountId_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -134,10 +124,7 @@ Section Impl_core_convert_From_array_u8_t_for_payment_channel_AccountId_t. *) Parameter from : (array u8.t) -> M Self. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -219,9 +206,7 @@ Section Impl_core_cmp_PartialEq_for_payment_channel_Error_t. *) Parameter eq : (ref Self) -> (ref payment_channel.Error.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -250,10 +235,8 @@ Section Impl_core_cmp_Eq_for_payment_channel_Error_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -304,10 +287,7 @@ Section Impl_payment_channel_Env_t. *) Parameter caller : (ref Self) -> M payment_channel.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -316,10 +296,7 @@ Section Impl_payment_channel_Env_t. *) Parameter emit_event : (ref Self) -> payment_channel.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. (* fn terminate_contract(&self, sender: AccountId) { @@ -329,10 +306,8 @@ Section Impl_payment_channel_Env_t. Parameter terminate_contract : (ref Self) -> payment_channel.AccountId.t -> M unit. - Global Instance AssociatedFunction_terminate_contract : - Notations.DoubleColon Self "terminate_contract" := { - Notations.double_colon := terminate_contract; - }. + Axiom terminate_contract_is_impl : + impl Self "terminate_contract" = terminate_contract. (* fn transfer(&self, recipient: AccountId, amount: Balance) -> Result<()> { @@ -345,10 +320,7 @@ Section Impl_payment_channel_Env_t. ltac:(payment_channel.Balance) -> M ltac:(payment_channel.Result unit). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn block_timestamp(&self) -> Timestamp { @@ -357,10 +329,7 @@ Section Impl_payment_channel_Env_t. *) Parameter block_timestamp : (ref Self) -> M ltac:(payment_channel.Timestamp). - Global Instance AssociatedFunction_block_timestamp : - Notations.DoubleColon Self "block_timestamp" := { - Notations.double_colon := block_timestamp; - }. + Axiom block_timestamp_is_impl : impl Self "block_timestamp" = block_timestamp. (* fn balance(&self) -> Balance { @@ -369,10 +338,7 @@ Section Impl_payment_channel_Env_t. *) Parameter balance : (ref Self) -> M ltac:(payment_channel.Balance). - Global Instance AssociatedFunction_balance : - Notations.DoubleColon Self "balance" := { - Notations.double_colon := balance; - }. + Axiom balance_is_impl : impl Self "balance" = balance. (* fn account_id(&self) -> AccountId { @@ -381,10 +347,7 @@ Section Impl_payment_channel_Env_t. *) Parameter account_id : (ref Self) -> M payment_channel.AccountId.t. - Global Instance AssociatedFunction_account_id : - Notations.DoubleColon Self "account_id" := { - Notations.double_colon := account_id; - }. + Axiom account_id_is_impl : impl Self "account_id" = account_id. End Impl_payment_channel_Env_t. End Impl_payment_channel_Env_t. @@ -550,10 +513,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Sha2x256_t. -> M unit. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -579,10 +539,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Keccak256_t. -> M unit. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -608,10 +565,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Blake2x256_t. -> M unit. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -637,10 +591,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Blake2x128_t. -> M unit. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -659,10 +610,7 @@ Section Impl_payment_channel_PaymentChannel_t. *) Parameter init_env : M payment_channel.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -671,9 +619,7 @@ Section Impl_payment_channel_PaymentChannel_t. *) Parameter env : (ref Self) -> M payment_channel.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* fn is_signature_valid(&self, amount: Balance, signature: [u8; 65]) -> bool { @@ -693,10 +639,8 @@ Section Impl_payment_channel_PaymentChannel_t. Parameter is_signature_valid : (ref Self) -> ltac:(payment_channel.Balance) -> (array u8.t) -> M bool.t. - Global Instance AssociatedFunction_is_signature_valid : - Notations.DoubleColon Self "is_signature_valid" := { - Notations.double_colon := is_signature_valid; - }. + Axiom is_signature_valid_is_impl : + impl Self "is_signature_valid" = is_signature_valid. (* pub fn new(recipient: AccountId, close_duration: Timestamp) -> Self { @@ -712,9 +656,7 @@ Section Impl_payment_channel_PaymentChannel_t. Parameter new : payment_channel.AccountId.t -> ltac:(payment_channel.Timestamp) -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn close_inner(&mut self, amount: Balance, signature: [u8; 65]) -> Result<()> { @@ -744,10 +686,7 @@ Section Impl_payment_channel_PaymentChannel_t. (array u8.t) -> M ltac:(payment_channel.Result unit). - Global Instance AssociatedFunction_close_inner : - Notations.DoubleColon Self "close_inner" := { - Notations.double_colon := close_inner; - }. + Axiom close_inner_is_impl : impl Self "close_inner" = close_inner. (* pub fn close(&mut self, amount: Balance, signature: [u8; 65]) -> Result<()> { @@ -763,10 +702,7 @@ Section Impl_payment_channel_PaymentChannel_t. (array u8.t) -> M ltac:(payment_channel.Result unit). - Global Instance AssociatedFunction_close : - Notations.DoubleColon Self "close" := { - Notations.double_colon := close; - }. + Axiom close_is_impl : impl Self "close" = close. (* pub fn start_sender_close(&mut self) -> Result<()> { @@ -791,10 +727,8 @@ Section Impl_payment_channel_PaymentChannel_t. Parameter start_sender_close : (mut_ref Self) -> M ltac:(payment_channel.Result unit). - Global Instance AssociatedFunction_start_sender_close : - Notations.DoubleColon Self "start_sender_close" := { - Notations.double_colon := start_sender_close; - }. + Axiom start_sender_close_is_impl : + impl Self "start_sender_close" = start_sender_close. (* pub fn claim_timeout(&mut self) -> Result<()> { @@ -819,10 +753,7 @@ Section Impl_payment_channel_PaymentChannel_t. Parameter claim_timeout : (mut_ref Self) -> M ltac:(payment_channel.Result unit). - Global Instance AssociatedFunction_claim_timeout : - Notations.DoubleColon Self "claim_timeout" := { - Notations.double_colon := claim_timeout; - }. + Axiom claim_timeout_is_impl : impl Self "claim_timeout" = claim_timeout. (* pub fn withdraw(&mut self, amount: Balance, signature: [u8; 65]) -> Result<()> { @@ -856,10 +787,7 @@ Section Impl_payment_channel_PaymentChannel_t. (array u8.t) -> M ltac:(payment_channel.Result unit). - Global Instance AssociatedFunction_withdraw : - Notations.DoubleColon Self "withdraw" := { - Notations.double_colon := withdraw; - }. + Axiom withdraw_is_impl : impl Self "withdraw" = withdraw. (* pub fn get_sender(&self) -> AccountId { @@ -868,10 +796,7 @@ Section Impl_payment_channel_PaymentChannel_t. *) Parameter get_sender : (ref Self) -> M payment_channel.AccountId.t. - Global Instance AssociatedFunction_get_sender : - Notations.DoubleColon Self "get_sender" := { - Notations.double_colon := get_sender; - }. + Axiom get_sender_is_impl : impl Self "get_sender" = get_sender. (* pub fn get_recipient(&self) -> AccountId { @@ -880,10 +805,7 @@ Section Impl_payment_channel_PaymentChannel_t. *) Parameter get_recipient : (ref Self) -> M payment_channel.AccountId.t. - Global Instance AssociatedFunction_get_recipient : - Notations.DoubleColon Self "get_recipient" := { - Notations.double_colon := get_recipient; - }. + Axiom get_recipient_is_impl : impl Self "get_recipient" = get_recipient. (* pub fn get_expiration(&self) -> Option { @@ -893,10 +815,7 @@ Section Impl_payment_channel_PaymentChannel_t. Parameter get_expiration : (ref Self) -> M (core.option.Option.t ltac:(payment_channel.Timestamp)). - Global Instance AssociatedFunction_get_expiration : - Notations.DoubleColon Self "get_expiration" := { - Notations.double_colon := get_expiration; - }. + Axiom get_expiration_is_impl : impl Self "get_expiration" = get_expiration. (* pub fn get_withdrawn(&self) -> Balance { @@ -905,10 +824,7 @@ Section Impl_payment_channel_PaymentChannel_t. *) Parameter get_withdrawn : (ref Self) -> M ltac:(payment_channel.Balance). - Global Instance AssociatedFunction_get_withdrawn : - Notations.DoubleColon Self "get_withdrawn" := { - Notations.double_colon := get_withdrawn; - }. + Axiom get_withdrawn_is_impl : impl Self "get_withdrawn" = get_withdrawn. (* pub fn get_close_duration(&self) -> Timestamp { @@ -918,10 +834,8 @@ Section Impl_payment_channel_PaymentChannel_t. Parameter get_close_duration : (ref Self) -> M ltac:(payment_channel.Timestamp). - Global Instance AssociatedFunction_get_close_duration : - Notations.DoubleColon Self "get_close_duration" := { - Notations.double_colon := get_close_duration; - }. + Axiom get_close_duration_is_impl : + impl Self "get_close_duration" = get_close_duration. (* pub fn get_balance(&self) -> Balance { @@ -930,9 +844,6 @@ Section Impl_payment_channel_PaymentChannel_t. *) Parameter get_balance : (ref Self) -> M ltac:(payment_channel.Balance). - Global Instance AssociatedFunction_get_balance : - Notations.DoubleColon Self "get_balance" := { - Notations.double_colon := get_balance; - }. + Axiom get_balance_is_impl : impl Self "get_balance" = get_balance. End Impl_payment_channel_PaymentChannel_t. End Impl_payment_channel_PaymentChannel_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash.v index 284d0a52c..8c953e74f 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash.v @@ -35,10 +35,7 @@ Section Impl_core_default_Default_for_set_code_hash_Incrementer_t. *) Parameter default : M set_code_hash.Incrementer.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -57,9 +54,7 @@ Section Impl_set_code_hash_Incrementer_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn inc(&mut self) { @@ -72,9 +67,7 @@ Section Impl_set_code_hash_Incrementer_t. *) Parameter inc : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* pub fn get(&self) -> u32 { @@ -83,9 +76,7 @@ Section Impl_set_code_hash_Incrementer_t. *) Parameter get : (ref Self) -> M u32.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* pub fn set_code(&mut self, code_hash: [u8; 32]) { @@ -97,9 +88,6 @@ Section Impl_set_code_hash_Incrementer_t. *) Parameter set_code : (mut_ref Self) -> (array u8.t) -> M unit. - Global Instance AssociatedFunction_set_code : - Notations.DoubleColon Self "set_code" := { - Notations.double_colon := set_code; - }. + Axiom set_code_is_impl : impl Self "set_code" = set_code. End Impl_set_code_hash_Incrementer_t. End Impl_set_code_hash_Incrementer_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash/updated_incrementer.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash/updated_incrementer.v index a357cc7da..05574db3a 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash/updated_incrementer.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash/updated_incrementer.v @@ -21,10 +21,7 @@ Section Impl_core_default_Default_for_updated_incrementer_AccountId_t. *) Parameter default : M updated_incrementer.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -41,10 +38,7 @@ Section Impl_core_clone_Clone_for_updated_incrementer_AccountId_t. *) Parameter clone : (ref Self) -> M updated_incrementer.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -95,10 +89,9 @@ Section Impl_updated_incrementer_Env_t. (ref E) -> M (core.result.Result.t unit updated_incrementer.Error.t). - Global Instance AssociatedFunction_set_code_hash {E : Set} : - Notations.DoubleColon Self "set_code_hash" := { - Notations.double_colon := set_code_hash (E := E); - }. + Axiom set_code_hash_is_impl : + forall {E : Set}, + impl Self "set_code_hash" = set_code_hash (E := E). End Impl_updated_incrementer_Env_t. End Impl_updated_incrementer_Env_t. @@ -124,10 +117,7 @@ Section Impl_updated_incrementer_Incrementer_t. *) Parameter init_env : M updated_incrementer.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -136,9 +126,7 @@ Section Impl_updated_incrementer_Incrementer_t. *) Parameter env : (ref Self) -> M updated_incrementer.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -147,9 +135,7 @@ Section Impl_updated_incrementer_Incrementer_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn inc(&mut self) { @@ -162,9 +148,7 @@ Section Impl_updated_incrementer_Incrementer_t. *) Parameter inc : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* pub fn get(&self) -> u32 { @@ -173,9 +157,7 @@ Section Impl_updated_incrementer_Incrementer_t. *) Parameter get : (ref Self) -> M u32.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* pub fn set_code(&mut self, code_hash: Hash) { @@ -188,9 +170,6 @@ Section Impl_updated_incrementer_Incrementer_t. Parameter set_code : (mut_ref Self) -> ltac:(updated_incrementer.Hash) -> M unit. - Global Instance AssociatedFunction_set_code : - Notations.DoubleColon Self "set_code" := { - Notations.double_colon := set_code; - }. + Axiom set_code_is_impl : impl Self "set_code" = set_code. End Impl_updated_incrementer_Incrementer_t. End Impl_updated_incrementer_Incrementer_t. diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v index e0dac58ec..e838b1f68 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v @@ -32,10 +32,7 @@ Section Impl_core_default_Default_for_trait_erc20_Mapping_t_K_V. *) Parameter default : M (trait_erc20.Mapping.t K V). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -56,9 +53,7 @@ Section Impl_trait_erc20_Mapping_t_K_V. *) Parameter get : (ref Self) -> (ref K) -> M (core.option.Option.t V). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) { @@ -67,10 +62,7 @@ Section Impl_trait_erc20_Mapping_t_K_V. *) Parameter insert : (mut_ref Self) -> K -> V -> M unit. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. End Impl_trait_erc20_Mapping_t_K_V. End Impl_trait_erc20_Mapping_t_K_V. @@ -94,10 +86,7 @@ Section Impl_core_default_Default_for_trait_erc20_AccountId_t. *) Parameter default : M trait_erc20.AccountId.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -114,10 +103,7 @@ Section Impl_core_clone_Clone_for_trait_erc20_AccountId_t. *) Parameter clone : (ref Self) -> M trait_erc20.AccountId.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -164,9 +150,7 @@ Section Impl_core_fmt_Debug_for_trait_erc20_Error_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -192,9 +176,7 @@ Section Impl_core_cmp_PartialEq_for_trait_erc20_Error_t. *) Parameter eq : (ref Self) -> (ref trait_erc20.Error.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -223,10 +205,8 @@ Section Impl_core_cmp_Eq_for_trait_erc20_Error_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -305,10 +285,7 @@ Section Impl_core_default_Default_for_trait_erc20_Erc20_t. *) Parameter default : M trait_erc20.Erc20.t. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -381,10 +358,7 @@ Section Impl_trait_erc20_Env_t. *) Parameter caller : (ref Self) -> M trait_erc20.AccountId.t. - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -393,10 +367,7 @@ Section Impl_trait_erc20_Env_t. *) Parameter emit_event : (ref Self) -> trait_erc20.Event.t -> M unit. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_trait_erc20_Env_t. End Impl_trait_erc20_Env_t. @@ -411,10 +382,7 @@ Section Impl_trait_erc20_Erc20_t. *) Parameter init_env : M trait_erc20.Env.t. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -423,9 +391,7 @@ Section Impl_trait_erc20_Erc20_t. *) Parameter env : (ref Self) -> M trait_erc20.Env.t. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(total_supply: Balance) -> Self { @@ -446,9 +412,7 @@ Section Impl_trait_erc20_Erc20_t. *) Parameter new : ltac:(trait_erc20.Balance) -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn balance_of_impl(&self, owner: &AccountId) -> Balance { @@ -460,10 +424,7 @@ Section Impl_trait_erc20_Erc20_t. (ref trait_erc20.AccountId.t) -> M ltac:(trait_erc20.Balance). - Global Instance AssociatedFunction_balance_of_impl : - Notations.DoubleColon Self "balance_of_impl" := { - Notations.double_colon := balance_of_impl; - }. + Axiom balance_of_impl_is_impl : impl Self "balance_of_impl" = balance_of_impl. (* fn allowance_impl(&self, owner: &AccountId, spender: &AccountId) -> Balance { @@ -476,10 +437,7 @@ Section Impl_trait_erc20_Erc20_t. (ref trait_erc20.AccountId.t) -> M ltac:(trait_erc20.Balance). - Global Instance AssociatedFunction_allowance_impl : - Notations.DoubleColon Self "allowance_impl" := { - Notations.double_colon := allowance_impl; - }. + Axiom allowance_impl_is_impl : impl Self "allowance_impl" = allowance_impl. (* fn transfer_from_to(&mut self, from: &AccountId, to: &AccountId, value: Balance) -> Result<()> { @@ -506,10 +464,8 @@ Section Impl_trait_erc20_Erc20_t. ltac:(trait_erc20.Balance) -> M ltac:(trait_erc20.Result unit). - Global Instance AssociatedFunction_transfer_from_to : - Notations.DoubleColon Self "transfer_from_to" := { - Notations.double_colon := transfer_from_to; - }. + Axiom transfer_from_to_is_impl : + impl Self "transfer_from_to" = transfer_from_to. End Impl_trait_erc20_Erc20_t. End Impl_trait_erc20_Erc20_t. @@ -524,10 +480,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. *) Parameter total_supply : (ref Self) -> M ltac:(trait_erc20.Balance). - Global Instance AssociatedFunction_total_supply : - Notations.DoubleColon Self "total_supply" := { - Notations.double_colon := total_supply; - }. + Axiom total_supply_is_impl : impl Self "total_supply" = total_supply. (* fn balance_of(&self, owner: AccountId) -> Balance { @@ -537,10 +490,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. Parameter balance_of : (ref Self) -> trait_erc20.AccountId.t -> M ltac:(trait_erc20.Balance). - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* fn allowance(&self, owner: AccountId, spender: AccountId) -> Balance { @@ -553,10 +503,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. trait_erc20.AccountId.t -> M ltac:(trait_erc20.Balance). - Global Instance AssociatedFunction_allowance : - Notations.DoubleColon Self "allowance" := { - Notations.double_colon := allowance; - }. + Axiom allowance_is_impl : impl Self "allowance" = allowance. (* fn transfer(&mut self, to: AccountId, value: Balance) -> Result<()> { @@ -570,10 +517,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. ltac:(trait_erc20.Balance) -> M ltac:(trait_erc20.Result unit). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn approve(&mut self, spender: AccountId, value: Balance) -> Result<()> { @@ -593,10 +537,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. ltac:(trait_erc20.Balance) -> M ltac:(trait_erc20.Result unit). - Global Instance AssociatedFunction_approve : - Notations.DoubleColon Self "approve" := { - Notations.double_colon := approve; - }. + Axiom approve_is_impl : impl Self "approve" = approve. (* fn transfer_from(&mut self, from: AccountId, to: AccountId, value: Balance) -> Result<()> { @@ -617,10 +558,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. ltac:(trait_erc20.Balance) -> M ltac:(trait_erc20.Result unit). - Global Instance AssociatedFunction_transfer_from : - Notations.DoubleColon Self "transfer_from" := { - Notations.double_colon := transfer_from; - }. + Axiom transfer_from_is_impl : impl Self "transfer_from" = transfer_from. Global Instance ℐ : trait_erc20.BaseErc20.Trait Self := { trait_erc20.BaseErc20.total_supply := total_supply; diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v index bd658b652..9b493535f 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v @@ -35,9 +35,7 @@ Section Impl_trait_flipper_Flipper_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_trait_flipper_Flipper_t. End Impl_trait_flipper_Flipper_t. @@ -52,10 +50,7 @@ Section Impl_trait_flipper_Flip_for_trait_flipper_Flipper_t. *) Parameter flip : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* fn get(&self) -> bool { @@ -64,9 +59,7 @@ Section Impl_trait_flipper_Flip_for_trait_flipper_Flipper_t. *) Parameter get : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : trait_flipper.Flip.Trait Self := { trait_flipper.Flip.flip := flip; diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v index be26ed125..4d12c3022 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v @@ -42,9 +42,7 @@ Section Impl_trait_incrementer_Incrementer_t. *) Parameter new : u64.t -> M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn inc_by(&mut self, delta: u64) { @@ -53,10 +51,7 @@ Section Impl_trait_incrementer_Incrementer_t. *) Parameter inc_by : (mut_ref Self) -> u64.t -> M unit. - Global Instance AssociatedFunction_inc_by : - Notations.DoubleColon Self "inc_by" := { - Notations.double_colon := inc_by; - }. + Axiom inc_by_is_impl : impl Self "inc_by" = inc_by. End Impl_trait_incrementer_Incrementer_t. End Impl_trait_incrementer_Incrementer_t. @@ -71,9 +66,7 @@ Section Impl_trait_incrementer_Increment_for_trait_incrementer_Incrementer_t. *) Parameter inc : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* fn get(&self) -> u64 { @@ -82,9 +75,7 @@ Section Impl_trait_incrementer_Increment_for_trait_incrementer_Incrementer_t. *) Parameter get : (ref Self) -> M u64.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : trait_incrementer.Increment.Trait Self := { trait_incrementer.Increment.inc := inc; @@ -104,10 +95,7 @@ Section Impl_trait_incrementer_Reset_for_trait_incrementer_Incrementer_t. *) Parameter reset : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_reset : - Notations.DoubleColon Self "reset" := { - Notations.double_colon := reset; - }. + Axiom reset_is_impl : impl Self "reset" = reset. Global Instance ℐ : trait_incrementer.Reset.Trait Self := { trait_incrementer.Reset.reset := reset; diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v index fc0a8bbf7..d0cb82796 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v @@ -25,9 +25,7 @@ Section Impl_wildcard_selector_WildcardSelector_t. *) Parameter new : M Self. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn wildcard(&mut self) { @@ -37,10 +35,7 @@ Section Impl_wildcard_selector_WildcardSelector_t. *) Parameter wildcard : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_wildcard : - Notations.DoubleColon Self "wildcard" := { - Notations.double_colon := wildcard; - }. + Axiom wildcard_is_impl : impl Self "wildcard" = wildcard. (* pub fn wildcard_complement(&mut self, _message: String) { @@ -50,9 +45,7 @@ Section Impl_wildcard_selector_WildcardSelector_t. Parameter wildcard_complement : (mut_ref Self) -> alloc.string.String.t -> M unit. - Global Instance AssociatedFunction_wildcard_complement : - Notations.DoubleColon Self "wildcard_complement" := { - Notations.double_colon := wildcard_complement; - }. + Axiom wildcard_complement_is_impl : + impl Self "wildcard_complement" = wildcard_complement. End Impl_wildcard_selector_WildcardSelector_t. End Impl_wildcard_selector_WildcardSelector_t. diff --git a/CoqOfRust/examples/axiomatized/examples/modules/struct_visibility.v b/CoqOfRust/examples/axiomatized/examples/modules/struct_visibility.v index 4b3a538f8..74b228ad1 100644 --- a/CoqOfRust/examples/axiomatized/examples/modules/struct_visibility.v +++ b/CoqOfRust/examples/axiomatized/examples/modules/struct_visibility.v @@ -45,10 +45,7 @@ Module my. *) Parameter new : T -> M (struct_visibility.my.ClosedBox.t T). - Global Instance AssociatedFunction_new : - Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_struct_visibility_my_ClosedBox_t_T. End Impl_struct_visibility_my_ClosedBox_t_T. End my. @@ -96,9 +93,7 @@ Section Impl_struct_visibility_my_ClosedBox_t_T_2. *) Parameter new : T -> M (struct_visibility.my.ClosedBox.t T). - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_struct_visibility_my_ClosedBox_t_T_2. End Impl_struct_visibility_my_ClosedBox_t_T_2. diff --git a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v index 655f327b7..089902789 100644 --- a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v +++ b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v @@ -23,10 +23,7 @@ Section Impl_example05_Foo_t. *) Parameter plus1 : Self -> M u32.t. - Global Instance AssociatedFunction_plus1 : - Notations.DoubleColon Self "plus1" := { - Notations.double_colon := plus1; - }. + Axiom plus1_is_impl : impl Self "plus1" = plus1. End Impl_example05_Foo_t. End Impl_example05_Foo_t. diff --git a/CoqOfRust/examples/axiomatized/examples/primitives/tuples.v b/CoqOfRust/examples/axiomatized/examples/primitives/tuples.v index 2f42e6eec..5632a595e 100644 --- a/CoqOfRust/examples/axiomatized/examples/primitives/tuples.v +++ b/CoqOfRust/examples/axiomatized/examples/primitives/tuples.v @@ -41,9 +41,7 @@ Section Impl_core_fmt_Debug_for_tuples_Matrix_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_mutablity.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_mutablity.v index 9b8d0888d..f5eaaea0f 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_mutablity.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_mutablity.v @@ -29,10 +29,7 @@ Section Impl_core_clone_Clone_for_scoping_rules_borrowing_mutablity_Book_t. (* #[allow(dead_code)] - function was ignored by the compiler *) Parameter clone : (ref Self) -> M scoping_rules_borrowing_mutablity.Book.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v index f543e51e2..f5c9036ed 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v @@ -25,10 +25,7 @@ Section Impl_core_clone_Clone_for_scoping_rules_borrowing_the_ref_pattern_Point_ Parameter clone : (ref Self) -> M scoping_rules_borrowing_the_ref_pattern.Point.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_bounds.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_bounds.v index f7d28b471..8d63385df 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_bounds.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_bounds.v @@ -28,9 +28,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_bounds_Ref_t_T. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_methods.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_methods.v index d6ef230e4..2c68c2dc8 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_methods.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_methods.v @@ -23,10 +23,7 @@ Section Impl_scoping_rules_lifetimes_methods_Owner_t. *) Parameter add_one : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_add_one : - Notations.DoubleColon Self "add_one" := { - Notations.double_colon := add_one; - }. + Axiom add_one_is_impl : impl Self "add_one" = add_one. (* fn print<'a>(&'a self) { @@ -35,10 +32,7 @@ Section Impl_scoping_rules_lifetimes_methods_Owner_t. *) Parameter print : (ref Self) -> M unit. - Global Instance AssociatedFunction_print : - Notations.DoubleColon Self "print" := { - Notations.double_colon := print; - }. + Axiom print_is_impl : impl Self "print" = print. End Impl_scoping_rules_lifetimes_methods_Owner_t. End Impl_scoping_rules_lifetimes_methods_Owner_t. diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_structs.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_structs.v index 908cb7cb6..dcca13327 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_structs.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_structs.v @@ -22,9 +22,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_Borrowed_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -56,9 +54,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_NamedBorrowed_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -92,9 +88,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_Either_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_traits.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_traits.v index 43bcaf384..cdda25a42 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_traits.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_lifetimes_traits.v @@ -22,9 +22,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_traits_Borrowed_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -43,10 +41,7 @@ Section Impl_core_default_Default_for_scoping_rules_lifetimes_traits_Borrowed_t. *) Parameter default : M Self. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v index d313179a6..cbbb2549d 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v @@ -56,9 +56,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_ownership_and_rules_partial_moves_ Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_raii_desctructor.v b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_raii_desctructor.v index 5d8e54144..42dad8fe6 100644 --- a/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_raii_desctructor.v +++ b/CoqOfRust/examples/axiomatized/examples/scoping_rules/scoping_rules_raii_desctructor.v @@ -18,10 +18,7 @@ Section Impl_core_ops_drop_Drop_for_scoping_rules_raii_desctructor_ToDrop_t. *) Parameter drop : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_drop : - Notations.DoubleColon Self "drop" := { - Notations.double_colon := drop; - }. + Axiom drop_is_impl : impl Self "drop" = drop. Global Instance ℐ : core.ops.drop.Drop.Trait Self := { core.ops.drop.Drop.drop := drop; diff --git a/CoqOfRust/examples/axiomatized/examples/std_library_types/box_stack_heap.v b/CoqOfRust/examples/axiomatized/examples/std_library_types/box_stack_heap.v index 963b52759..e32c218f6 100644 --- a/CoqOfRust/examples/axiomatized/examples/std_library_types/box_stack_heap.v +++ b/CoqOfRust/examples/axiomatized/examples/std_library_types/box_stack_heap.v @@ -27,9 +27,7 @@ Section Impl_core_fmt_Debug_for_box_stack_heap_Point_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -47,10 +45,7 @@ Section Impl_core_clone_Clone_for_box_stack_heap_Point_t. (* #[allow(dead_code)] - function was ignored by the compiler *) Parameter clone : (ref Self) -> M box_stack_heap.Point.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; diff --git a/CoqOfRust/examples/axiomatized/examples/std_library_types/hash_map_alternate_or_custom_key_types.v b/CoqOfRust/examples/axiomatized/examples/std_library_types/hash_map_alternate_or_custom_key_types.v index 033060343..344e35706 100644 --- a/CoqOfRust/examples/axiomatized/examples/std_library_types/hash_map_alternate_or_custom_key_types.v +++ b/CoqOfRust/examples/axiomatized/examples/std_library_types/hash_map_alternate_or_custom_key_types.v @@ -40,9 +40,7 @@ Section Impl_core_cmp_PartialEq_for_hash_map_alternate_or_custom_key_types_Accou (ref hash_map_alternate_or_custom_key_types.Account.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -71,10 +69,8 @@ Section Impl_core_cmp_Eq_for_hash_map_alternate_or_custom_key_types_Account_t. *) Parameter assert_receiver_is_total_eq : (ref Self) -> M unit. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -94,12 +90,7 @@ Section Impl_core_hash_Hash_for_hash_map_alternate_or_custom_key_types_Account_t forall {__H : Set} {ℋ_0 : core.hash.Hasher.Trait __H}, (ref Self) -> (mut_ref __H) -> M unit. - Global Instance AssociatedFunction_hash - {__H : Set} - {ℋ_0 : core.hash.Hasher.Trait __H} : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash (__H := __H); - }. + Axiom hash_is_impl : forall {__H : Set}, impl Self "hash" = hash (__H := __H). Global Instance ℐ : core.hash.Hash.Required.Trait Self := { core.hash.Hash.hash {__H : Set} {ℋ_0 : core.hash.Hasher.Trait __H} := diff --git a/CoqOfRust/examples/axiomatized/examples/std_library_types/result.v b/CoqOfRust/examples/axiomatized/examples/std_library_types/result.v index 8c593c7b4..dc5842e2d 100644 --- a/CoqOfRust/examples/axiomatized/examples/std_library_types/result.v +++ b/CoqOfRust/examples/axiomatized/examples/std_library_types/result.v @@ -21,10 +21,7 @@ Module checked. (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : - Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -89,9 +86,7 @@ Section Impl_core_fmt_Debug_for_result_checked_MathError_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/std_library_types/result_chaining_with_question_mark.v b/CoqOfRust/examples/axiomatized/examples/std_library_types/result_chaining_with_question_mark.v index a93fa32c1..0169dd781 100644 --- a/CoqOfRust/examples/axiomatized/examples/std_library_types/result_chaining_with_question_mark.v +++ b/CoqOfRust/examples/axiomatized/examples/std_library_types/result_chaining_with_question_mark.v @@ -22,10 +22,7 @@ Module checked. (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : - Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -129,9 +126,7 @@ Section Impl_core_fmt_Debug_for_result_chaining_with_question_mark_checked_MathE Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/std_misc/foreign_function_interface.v b/CoqOfRust/examples/axiomatized/examples/std_misc/foreign_function_interface.v index 830483d1f..586195b31 100644 --- a/CoqOfRust/examples/axiomatized/examples/std_misc/foreign_function_interface.v +++ b/CoqOfRust/examples/axiomatized/examples/std_misc/foreign_function_interface.v @@ -52,10 +52,7 @@ Section Impl_core_clone_Clone_for_foreign_function_interface_Complex_t. *) Parameter clone : (ref Self) -> M foreign_function_interface.Complex.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -89,9 +86,7 @@ Section Impl_core_fmt_Debug_for_foreign_function_interface_Complex_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/subtle.v b/CoqOfRust/examples/axiomatized/examples/subtle.v index 7e8a56a49..a0de0ad18 100644 --- a/CoqOfRust/examples/axiomatized/examples/subtle.v +++ b/CoqOfRust/examples/axiomatized/examples/subtle.v @@ -30,10 +30,7 @@ Section Impl_core_clone_Clone_for_subtle_Choice_t. *) Parameter clone : (ref Self) -> M subtle.Choice.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -52,9 +49,7 @@ Section Impl_core_fmt_Debug_for_subtle_Choice_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -73,10 +68,7 @@ Section Impl_subtle_Choice_t. *) Parameter unwrap_u8 : (ref Self) -> M u8.t. - Global Instance AssociatedFunction_unwrap_u8 : - Notations.DoubleColon Self "unwrap_u8" := { - Notations.double_colon := unwrap_u8; - }. + Axiom unwrap_u8_is_impl : impl Self "unwrap_u8" = unwrap_u8. End Impl_subtle_Choice_t. End Impl_subtle_Choice_t. @@ -92,10 +84,7 @@ Section Impl_core_convert_From_subtle_Choice_t_for_bool_t. *) Parameter from : subtle.Choice.t -> M bool.t. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := subtle.Choice.t) := { core.convert.From.from := from; @@ -119,10 +108,7 @@ Section Impl_core_ops_bit_BitAnd_for_subtle_Choice_t. *) Parameter bitand : Self -> subtle.Choice.t -> M subtle.Choice.t. - Global Instance AssociatedFunction_bitand : - Notations.DoubleColon Self "bitand" := { - Notations.double_colon := bitand; - }. + Axiom bitand_is_impl : impl Self "bitand" = bitand. Global Instance ℐ : core.ops.bit.BitAnd.Trait Self @@ -144,10 +130,7 @@ Section Impl_core_ops_bit_BitAndAssign_for_subtle_Choice_t. *) Parameter bitand_assign : (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_bitand_assign : - Notations.DoubleColon Self "bitand_assign" := { - Notations.double_colon := bitand_assign; - }. + Axiom bitand_assign_is_impl : impl Self "bitand_assign" = bitand_assign. Global Instance ℐ : core.ops.bit.BitAndAssign.Trait Self @@ -173,10 +156,7 @@ Section Impl_core_ops_bit_BitOr_for_subtle_Choice_t. *) Parameter bitor : Self -> subtle.Choice.t -> M subtle.Choice.t. - Global Instance AssociatedFunction_bitor : - Notations.DoubleColon Self "bitor" := { - Notations.double_colon := bitor; - }. + Axiom bitor_is_impl : impl Self "bitor" = bitor. Global Instance ℐ : core.ops.bit.BitOr.Trait Self @@ -198,10 +178,7 @@ Section Impl_core_ops_bit_BitOrAssign_for_subtle_Choice_t. *) Parameter bitor_assign : (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_bitor_assign : - Notations.DoubleColon Self "bitor_assign" := { - Notations.double_colon := bitor_assign; - }. + Axiom bitor_assign_is_impl : impl Self "bitor_assign" = bitor_assign. Global Instance ℐ : core.ops.bit.BitOrAssign.Trait Self @@ -227,10 +204,7 @@ Section Impl_core_ops_bit_BitXor_for_subtle_Choice_t. *) Parameter bitxor : Self -> subtle.Choice.t -> M subtle.Choice.t. - Global Instance AssociatedFunction_bitxor : - Notations.DoubleColon Self "bitxor" := { - Notations.double_colon := bitxor; - }. + Axiom bitxor_is_impl : impl Self "bitxor" = bitxor. Global Instance ℐ : core.ops.bit.BitXor.Trait Self @@ -252,10 +226,7 @@ Section Impl_core_ops_bit_BitXorAssign_for_subtle_Choice_t. *) Parameter bitxor_assign : (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_bitxor_assign : - Notations.DoubleColon Self "bitxor_assign" := { - Notations.double_colon := bitxor_assign; - }. + Axiom bitxor_assign_is_impl : impl Self "bitxor_assign" = bitxor_assign. Global Instance ℐ : core.ops.bit.BitXorAssign.Trait Self @@ -281,9 +252,7 @@ Section Impl_core_ops_bit_Not_for_subtle_Choice_t. *) Parameter not : Self -> M subtle.Choice.t. - Global Instance AssociatedFunction_not : Notations.DoubleColon Self "not" := { - Notations.double_colon := not; - }. + Axiom not_is_impl : impl Self "not" = not. Global Instance ℐ : core.ops.bit.Not.Trait Self := { core.ops.bit.Not.Output := Output; @@ -324,10 +293,7 @@ Section Impl_core_convert_From_u8_t_for_subtle_Choice_t. *) Parameter from : u8.t -> M subtle.Choice.t. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := u8.t) := { core.convert.From.from := from; @@ -375,10 +341,7 @@ Section Impl_subtle_ConstantTimeEq_for_slice_T. *) Parameter ct_eq : (ref Self) -> (ref (slice T)) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -398,10 +361,7 @@ Section Impl_subtle_ConstantTimeEq_for_subtle_Choice_t. *) Parameter ct_eq : (ref Self) -> (ref subtle.Choice.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -429,10 +389,7 @@ Section Impl_subtle_ConstantTimeEq_for_u8_t. *) Parameter ct_eq : (ref Self) -> (ref u8.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -453,10 +410,7 @@ Section Impl_subtle_ConstantTimeEq_for_i8_t. *) Parameter ct_eq : (ref Self) -> (ref i8.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -484,10 +438,7 @@ Section Impl_subtle_ConstantTimeEq_for_u16_t. *) Parameter ct_eq : (ref Self) -> (ref u16.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -508,10 +459,7 @@ Section Impl_subtle_ConstantTimeEq_for_i16_t. *) Parameter ct_eq : (ref Self) -> (ref i16.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -539,10 +487,7 @@ Section Impl_subtle_ConstantTimeEq_for_u32_t. *) Parameter ct_eq : (ref Self) -> (ref u32.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -563,10 +508,7 @@ Section Impl_subtle_ConstantTimeEq_for_i32_t. *) Parameter ct_eq : (ref Self) -> (ref i32.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -594,10 +536,7 @@ Section Impl_subtle_ConstantTimeEq_for_u64_t. *) Parameter ct_eq : (ref Self) -> (ref u64.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -618,10 +557,7 @@ Section Impl_subtle_ConstantTimeEq_for_i64_t. *) Parameter ct_eq : (ref Self) -> (ref i64.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -649,10 +585,7 @@ Section Impl_subtle_ConstantTimeEq_for_usize_t. *) Parameter ct_eq : (ref Self) -> (ref usize.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -673,10 +606,7 @@ Section Impl_subtle_ConstantTimeEq_for_isize_t. *) Parameter ct_eq : (ref Self) -> (ref isize.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -710,10 +640,8 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -726,10 +654,8 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -744,10 +670,8 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -774,10 +698,8 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -790,10 +712,8 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -808,10 +728,8 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -838,10 +756,8 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -854,10 +770,8 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -872,10 +786,8 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -902,10 +814,8 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -918,10 +828,8 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -936,10 +844,8 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -966,10 +872,8 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -982,10 +886,8 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1000,10 +902,8 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1030,10 +930,8 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -1046,10 +944,8 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1064,10 +960,8 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1094,10 +988,8 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -1110,10 +1002,8 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1128,10 +1018,8 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1158,10 +1046,8 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -1174,10 +1060,8 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. Parameter conditional_assign : (mut_ref Self) -> (ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1192,10 +1076,8 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. Parameter conditional_swap : (mut_ref Self) -> (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1219,10 +1101,8 @@ Section Impl_subtle_ConditionallySelectable_for_subtle_Choice_t. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1260,10 +1140,8 @@ Section Impl_subtle_ConditionallyNegatable_for_T. *) Parameter conditional_negate : (mut_ref Self) -> subtle.Choice.t -> M unit. - Global Instance AssociatedFunction_conditional_negate : - Notations.DoubleColon Self "conditional_negate" := { - Notations.double_colon := conditional_negate; - }. + Axiom conditional_negate_is_impl : + impl Self "conditional_negate" = conditional_negate. Global Instance ℐ : subtle.ConditionallyNegatable.Trait Self := { subtle.ConditionallyNegatable.conditional_negate := conditional_negate; @@ -1302,10 +1180,7 @@ Section Impl_core_clone_Clone_for_subtle_CtOption_t_T. *) Parameter clone : (ref Self) -> M (subtle.CtOption.t T). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -1341,9 +1216,7 @@ Section Impl_core_fmt_Debug_for_subtle_CtOption_t_T. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -1368,10 +1241,7 @@ Section Impl_core_convert_From_subtle_CtOption_t_T_for_core_option_Option_t_T. *) Parameter from : (subtle.CtOption.t T) -> M (core.option.Option.t T). - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := subtle.CtOption.t T) := { @@ -1396,9 +1266,7 @@ Section Impl_subtle_CtOption_t_T. *) Parameter new : T -> subtle.Choice.t -> M (subtle.CtOption.t T). - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn expect(self, msg: &str) -> T { @@ -1409,10 +1277,7 @@ Section Impl_subtle_CtOption_t_T. *) Parameter expect : Self -> (ref str.t) -> M T. - Global Instance AssociatedFunction_expect : - Notations.DoubleColon Self "expect" := { - Notations.double_colon := expect; - }. + Axiom expect_is_impl : impl Self "expect" = expect. (* pub fn unwrap(self) -> T { @@ -1423,10 +1288,7 @@ Section Impl_subtle_CtOption_t_T. *) Parameter unwrap : Self -> M T. - Global Instance AssociatedFunction_unwrap : - Notations.DoubleColon Self "unwrap" := { - Notations.double_colon := unwrap; - }. + Axiom unwrap_is_impl : impl Self "unwrap" = unwrap. (* pub fn unwrap_or(self, def: T) -> T @@ -1440,11 +1302,7 @@ Section Impl_subtle_CtOption_t_T. forall {ℋ_0 : subtle.ConditionallySelectable.Trait T}, Self -> T -> M T. - Global Instance AssociatedFunction_unwrap_or - {ℋ_0 : subtle.ConditionallySelectable.Trait T} : - Notations.DoubleColon Self "unwrap_or" := { - Notations.double_colon := unwrap_or; - }. + Axiom unwrap_or_is_impl : impl Self "unwrap_or" = unwrap_or. (* pub fn unwrap_or_else(self, f: F) -> T @@ -1462,13 +1320,9 @@ Section Impl_subtle_CtOption_t_T. {ℋ_1 : core.ops.function.FnOnce.Trait F (Args := unit)}, Self -> F -> M T. - Global Instance AssociatedFunction_unwrap_or_else - {F : Set} - {ℋ_0 : subtle.ConditionallySelectable.Trait T} - {ℋ_1 : core.ops.function.FnOnce.Trait F (Args := unit)} : - Notations.DoubleColon Self "unwrap_or_else" := { - Notations.double_colon := unwrap_or_else (F := F); - }. + Axiom unwrap_or_else_is_impl : + forall {F : Set}, + impl Self "unwrap_or_else" = unwrap_or_else (F := F). (* pub fn is_some(&self) -> Choice { @@ -1477,10 +1331,7 @@ Section Impl_subtle_CtOption_t_T. *) Parameter is_some : (ref Self) -> M subtle.Choice.t. - Global Instance AssociatedFunction_is_some : - Notations.DoubleColon Self "is_some" := { - Notations.double_colon := is_some; - }. + Axiom is_some_is_impl : impl Self "is_some" = is_some. (* pub fn is_none(&self) -> Choice { @@ -1489,10 +1340,7 @@ Section Impl_subtle_CtOption_t_T. *) Parameter is_none : (ref Self) -> M subtle.Choice.t. - Global Instance AssociatedFunction_is_none : - Notations.DoubleColon Self "is_none" := { - Notations.double_colon := is_none; - }. + Axiom is_none_is_impl : impl Self "is_none" = is_none. (* pub fn map(self, f: F) -> CtOption @@ -1518,14 +1366,9 @@ Section Impl_subtle_CtOption_t_T. {ℋ_2 : core.ops.function.FnOnce.Trait F (Args := T)}, Self -> F -> M (subtle.CtOption.t U). - Global Instance AssociatedFunction_map - {U F : Set} - {ℋ_0 : core.default.Default.Trait T} - {ℋ_1 : subtle.ConditionallySelectable.Trait T} - {ℋ_2 : core.ops.function.FnOnce.Trait F (Args := T)} : - Notations.DoubleColon Self "map" := { - Notations.double_colon := map (U := U) (F := F); - }. + Axiom map_is_impl : + forall {U F : Set}, + impl Self "map" = map (U := U) (F := F). (* pub fn and_then(self, f: F) -> CtOption @@ -1551,14 +1394,9 @@ Section Impl_subtle_CtOption_t_T. {ℋ_2 : core.ops.function.FnOnce.Trait F (Args := T)}, Self -> F -> M (subtle.CtOption.t U). - Global Instance AssociatedFunction_and_then - {U F : Set} - {ℋ_0 : core.default.Default.Trait T} - {ℋ_1 : subtle.ConditionallySelectable.Trait T} - {ℋ_2 : core.ops.function.FnOnce.Trait F (Args := T)} : - Notations.DoubleColon Self "and_then" := { - Notations.double_colon := and_then (U := U) (F := F); - }. + Axiom and_then_is_impl : + forall {U F : Set}, + impl Self "and_then" = and_then (U := U) (F := F). (* pub fn or_else(self, f: F) -> CtOption @@ -1579,13 +1417,9 @@ Section Impl_subtle_CtOption_t_T. {ℋ_1 : core.ops.function.FnOnce.Trait F (Args := unit)}, Self -> F -> M (subtle.CtOption.t T). - Global Instance AssociatedFunction_or_else - {F : Set} - {ℋ_0 : subtle.ConditionallySelectable.Trait T} - {ℋ_1 : core.ops.function.FnOnce.Trait F (Args := unit)} : - Notations.DoubleColon Self "or_else" := { - Notations.double_colon := or_else (F := F); - }. + Axiom or_else_is_impl : + forall {F : Set}, + impl Self "or_else" = or_else (F := F). End Impl_subtle_CtOption_t_T. End Impl_subtle_CtOption_t_T. @@ -1608,10 +1442,8 @@ Section Impl_subtle_ConditionallySelectable_for_subtle_CtOption_t_T. Parameter conditional_select : (ref Self) -> (ref Self) -> subtle.Choice.t -> M Self. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1640,10 +1472,7 @@ Section Impl_subtle_ConstantTimeEq_for_subtle_CtOption_t_T. Parameter ct_eq : (ref Self) -> (ref (subtle.CtOption.t T)) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1690,10 +1519,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u8_t. *) Parameter ct_gt : (ref Self) -> (ref u8.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; @@ -1730,10 +1556,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u16_t. *) Parameter ct_gt : (ref Self) -> (ref u16.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; @@ -1770,10 +1593,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u32_t. *) Parameter ct_gt : (ref Self) -> (ref u32.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; @@ -1810,10 +1630,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u64_t. *) Parameter ct_gt : (ref Self) -> (ref u64.t) -> M subtle.Choice.t. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; diff --git a/CoqOfRust/examples/axiomatized/examples/traits/clone.v b/CoqOfRust/examples/axiomatized/examples/traits/clone.v index 39af399bb..2e0fb4ffb 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/clone.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/clone.v @@ -17,9 +17,7 @@ Section Impl_core_fmt_Debug_for_clone_Unit_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -36,10 +34,7 @@ Section Impl_core_clone_Clone_for_clone_Unit_t. *) Parameter clone : (ref Self) -> M clone.Unit.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -80,10 +75,7 @@ Section Impl_core_clone_Clone_for_clone_Pair_t. *) Parameter clone : (ref Self) -> M clone.Pair.t. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -102,9 +94,7 @@ Section Impl_core_fmt_Debug_for_clone_Pair_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/axiomatized/examples/traits/derive.v b/CoqOfRust/examples/axiomatized/examples/traits/derive.v index 9dd232de4..8644f2643 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/derive.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/derive.v @@ -30,9 +30,7 @@ Section Impl_core_cmp_PartialEq_for_derive_Centimeters_t. *) Parameter eq : (ref Self) -> (ref derive.Centimeters.t) -> M bool.t. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -55,10 +53,7 @@ Section Impl_core_cmp_PartialOrd_for_derive_Centimeters_t. (ref derive.Centimeters.t) -> M (core.option.Option.t core.cmp.Ordering.t). - Global Instance AssociatedFunction_partial_cmp : - Notations.DoubleColon Self "partial_cmp" := { - Notations.double_colon := partial_cmp; - }. + Axiom partial_cmp_is_impl : impl Self "partial_cmp" = partial_cmp. Global Instance ℐ : core.cmp.PartialOrd.Required.Trait Self @@ -93,9 +88,7 @@ Section Impl_core_fmt_Debug_for_derive_Inches_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -116,10 +109,7 @@ Section Impl_derive_Inches_t. *) Parameter to_centimeters : (ref Self) -> M derive.Centimeters.t. - Global Instance AssociatedFunction_to_centimeters : - Notations.DoubleColon Self "to_centimeters" := { - Notations.double_colon := to_centimeters; - }. + Axiom to_centimeters_is_impl : impl Self "to_centimeters" = to_centimeters. End Impl_derive_Inches_t. End Impl_derive_Inches_t. diff --git a/CoqOfRust/examples/axiomatized/examples/traits/disambiguating_overlapping_traits.v b/CoqOfRust/examples/axiomatized/examples/traits/disambiguating_overlapping_traits.v index a12048922..4a0f15c2b 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/disambiguating_overlapping_traits.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/disambiguating_overlapping_traits.v @@ -46,9 +46,7 @@ Section Impl_disambiguating_overlapping_traits_UsernameWidget_for_disambiguating *) Parameter get : (ref Self) -> M alloc.string.String.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : disambiguating_overlapping_traits.UsernameWidget.Trait Self := { @@ -68,9 +66,7 @@ Section Impl_disambiguating_overlapping_traits_AgeWidget_for_disambiguating_over *) Parameter get : (ref Self) -> M u8.t. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : disambiguating_overlapping_traits.AgeWidget.Trait Self := { diff --git a/CoqOfRust/examples/axiomatized/examples/traits/drop.v b/CoqOfRust/examples/axiomatized/examples/traits/drop.v index 74b3a1fa1..34b10fd5b 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/drop.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/drop.v @@ -23,10 +23,7 @@ Section Impl_core_ops_drop_Drop_for_drop_Droppable_t. *) Parameter drop : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_drop : - Notations.DoubleColon Self "drop" := { - Notations.double_colon := drop; - }. + Axiom drop_is_impl : impl Self "drop" = drop. Global Instance ℐ : core.ops.drop.Drop.Trait Self := { core.ops.drop.Drop.drop := drop; diff --git a/CoqOfRust/examples/axiomatized/examples/traits/hash.v b/CoqOfRust/examples/axiomatized/examples/traits/hash.v index 5206725ab..84c2cee69 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/hash.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/hash.v @@ -29,12 +29,7 @@ Section Impl_core_hash_Hash_for_hash_Person_t. forall {__H : Set} {ℋ_0 : core.hash.Hasher.Trait __H}, (ref Self) -> (mut_ref __H) -> M unit. - Global Instance AssociatedFunction_hash - {__H : Set} - {ℋ_0 : core.hash.Hasher.Trait __H} : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash (__H := __H); - }. + Axiom hash_is_impl : forall {__H : Set}, impl Self "hash" = hash (__H := __H). Global Instance ℐ : core.hash.Hash.Required.Trait Self := { core.hash.Hash.hash {__H : Set} {ℋ_0 : core.hash.Hasher.Trait __H} := diff --git a/CoqOfRust/examples/axiomatized/examples/traits/iterators.v b/CoqOfRust/examples/axiomatized/examples/traits/iterators.v index d1c346c88..172ed4906 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/iterators.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/iterators.v @@ -38,10 +38,7 @@ Section Impl_core_iter_traits_iterator_Iterator_for_iterators_Fibonacci_t. *) Parameter next : (mut_ref Self) -> M (core.option.Option.t Item.t). - Global Instance AssociatedFunction_next : - Notations.DoubleColon Self "next" := { - Notations.double_colon := next; - }. + Axiom next_is_impl : impl Self "next" = next. Global Instance ℐ : core.iter.traits.iterator.Iterator.Required.Trait Self := { diff --git a/CoqOfRust/examples/axiomatized/examples/traits/operator_overloading.v b/CoqOfRust/examples/axiomatized/examples/traits/operator_overloading.v index 0ef97f273..d652881b8 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/operator_overloading.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/operator_overloading.v @@ -29,9 +29,7 @@ Section Impl_core_fmt_Debug_for_operator_overloading_FooBar_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -55,9 +53,7 @@ Section Impl_core_fmt_Debug_for_operator_overloading_BarFoo_t. Parameter fmt : (ref Self) -> (mut_ref core.fmt.Formatter.t) -> M ltac:(core.fmt.Result). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -84,9 +80,7 @@ Section Impl_core_ops_arith_Add_operator_overloading_Bar_t_for_operator_overload Parameter add : Self -> operator_overloading.Bar.t -> M operator_overloading.FooBar.t. - Global Instance AssociatedFunction_add : Notations.DoubleColon Self "add" := { - Notations.double_colon := add; - }. + Axiom add_is_impl : impl Self "add" = add. Global Instance ℐ : core.ops.arith.Add.Trait Self (Rhs := operator_overloading.Bar.t) := { @@ -115,9 +109,7 @@ Section Impl_core_ops_arith_Add_operator_overloading_Foo_t_for_operator_overload Parameter add : Self -> operator_overloading.Foo.t -> M operator_overloading.BarFoo.t. - Global Instance AssociatedFunction_add : Notations.DoubleColon Self "add" := { - Notations.double_colon := add; - }. + Axiom add_is_impl : impl Self "add" = add. Global Instance ℐ : core.ops.arith.Add.Trait Self (Rhs := operator_overloading.Foo.t) := { diff --git a/CoqOfRust/examples/axiomatized/examples/traits/returning_traits_with_dyn.v b/CoqOfRust/examples/axiomatized/examples/traits/returning_traits_with_dyn.v index ba573e735..e9a533aa2 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/returning_traits_with_dyn.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/returning_traits_with_dyn.v @@ -33,10 +33,7 @@ Section Impl_returning_traits_with_dyn_Animal_for_returning_traits_with_dyn_Shee *) Parameter noise : (ref Self) -> M (ref str.t). - Global Instance AssociatedFunction_noise : - Notations.DoubleColon Self "noise" := { - Notations.double_colon := noise; - }. + Axiom noise_is_impl : impl Self "noise" = noise. Global Instance ℐ : returning_traits_with_dyn.Animal.Trait Self := { returning_traits_with_dyn.Animal.noise := noise; @@ -55,10 +52,7 @@ Section Impl_returning_traits_with_dyn_Animal_for_returning_traits_with_dyn_Cow_ *) Parameter noise : (ref Self) -> M (ref str.t). - Global Instance AssociatedFunction_noise : - Notations.DoubleColon Self "noise" := { - Notations.double_colon := noise; - }. + Axiom noise_is_impl : impl Self "noise" = noise. Global Instance ℐ : returning_traits_with_dyn.Animal.Trait Self := { returning_traits_with_dyn.Animal.noise := noise; diff --git a/CoqOfRust/examples/axiomatized/examples/traits/traits.v b/CoqOfRust/examples/axiomatized/examples/traits/traits.v index fd1d7f789..d28d688f5 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/traits.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/traits.v @@ -37,10 +37,7 @@ Section Impl_traits_Sheep_t. *) Parameter is_naked : (ref Self) -> M bool.t. - Global Instance AssociatedFunction_is_naked : - Notations.DoubleColon Self "is_naked" := { - Notations.double_colon := is_naked; - }. + Axiom is_naked_is_impl : impl Self "is_naked" = is_naked. End Impl_traits_Sheep_t. End Impl_traits_Sheep_t. @@ -58,9 +55,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. *) Parameter new : (ref str.t) -> M traits.Sheep.t. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn name(&self) -> &'static str { @@ -69,10 +64,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. *) Parameter name : (ref Self) -> M (ref str.t). - Global Instance AssociatedFunction_name : - Notations.DoubleColon Self "name" := { - Notations.double_colon := name; - }. + Axiom name_is_impl : impl Self "name" = name. (* fn noise(&self) -> &'static str { @@ -85,10 +77,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. *) Parameter noise : (ref Self) -> M (ref str.t). - Global Instance AssociatedFunction_noise : - Notations.DoubleColon Self "noise" := { - Notations.double_colon := noise; - }. + Axiom noise_is_impl : impl Self "noise" = noise. (* fn talk(&self) { @@ -98,10 +87,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. *) Parameter talk : (ref Self) -> M unit. - Global Instance AssociatedFunction_talk : - Notations.DoubleColon Self "talk" := { - Notations.double_colon := talk; - }. + Axiom talk_is_impl : impl Self "talk" = talk. Global Instance ℐ : traits.Animal.Required.Trait Self := { traits.Animal.new := new; @@ -130,10 +116,7 @@ Section Impl_traits_Sheep_t_2. *) Parameter shear : (mut_ref Self) -> M unit. - Global Instance AssociatedFunction_shear : - Notations.DoubleColon Self "shear" := { - Notations.double_colon := shear; - }. + Axiom shear_is_impl : impl Self "shear" = shear. End Impl_traits_Sheep_t_2. End Impl_traits_Sheep_t_2. diff --git a/CoqOfRust/examples/axiomatized/examples/traits/traits_parms.v b/CoqOfRust/examples/axiomatized/examples/traits/traits_parms.v index 5ef351f75..053b9a8cb 100644 --- a/CoqOfRust/examples/axiomatized/examples/traits/traits_parms.v +++ b/CoqOfRust/examples/axiomatized/examples/traits/traits_parms.v @@ -97,10 +97,7 @@ Section Impl_traits_parms_SomeTrait_for_traits_parms_SomeOtherType_t. *) Parameter some_fn : M unit. - Global Instance AssociatedFunction_some_fn : - Notations.DoubleColon Self "some_fn" := { - Notations.double_colon := some_fn; - }. + Axiom some_fn_is_impl : impl Self "some_fn" = some_fn. Global Instance ℐ : traits_parms.SomeTrait.Trait Self := { traits_parms.SomeTrait.SomeType := SomeType; diff --git a/CoqOfRust/examples/default/examples/cargo/concurrent_tests.v b/CoqOfRust/examples/default/examples/cargo/concurrent_tests.v index e9d1eac73..79011430e 100644 --- a/CoqOfRust/examples/default/examples/cargo/concurrent_tests.v +++ b/CoqOfRust/examples/default/examples/cargo/concurrent_tests.v @@ -30,7 +30,7 @@ Definition foo {A : Set} (o : core.option.Option.t A) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -50,7 +50,7 @@ Definition foo {A : Set} (o : core.option.Option.t A) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -79,19 +79,22 @@ Module tests. *) Definition test_file : M unit := let* file : M.Val std.fs.File.t := - let* α0 : std.fs.OpenOptions.t := M.call std.fs.OpenOptions.t::["new"] in + let* α0 : std.fs.OpenOptions.t := + M.call (impl std.fs.OpenOptions.t "new") in let* α1 : M.Val std.fs.OpenOptions.t := M.alloc α0 in let* α2 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["append"] (borrow_mut α1) true) in + M.call (impl std.fs.OpenOptions.t "append" (borrow_mut α1) true) in let* α3 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["create"] α2 true) in + M.call (impl std.fs.OpenOptions.t "create" α2 true) in let* α4 : ref str.t := M.read (mk_str "ferris.txt") in let* α5 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.OpenOptions.t::["open"] (borrow (deref α3)) α4) in + M.call (impl std.fs.OpenOptions.t "open" (borrow (deref α3)) α4) in let* α6 : ref str.t := M.read (mk_str "Failed to open ferris.txt") in let* α7 : std.fs.File.t := M.call - ((core.result.Result.t std.fs.File.t std.io.error.Error.t)::["expect"] + (impl + (core.result.Result.t std.fs.File.t std.io.error.Error.t) + "expect" α5 α6) in M.alloc α7 in @@ -152,7 +155,7 @@ Module tests. let* α1 : ref str.t := M.read (mk_str "Ferris ") in let* α2 : ref (slice u8.t) := - M.call (str.t::["as_bytes"] α1) in + M.call (impl str.t "as_bytes" α1) in let* α3 : core.result.Result.t unit std.io.error.Error.t := M.call (α0 (borrow_mut file) α2) in @@ -160,9 +163,11 @@ Module tests. M.read (mk_str "Could not write to ferris.txt") in let* α5 : unit := M.call - ((core.result.Result.t + (impl + (core.result.Result.t unit - std.io.error.Error.t)::["expect"] + std.io.error.Error.t) + "expect" α3 α4) in M.alloc α5 in @@ -194,19 +199,22 @@ Module tests. *) Definition test_file_also : M unit := let* file : M.Val std.fs.File.t := - let* α0 : std.fs.OpenOptions.t := M.call std.fs.OpenOptions.t::["new"] in + let* α0 : std.fs.OpenOptions.t := + M.call (impl std.fs.OpenOptions.t "new") in let* α1 : M.Val std.fs.OpenOptions.t := M.alloc α0 in let* α2 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["append"] (borrow_mut α1) true) in + M.call (impl std.fs.OpenOptions.t "append" (borrow_mut α1) true) in let* α3 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["create"] α2 true) in + M.call (impl std.fs.OpenOptions.t "create" α2 true) in let* α4 : ref str.t := M.read (mk_str "ferris.txt") in let* α5 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.OpenOptions.t::["open"] (borrow (deref α3)) α4) in + M.call (impl std.fs.OpenOptions.t "open" (borrow (deref α3)) α4) in let* α6 : ref str.t := M.read (mk_str "Failed to open ferris.txt") in let* α7 : std.fs.File.t := M.call - ((core.result.Result.t std.fs.File.t std.io.error.Error.t)::["expect"] + (impl + (core.result.Result.t std.fs.File.t std.io.error.Error.t) + "expect" α5 α6) in M.alloc α7 in @@ -267,7 +275,7 @@ Module tests. let* α1 : ref str.t := M.read (mk_str "Corro ") in let* α2 : ref (slice u8.t) := - M.call (str.t::["as_bytes"] α1) in + M.call (impl str.t "as_bytes" α1) in let* α3 : core.result.Result.t unit std.io.error.Error.t := M.call (α0 (borrow_mut file) α2) in @@ -275,9 +283,11 @@ Module tests. M.read (mk_str "Could not write to ferris.txt") in let* α5 : unit := M.call - ((core.result.Result.t + (impl + (core.result.Result.t unit - std.io.error.Error.t)::["expect"] + std.io.error.Error.t) + "expect" α3 α4) in M.alloc α5 in @@ -310,19 +320,20 @@ End tests. *) Definition test_file : M unit := let* file : M.Val std.fs.File.t := - let* α0 : std.fs.OpenOptions.t := M.call std.fs.OpenOptions.t::["new"] in + let* α0 : std.fs.OpenOptions.t := + M.call (impl std.fs.OpenOptions.t "new") in let* α1 : M.Val std.fs.OpenOptions.t := M.alloc α0 in let* α2 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["append"] (borrow_mut α1) true) in + M.call (impl std.fs.OpenOptions.t "append" (borrow_mut α1) true) in let* α3 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["create"] α2 true) in + M.call (impl std.fs.OpenOptions.t "create" α2 true) in let* α4 : ref str.t := M.read (mk_str "ferris.txt") in let* α5 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.OpenOptions.t::["open"] (borrow (deref α3)) α4) in + M.call (impl std.fs.OpenOptions.t "open" (borrow (deref α3)) α4) in let* α6 : ref str.t := M.read (mk_str "Failed to open ferris.txt") in let* α7 : std.fs.File.t := M.call - ((core.result.Result.t std.fs.File.t std.io.error.Error.t)::["expect"] + (impl (core.result.Result.t std.fs.File.t std.io.error.Error.t) "expect" α5 α6) in M.alloc α7 in @@ -383,7 +394,7 @@ Definition test_file : M unit := let* α1 : ref str.t := M.read (mk_str "Ferris ") in let* α2 : ref (slice u8.t) := - M.call (str.t::["as_bytes"] α1) in + M.call (impl str.t "as_bytes" α1) in let* α3 : core.result.Result.t unit std.io.error.Error.t := M.call (α0 (borrow_mut file) α2) in @@ -391,9 +402,9 @@ Definition test_file : M unit := M.read (mk_str "Could not write to ferris.txt") in let* α5 : unit := M.call - ((core.result.Result.t - unit - std.io.error.Error.t)::["expect"] + (impl + (core.result.Result.t unit std.io.error.Error.t) + "expect" α3 α4) in M.alloc α5 in @@ -425,19 +436,20 @@ Definition test_file : M unit := *) Definition test_file_also : M unit := let* file : M.Val std.fs.File.t := - let* α0 : std.fs.OpenOptions.t := M.call std.fs.OpenOptions.t::["new"] in + let* α0 : std.fs.OpenOptions.t := + M.call (impl std.fs.OpenOptions.t "new") in let* α1 : M.Val std.fs.OpenOptions.t := M.alloc α0 in let* α2 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["append"] (borrow_mut α1) true) in + M.call (impl std.fs.OpenOptions.t "append" (borrow_mut α1) true) in let* α3 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["create"] α2 true) in + M.call (impl std.fs.OpenOptions.t "create" α2 true) in let* α4 : ref str.t := M.read (mk_str "ferris.txt") in let* α5 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.OpenOptions.t::["open"] (borrow (deref α3)) α4) in + M.call (impl std.fs.OpenOptions.t "open" (borrow (deref α3)) α4) in let* α6 : ref str.t := M.read (mk_str "Failed to open ferris.txt") in let* α7 : std.fs.File.t := M.call - ((core.result.Result.t std.fs.File.t std.io.error.Error.t)::["expect"] + (impl (core.result.Result.t std.fs.File.t std.io.error.Error.t) "expect" α5 α6) in M.alloc α7 in @@ -498,7 +510,7 @@ Definition test_file_also : M unit := let* α1 : ref str.t := M.read (mk_str "Corro ") in let* α2 : ref (slice u8.t) := - M.call (str.t::["as_bytes"] α1) in + M.call (impl str.t "as_bytes" α1) in let* α3 : core.result.Result.t unit std.io.error.Error.t := M.call (α0 (borrow_mut file) α2) in @@ -506,9 +518,9 @@ Definition test_file_also : M unit := M.read (mk_str "Could not write to ferris.txt") in let* α5 : unit := M.call - ((core.result.Result.t - unit - std.io.error.Error.t)::["expect"] + (impl + (core.result.Result.t unit std.io.error.Error.t) + "expect" α3 α4) in M.alloc α5 in diff --git a/CoqOfRust/examples/default/examples/conversion/converting_to_string.v b/CoqOfRust/examples/default/examples/conversion/converting_to_string.v index a7c3cb5d9..6636d025c 100644 --- a/CoqOfRust/examples/default/examples/conversion/converting_to_string.v +++ b/CoqOfRust/examples/default/examples/conversion/converting_to_string.v @@ -36,7 +36,7 @@ Section Impl_core_fmt_Display_for_converting_to_string_Circle_t. let* α5 : ref converting_to_string.Circle.t := M.read self in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (converting_to_string.Circle.Get_radius (deref α5)))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -44,12 +44,10 @@ Section Impl_core_fmt_Display_for_converting_to_string_Circle_t. let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α10). + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α10). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; diff --git a/CoqOfRust/examples/default/examples/conversion/from.v b/CoqOfRust/examples/default/examples/conversion/from.v index 51d35f0fc..aba66ae42 100644 --- a/CoqOfRust/examples/default/examples/conversion/from.v +++ b/CoqOfRust/examples/default/examples/conversion/from.v @@ -26,10 +26,7 @@ Section Impl_core_convert_From_i32_t_for_from_Number_t. let* α0 : i32.t := M.read item in M.pure {| from.Number.value := α0; |}. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := i32.t) := { core.convert.From.from := from; diff --git a/CoqOfRust/examples/default/examples/conversion/into.v b/CoqOfRust/examples/default/examples/conversion/into.v index a05fe9311..28089a48e 100644 --- a/CoqOfRust/examples/default/examples/conversion/into.v +++ b/CoqOfRust/examples/default/examples/conversion/into.v @@ -26,10 +26,7 @@ Section Impl_core_convert_From_i32_t_for_into_Number_t. let* α0 : i32.t := M.read item in M.pure {| into.Number.value := α0; |}. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := i32.t) := { core.convert.From.from := from; diff --git a/CoqOfRust/examples/default/examples/conversion/parsing_a_string.v b/CoqOfRust/examples/default/examples/conversion/parsing_a_string.v index a10d283fd..49f840e09 100644 --- a/CoqOfRust/examples/default/examples/conversion/parsing_a_string.v +++ b/CoqOfRust/examples/default/examples/conversion/parsing_a_string.v @@ -13,18 +13,18 @@ Definition main : M unit := let* _ : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := let* α0 : ref str.t := M.read (mk_str "12") in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.alloc α1 in let* _ : M.Val (core.result.Result.t bool.t core.str.error.ParseBoolError.t) := let* α0 : ref str.t := M.read (mk_str "true") in let* α1 : core.result.Result.t bool.t core.str.error.ParseBoolError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.alloc α1 in let* _ : M.Val (core.result.Result.t u32.t core.num.error.ParseIntError.t) := let* α0 : ref str.t := M.read (mk_str "unparsable") in let* α1 : core.result.Result.t u32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.alloc α1 in let* α0 : M.Val unit := M.alloc tt in M.read α0. diff --git a/CoqOfRust/examples/default/examples/conversion/try_from_and_try_into.v b/CoqOfRust/examples/default/examples/conversion/try_from_and_try_into.v index b545f0561..6f3420297 100644 --- a/CoqOfRust/examples/default/examples/conversion/try_from_and_try_into.v +++ b/CoqOfRust/examples/default/examples/conversion/try_from_and_try_into.v @@ -32,11 +32,9 @@ Section Impl_core_fmt_Debug_for_try_from_and_try_into_EvenNumber_t. M.alloc (borrow (try_from_and_try_into.EvenNumber.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref i32.t)) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -74,9 +72,7 @@ Section Impl_core_cmp_PartialEq_for_try_from_and_try_into_EvenNumber_t. M.read (try_from_and_try_into.EvenNumber.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -122,10 +118,7 @@ Section Impl_core_convert_TryFrom_i32_t_for_try_from_and_try_into_EvenNumber_t. M.alloc (core.result.Result.Err tt) in M.read α4. - Global Instance AssociatedFunction_try_from : - Notations.DoubleColon Self "try_from" := { - Notations.double_colon := try_from; - }. + Axiom try_from_is_impl : impl Self "try_from" = try_from. Global Instance ℐ : core.convert.TryFrom.Trait Self (T := i32.t) := { core.convert.TryFrom.Error := Error; diff --git a/CoqOfRust/examples/default/examples/custom_types/constants.v b/CoqOfRust/examples/default/examples/custom_types/constants.v index 77aba100b..1da3178fc 100644 --- a/CoqOfRust/examples/default/examples/custom_types/constants.v +++ b/CoqOfRust/examples/default/examples/custom_types/constants.v @@ -47,14 +47,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : ref (ref str.t) := M.read constants.LANGUAGE in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] α5) in + M.call (impl core.fmt.rt.Argument.t "new_display" α5) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -69,7 +69,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow constants.THRESHOLD)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -77,7 +77,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -92,7 +92,7 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α7 : i32.t := M.read n in let* α8 : bool.t := M.call (constants.is_big α7) in let* α9 : M.Val bool.t := M.alloc α8 in @@ -104,14 +104,14 @@ Definition main : M unit := let* α0 : ref str.t := M.read (mk_str "small") in M.alloc α0 in let* α12 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α11)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α11)) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α12 ] in let* α14 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α13) in let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/custom_types/enums.v b/CoqOfRust/examples/default/examples/custom_types/enums.v index 483b26e3e..aa36a535d 100644 --- a/CoqOfRust/examples/default/examples/custom_types/enums.v +++ b/CoqOfRust/examples/default/examples/custom_types/enums.v @@ -84,7 +84,7 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -104,7 +104,7 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -127,7 +127,7 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow c)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow c)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -135,7 +135,7 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -158,7 +158,7 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -166,7 +166,7 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -197,9 +197,11 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow x)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow y)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow y)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -207,7 +209,7 @@ Definition inspect (event : enums.WebEvent.t) : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/custom_types/enums_c_like.v b/CoqOfRust/examples/default/examples/custom_types/enums_c_like.v index 15df16afc..6c0eda1ed 100644 --- a/CoqOfRust/examples/default/examples/custom_types/enums_c_like.v +++ b/CoqOfRust/examples/default/examples/custom_types/enums_c_like.v @@ -40,14 +40,14 @@ Definition main : M unit := let* α6 : i32.t := M.cast α5 in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -64,14 +64,14 @@ Definition main : M unit := let* α6 : i32.t := M.cast α5 in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -90,7 +90,7 @@ Definition main : M unit := let* α8 : i32.t := M.cast α7 in let* α9 : M.Val i32.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_lower_hex"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_lower_hex" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α11) in @@ -98,7 +98,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) " "%char core.fmt.rt.Alignment.Unknown @@ -111,9 +111,9 @@ Definition main : M unit := let* α17 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α16) in let* α18 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α19 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α13 α17 α18) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α13 α17 α18) in let* α20 : unit := M.call (std.io.stdio._print α19) in M.alloc α20 in M.alloc tt in @@ -132,7 +132,7 @@ Definition main : M unit := let* α8 : i32.t := M.cast α7 in let* α9 : M.Val i32.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_lower_hex"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_lower_hex" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α11) in @@ -140,7 +140,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) " "%char core.fmt.rt.Alignment.Unknown @@ -153,9 +153,9 @@ Definition main : M unit := let* α17 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α16) in let* α18 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α19 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α13 α17 α18) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α13 α17 α18) in let* α20 : unit := M.call (std.io.stdio._print α19) in M.alloc α20 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/custom_types/enums_testcase_linked_list.v b/CoqOfRust/examples/default/examples/custom_types/enums_testcase_linked_list.v index aa87038d2..8b2c48b06 100644 --- a/CoqOfRust/examples/default/examples/custom_types/enums_testcase_linked_list.v +++ b/CoqOfRust/examples/default/examples/custom_types/enums_testcase_linked_list.v @@ -36,9 +36,7 @@ Section Impl_enums_testcase_linked_list_List_t. Definition new : M enums_testcase_linked_list.List.t := M.pure enums_testcase_linked_list.List.Nil. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn prepend(self, elem: u32) -> List { @@ -59,16 +57,15 @@ Section Impl_enums_testcase_linked_list_List_t. enums_testcase_linked_list.List.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t + (impl + (alloc.boxed.Box.t enums_testcase_linked_list.List.t - alloc.alloc.Global.t)::["new"] + alloc.alloc.Global.t) + "new" α1) in M.pure (enums_testcase_linked_list.List.Cons α0 α2). - Global Instance AssociatedFunction_prepend : - Notations.DoubleColon Self "prepend" := { - Notations.double_colon := prepend; - }. + Axiom prepend_is_impl : impl Self "prepend" = prepend. (* fn len(&self) -> u32 { @@ -115,7 +112,7 @@ Section Impl_enums_testcase_linked_list_List_t. M.read (deref α0) in let* α2 : u32.t := M.call - (enums_testcase_linked_list.List.t::["len"] + (impl enums_testcase_linked_list.List.t "len" (borrow (deref α1))) in let* α3 : u32.t := BinOp.Panic.add ((Integer.of_Z 1) : u32.t) α2 in @@ -134,9 +131,7 @@ Section Impl_enums_testcase_linked_list_List_t. ] in M.read α1. - Global Instance AssociatedFunction_len : Notations.DoubleColon Self "len" := { - Notations.double_colon := len; - }. + Axiom len_is_impl : impl Self "len" = len. (* fn stringify(&self) -> String { @@ -177,7 +172,7 @@ Section Impl_enums_testcase_linked_list_List_t. M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow head)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow head)) in let* α6 : ref (alloc.boxed.Box.t @@ -191,12 +186,12 @@ Section Impl_enums_testcase_linked_list_List_t. M.read (deref α6) in let* α8 : alloc.string.String.t := M.call - (enums_testcase_linked_list.List.t::["stringify"] + (impl enums_testcase_linked_list.List.t "stringify" (borrow (deref α7))) in let* α9 : M.Val alloc.string.String.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow α9)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5; α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -204,7 +199,7 @@ Section Impl_enums_testcase_linked_list_List_t. let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α13) in let* α15 : alloc.string.String.t := M.call (alloc.fmt.format α14) in M.alloc α15 in @@ -224,7 +219,7 @@ Section Impl_enums_testcase_linked_list_List_t. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : alloc.string.String.t := M.call (alloc.fmt.format α4) in M.alloc α5 in @@ -235,10 +230,7 @@ Section Impl_enums_testcase_linked_list_List_t. ] in M.read α1. - Global Instance AssociatedFunction_stringify : - Notations.DoubleColon Self "stringify" := { - Notations.double_colon := stringify; - }. + Axiom stringify_is_impl : impl Self "stringify" = stringify. End Impl_enums_testcase_linked_list_List_t. End Impl_enums_testcase_linked_list_List_t. @@ -261,13 +253,13 @@ fn main() { Definition main : M unit := let* list : M.Val enums_testcase_linked_list.List.t := let* α0 : enums_testcase_linked_list.List.t := - M.call enums_testcase_linked_list.List.t::["new"] in + M.call (impl enums_testcase_linked_list.List.t "new") in M.alloc α0 in let* _ : M.Val unit := let* α0 : enums_testcase_linked_list.List.t := M.read list in let* α1 : enums_testcase_linked_list.List.t := M.call - (enums_testcase_linked_list.List.t::["prepend"] + (impl enums_testcase_linked_list.List.t "prepend" α0 ((Integer.of_Z 1) : u32.t)) in assign list α1 in @@ -275,7 +267,7 @@ Definition main : M unit := let* α0 : enums_testcase_linked_list.List.t := M.read list in let* α1 : enums_testcase_linked_list.List.t := M.call - (enums_testcase_linked_list.List.t::["prepend"] + (impl enums_testcase_linked_list.List.t "prepend" α0 ((Integer.of_Z 2) : u32.t)) in assign list α1 in @@ -283,7 +275,7 @@ Definition main : M unit := let* α0 : enums_testcase_linked_list.List.t := M.read list in let* α1 : enums_testcase_linked_list.List.t := M.call - (enums_testcase_linked_list.List.t::["prepend"] + (impl enums_testcase_linked_list.List.t "prepend" α0 ((Integer.of_Z 3) : u32.t)) in assign list α1 in @@ -297,17 +289,17 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : u32.t := - M.call (enums_testcase_linked_list.List.t::["len"] (borrow list)) in + M.call (impl enums_testcase_linked_list.List.t "len" (borrow list)) in let* α6 : M.Val u32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -322,17 +314,17 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : alloc.string.String.t := M.call - (enums_testcase_linked_list.List.t::["stringify"] (borrow list)) in + (impl enums_testcase_linked_list.List.t "stringify" (borrow list)) in let* α6 : M.Val alloc.string.String.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/custom_types/enums_type_aliases_v2.v b/CoqOfRust/examples/default/examples/custom_types/enums_type_aliases_v2.v index 64bc7c8fb..fa44ecd58 100644 --- a/CoqOfRust/examples/default/examples/custom_types/enums_type_aliases_v2.v +++ b/CoqOfRust/examples/default/examples/custom_types/enums_type_aliases_v2.v @@ -63,8 +63,6 @@ Section Impl_enums_type_aliases_v2_VeryVerboseEnumOfThingsToDoWithNumbers_t. ] in M.read α0. - Global Instance AssociatedFunction_run : Notations.DoubleColon Self "run" := { - Notations.double_colon := run; - }. + Axiom run_is_impl : impl Self "run" = run. End Impl_enums_type_aliases_v2_VeryVerboseEnumOfThingsToDoWithNumbers_t. End Impl_enums_type_aliases_v2_VeryVerboseEnumOfThingsToDoWithNumbers_t. diff --git a/CoqOfRust/examples/default/examples/custom_types/enums_use.v b/CoqOfRust/examples/default/examples/custom_types/enums_use.v index 455486fde..14e38790f 100644 --- a/CoqOfRust/examples/default/examples/custom_types/enums_use.v +++ b/CoqOfRust/examples/default/examples/custom_types/enums_use.v @@ -55,7 +55,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -76,7 +76,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -101,7 +101,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -121,7 +121,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/custom_types/structures.v b/CoqOfRust/examples/default/examples/custom_types/structures.v index bdf31f2cb..0875fa968 100644 --- a/CoqOfRust/examples/default/examples/custom_types/structures.v +++ b/CoqOfRust/examples/default/examples/custom_types/structures.v @@ -42,11 +42,15 @@ Section Impl_core_fmt_Debug_for_structures_Person_t. let* α9 : M.Val (ref (ref u8.t)) := M.alloc (borrow α8) in let* α10 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α9) in M.call - (core.fmt.Formatter.t::["debug_struct_field2_finish"] α0 α1 α2 α5 α6 α10). + (impl core.fmt.Formatter.t "debug_struct_field2_finish" + α0 + α1 + α2 + α5 + α6 + α10). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -187,14 +191,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow peter)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow peter)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -214,11 +218,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (structures.Point.Get_x point))) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (structures.Point.Get_y point))) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -226,7 +230,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -245,11 +249,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (structures.Point.Get_x bottom_right))) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (structures.Point.Get_y bottom_right))) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -257,7 +261,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -301,11 +305,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (structures.Pair.Get_0 pair))) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (structures.Pair.Get_1 pair))) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in @@ -314,7 +318,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -344,11 +348,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow integer)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow decimal)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in @@ -357,7 +361,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/aliases_for_result.v b/CoqOfRust/examples/default/examples/error_handling/aliases_for_result.v index a558f95cc..afab36cab 100644 --- a/CoqOfRust/examples/default/examples/error_handling/aliases_for_result.v +++ b/CoqOfRust/examples/default/examples/error_handling/aliases_for_result.v @@ -21,9 +21,9 @@ Definition multiply let* second_number_str := M.alloc second_number_str in let* α0 : ref str.t := M.read first_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.call - ((core.result.Result.t i32.t core.num.error.ParseIntError.t)::["and_then"] + (impl (core.result.Result.t i32.t core.num.error.ParseIntError.t) "and_then" α1 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -35,11 +35,11 @@ Definition multiply let* α0 : ref str.t := M.read second_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.call - ((core.result.Result.t - i32.t - core.num.error.ParseIntError.t)::["map"] + (impl + (core.result.Result.t i32.t core.num.error.ParseIntError.t) + "map" α1 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -90,7 +90,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -98,7 +98,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -121,7 +121,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -129,7 +129,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/boxing_errors.v b/CoqOfRust/examples/default/examples/error_handling/boxing_errors.v index 0dbcc9281..a2f277977 100644 --- a/CoqOfRust/examples/default/examples/error_handling/boxing_errors.v +++ b/CoqOfRust/examples/default/examples/error_handling/boxing_errors.v @@ -28,11 +28,9 @@ Section Impl_core_fmt_Debug_for_boxing_errors_EmptyVec_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "EmptyVec") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -51,10 +49,7 @@ Section Impl_core_clone_Clone_for_boxing_errors_EmptyVec_t. let* self := M.alloc self in M.pure boxing_errors.EmptyVec.Build. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -85,12 +80,10 @@ Section Impl_core_fmt_Display_for_boxing_errors_EmptyVec_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α4) in - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α5). + M.call (impl core.fmt.Arguments.t "new_const" α4) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; @@ -134,13 +127,13 @@ Definition double_first (Trait := ℐ))) in let* α1 : ref (slice (ref str.t)) := M.call (α0 (borrow vec)) in let* α2 : core.option.Option.t (ref (ref str.t)) := - M.call ((slice (ref str.t))::["first"] α1) in + M.call (impl (slice (ref str.t)) "first" α1) in let* α3 : core.result.Result.t (ref (ref str.t)) (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t) := M.call - ((core.option.Option.t (ref (ref str.t)))::["ok_or_else"] + (impl (core.option.Option.t (ref (ref str.t))) "ok_or_else" α2 ((let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -151,9 +144,11 @@ Definition double_first M.call (α0 boxing_errors.EmptyVec.Build)) : M (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t))) in M.call - ((core.result.Result.t + (impl + (core.result.Result.t (ref (ref str.t)) - (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t))::["and_then"] + (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t)) + "and_then" α3 (fun (α0 : ref (ref str.t)) => (let* α0 := M.alloc α0 in @@ -166,15 +161,17 @@ Definition double_first let* α1 : ref str.t := M.read (deref α0) in let* α2 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α1) in + M.call (impl str.t "parse" α1) in let* α3 : core.result.Result.t i32.t (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t) := M.call - ((core.result.Result.t + (impl + (core.result.Result.t i32.t - core.num.error.ParseIntError.t)::["map_err"] + core.num.error.ParseIntError.t) + "map_err" α2 (fun (α0 : core.num.error.ParseIntError.t) => (let* α0 := M.alloc α0 in @@ -205,11 +202,11 @@ Definition double_first _ (* dyn *) alloc.alloc.Global.t))) in M.call - ((core.result.Result.t + (impl + (core.result.Result.t i32.t - (alloc.boxed.Box.t - _ (* dyn *) - alloc.alloc.Global.t))::["map"] + (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t)) + "map" α3 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -263,7 +260,7 @@ Definition print (result : ltac:(boxing_errors.Result i32.t)) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -271,7 +268,7 @@ Definition print (result : ltac:(boxing_errors.Result i32.t)) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -294,7 +291,7 @@ Definition print (result : ltac:(boxing_errors.Result i32.t)) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -302,7 +299,7 @@ Definition print (result : ltac:(boxing_errors.Result i32.t)) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -336,11 +333,11 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* empty : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) "new") in M.alloc α0 in let* strings : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : ref str.t := M.read (mk_str "tofu") in @@ -353,7 +350,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := diff --git a/CoqOfRust/examples/default/examples/error_handling/combinators_and_then.v b/CoqOfRust/examples/default/examples/error_handling/combinators_and_then.v index 636c765fd..56687c278 100644 --- a/CoqOfRust/examples/default/examples/error_handling/combinators_and_then.v +++ b/CoqOfRust/examples/default/examples/error_handling/combinators_and_then.v @@ -64,11 +64,9 @@ Section Impl_core_fmt_Debug_for_combinators_and_then_Food_t. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -139,11 +137,9 @@ Section Impl_core_fmt_Debug_for_combinators_and_then_Day_t. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -296,7 +292,7 @@ Definition cookable_v2 let* α1 : core.option.Option.t combinators_and_then.Food.t := M.call (combinators_and_then.have_recipe α0) in M.call - ((core.option.Option.t combinators_and_then.Food.t)::["and_then"] + (impl (core.option.Option.t combinators_and_then.Food.t) "and_then" α1 combinators_and_then.have_ingredients). @@ -340,9 +336,10 @@ Definition eat let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow day)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow day)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow food)) in + M.call + (impl core.fmt.rt.Argument.t "new_debug" (borrow food)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -350,7 +347,7 @@ Definition eat let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -372,7 +369,7 @@ Definition eat let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow day)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow day)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -380,7 +377,7 @@ Definition eat let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/combinators_map.v b/CoqOfRust/examples/default/examples/error_handling/combinators_map.v index 060a530f5..941f9809d 100644 --- a/CoqOfRust/examples/default/examples/error_handling/combinators_map.v +++ b/CoqOfRust/examples/default/examples/error_handling/combinators_map.v @@ -64,11 +64,9 @@ Section Impl_core_fmt_Debug_for_combinators_map_Food_t. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -107,11 +105,9 @@ Section Impl_core_fmt_Debug_for_combinators_map_Peeled_t. M.alloc (borrow (combinators_map.Peeled.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref combinators_map.Food.t)) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -150,11 +146,9 @@ Section Impl_core_fmt_Debug_for_combinators_map_Chopped_t. M.alloc (borrow (combinators_map.Chopped.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref combinators_map.Food.t)) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -193,11 +187,9 @@ Section Impl_core_fmt_Debug_for_combinators_map_Cooked_t. M.alloc (borrow (combinators_map.Cooked.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref combinators_map.Food.t)) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -297,7 +289,7 @@ Definition cook let* chopped := M.alloc chopped in let* α0 : core.option.Option.t combinators_map.Chopped.t := M.read chopped in M.call - ((core.option.Option.t combinators_map.Chopped.t)::["map"] + (impl (core.option.Option.t combinators_map.Chopped.t) "map" α0 (fun (α0 : combinators_map.Chopped.t) => (let* α0 := M.alloc α0 in @@ -331,7 +323,7 @@ Definition process let* α0 : core.option.Option.t combinators_map.Food.t := M.read food in let* α1 : core.option.Option.t combinators_map.Peeled.t := M.call - ((core.option.Option.t combinators_map.Food.t)::["map"] + (impl (core.option.Option.t combinators_map.Food.t) "map" α0 (fun (α0 : combinators_map.Food.t) => (let* α0 := M.alloc α0 in @@ -347,7 +339,7 @@ Definition process M combinators_map.Peeled.t)) in let* α2 : core.option.Option.t combinators_map.Chopped.t := M.call - ((core.option.Option.t combinators_map.Peeled.t)::["map"] + (impl (core.option.Option.t combinators_map.Peeled.t) "map" α1 (fun (α0 : combinators_map.Peeled.t) => (let* α0 := M.alloc α0 in @@ -367,7 +359,7 @@ Definition process ]) : M combinators_map.Chopped.t)) in M.call - ((core.option.Option.t combinators_map.Chopped.t)::["map"] + (impl (core.option.Option.t combinators_map.Chopped.t) "map" α2 (fun (α0 : combinators_map.Chopped.t) => (let* α0 := M.alloc α0 in @@ -419,7 +411,8 @@ Definition eat let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow food)) in + M.call + (impl core.fmt.rt.Argument.t "new_debug" (borrow food)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -427,7 +420,7 @@ Definition eat let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -448,7 +441,7 @@ Definition eat let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/defining_an_error_type.v b/CoqOfRust/examples/default/examples/error_handling/defining_an_error_type.v index 8e0fe6af6..fedb0243b 100644 --- a/CoqOfRust/examples/default/examples/error_handling/defining_an_error_type.v +++ b/CoqOfRust/examples/default/examples/error_handling/defining_an_error_type.v @@ -22,11 +22,9 @@ Section Impl_core_fmt_Debug_for_defining_an_error_type_DoubleError_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "DoubleError") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -45,10 +43,7 @@ Section Impl_core_clone_Clone_for_defining_an_error_type_DoubleError_t. let* self := M.alloc self in M.pure defining_an_error_type.DoubleError.Build. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -82,12 +77,10 @@ Section Impl_core_fmt_Display_for_defining_an_error_type_DoubleError_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α4) in - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α5). + M.call (impl core.fmt.Arguments.t "new_const" α4) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; @@ -119,19 +112,21 @@ Definition double_first (Trait := ℐ))) in let* α1 : ref (slice (ref str.t)) := M.call (α0 (borrow vec)) in let* α2 : core.option.Option.t (ref (ref str.t)) := - M.call ((slice (ref str.t))::["first"] α1) in + M.call (impl (slice (ref str.t)) "first" α1) in let* α3 : core.result.Result.t (ref (ref str.t)) defining_an_error_type.DoubleError.t := M.call - ((core.option.Option.t (ref (ref str.t)))::["ok_or"] + (impl (core.option.Option.t (ref (ref str.t))) "ok_or" α2 defining_an_error_type.DoubleError.Build) in M.call - ((core.result.Result.t + (impl + (core.result.Result.t (ref (ref str.t)) - defining_an_error_type.DoubleError.t)::["and_then"] + defining_an_error_type.DoubleError.t) + "and_then" α3 (fun (α0 : ref (ref str.t)) => (let* α0 := M.alloc α0 in @@ -144,15 +139,17 @@ Definition double_first let* α1 : ref str.t := M.read (deref α0) in let* α2 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α1) in + M.call (impl str.t "parse" α1) in let* α3 : core.result.Result.t i32.t defining_an_error_type.DoubleError.t := M.call - ((core.result.Result.t + (impl + (core.result.Result.t i32.t - core.num.error.ParseIntError.t)::["map_err"] + core.num.error.ParseIntError.t) + "map_err" α2 (fun (α0 : core.num.error.ParseIntError.t) => (let* α0 := M.alloc α0 in @@ -165,9 +162,11 @@ Definition double_first ]) : M defining_an_error_type.DoubleError.t)) in M.call - ((core.result.Result.t + (impl + (core.result.Result.t i32.t - defining_an_error_type.DoubleError.t)::["map"] + defining_an_error_type.DoubleError.t) + "map" α3 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -220,7 +219,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -228,7 +227,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -251,7 +250,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -259,7 +258,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -293,11 +292,11 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* empty : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) "new") in M.alloc α0 in let* strings : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : ref str.t := M.read (mk_str "tofu") in @@ -310,7 +309,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := diff --git a/CoqOfRust/examples/default/examples/error_handling/early_returns.v b/CoqOfRust/examples/default/examples/error_handling/early_returns.v index 4e758abb5..d708c9fc9 100644 --- a/CoqOfRust/examples/default/examples/error_handling/early_returns.v +++ b/CoqOfRust/examples/default/examples/error_handling/early_returns.v @@ -29,7 +29,7 @@ Definition multiply (let* first_number : M.Val i32.t := let* α0 : ref str.t := M.read first_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in let* α2 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := M.alloc α1 in @@ -67,7 +67,7 @@ Definition multiply let* second_number : M.Val i32.t := let* α0 : ref str.t := M.read second_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in let* α2 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := M.alloc α1 in @@ -142,7 +142,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -150,7 +150,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -173,7 +173,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -181,7 +181,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark.v b/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark.v index 076d02bb7..83cc2887f 100644 --- a/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark.v +++ b/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark.v @@ -27,7 +27,7 @@ Definition multiply (Trait := ℐ))) in let* α1 : ref str.t := M.read first_number_str in let* α2 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α1) in + M.call (impl str.t "parse" α1) in let* α3 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -101,7 +101,7 @@ Definition multiply (Trait := ℐ))) in let* α1 : ref str.t := M.read second_number_str in let* α2 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α1) in + M.call (impl str.t "parse" α1) in let* α3 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -207,7 +207,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -215,7 +215,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -238,7 +238,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -246,7 +246,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v b/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v index 1ccd65315..de87cbdea 100644 --- a/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v +++ b/CoqOfRust/examples/default/examples/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v @@ -22,7 +22,7 @@ Definition multiply (let* first_number : M.Val i32.t := let* α0 : ref str.t := M.read first_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in let* α2 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := M.alloc α1 in @@ -67,7 +67,7 @@ Definition multiply let* second_number : M.Val i32.t := let* α0 : ref str.t := M.read second_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in let* α2 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := M.alloc α1 in @@ -149,7 +149,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -157,7 +157,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -180,7 +180,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -188,7 +188,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v index 4748fa321..962615314 100644 --- a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v +++ b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v @@ -25,7 +25,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -76,7 +76,7 @@ Definition main : M unit := fun γ => (let* s := M.copy γ in let* α0 : ref str.t := M.read s in - M.call (str.t::["parse"] α0)) : + M.call (impl str.t "parse" α0)) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t) ]) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t))) in @@ -91,9 +91,9 @@ Definition main : M unit := M.call (α0 α5 - (core.result.Result.t - i32.t - core.num.error.ParseIntError.t)::["is_ok"]) in + (impl + (core.result.Result.t i32.t core.num.error.ParseIntError.t) + "is_ok")) in let* α7 : M.Val ((alloc.vec.Vec.t @@ -128,7 +128,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow numbers)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow numbers)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -136,7 +137,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -152,7 +153,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow errors)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow errors)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -160,7 +161,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v index 6bbd5a11c..280512c06 100644 --- a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v +++ b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v @@ -27,7 +27,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -78,7 +78,7 @@ Definition main : M unit := fun γ => (let* s := M.copy γ in let* α0 : ref str.t := M.read s in - M.call (str.t::["parse"] α0)) : + M.call (impl str.t "parse" α0)) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t) ]) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t))) in @@ -93,9 +93,9 @@ Definition main : M unit := M.call (α0 α5 - (core.result.Result.t - i32.t - core.num.error.ParseIntError.t)::["is_ok"]) in + (impl + (core.result.Result.t i32.t core.num.error.ParseIntError.t) + "is_ok")) in let* α7 : M.Val ((alloc.vec.Vec.t @@ -175,9 +175,11 @@ Definition main : M unit := M.call (α1 α4 - (core.result.Result.t + (impl + (core.result.Result.t i32.t - core.num.error.ParseIntError.t)::["unwrap"]) in + core.num.error.ParseIntError.t) + "unwrap")) in let* α6 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := M.call (α0 α5) in M.alloc α6 in @@ -245,9 +247,11 @@ Definition main : M unit := M.call (α1 α4 - (core.result.Result.t + (impl + (core.result.Result.t i32.t - core.num.error.ParseIntError.t)::["unwrap_err"]) in + core.num.error.ParseIntError.t) + "unwrap_err")) in let* α6 : alloc.vec.Vec.t core.num.error.ParseIntError.t @@ -266,7 +270,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow numbers)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow numbers)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -274,7 +279,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -290,7 +295,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow errors)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow errors)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -298,7 +303,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v index 95cdb6581..cde0461ae 100644 --- a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v +++ b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v @@ -29,7 +29,7 @@ Definition main : M unit := let* α7 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α6) in let* α8 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α7) in + M.call (impl (slice (ref str.t)) "into_vec" α7) in M.alloc α8 in let* errors : M.Val @@ -37,9 +37,9 @@ Definition main : M unit := let* α0 : alloc.vec.Vec.t core.num.error.ParseIntError.t alloc.alloc.Global.t := M.call - (alloc.vec.Vec.t - core.num.error.ParseIntError.t - alloc.alloc.Global.t)::["new"] in + (impl + (alloc.vec.Vec.t core.num.error.ParseIntError.t alloc.alloc.Global.t) + "new") in M.alloc α0 in let* numbers : M.Val (alloc.vec.Vec.t u8.t alloc.alloc.Global.t) := let* α0 : _ := @@ -105,7 +105,7 @@ Definition main : M unit := fun γ => (let* s := M.copy γ in let* α0 : ref str.t := M.read s in - M.call (str.t::["parse"] α0)) : + M.call (impl str.t "parse" α0)) : M (core.result.Result.t u8.t core.num.error.ParseIntError.t) ]) : M (core.result.Result.t u8.t core.num.error.ParseIntError.t))) in @@ -135,9 +135,11 @@ Definition main : M unit := M.read r in let* α1 : core.result.Result.t u8.t unit := M.call - ((core.result.Result.t + (impl + (core.result.Result.t u8.t - core.num.error.ParseIntError.t)::["map_err"] + core.num.error.ParseIntError.t) + "map_err" α0 (fun (α0 : core.num.error.ParseIntError.t) => (let* α0 := M.alloc α0 in @@ -149,15 +151,17 @@ Definition main : M unit := let* α0 : core.num.error.ParseIntError.t := M.read e in M.call - ((alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t core.num.error.ParseIntError.t - alloc.alloc.Global.t)::["push"] + alloc.alloc.Global.t) + "push" (borrow_mut errors) α0)) : M unit ]) : M unit)) in - M.call ((core.result.Result.t u8.t unit)::["ok"] α1)) : + M.call (impl (core.result.Result.t u8.t unit) "ok" α1)) : M (core.option.Option.t u8.t) ]) : M (core.option.Option.t u8.t))) in @@ -173,14 +177,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow numbers)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow numbers)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -194,14 +198,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow errors)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow errors)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_fail_entire_operation_via_collect.v b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_fail_entire_operation_via_collect.v index 6b55a756d..3044d7132 100644 --- a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_fail_entire_operation_via_collect.v +++ b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_fail_entire_operation_via_collect.v @@ -21,7 +21,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* numbers : M.Val @@ -76,7 +76,7 @@ Definition main : M unit := fun γ => (let* s := M.copy γ in let* α0 : ref str.t := M.read s in - M.call (str.t::["parse"] α0)) : + M.call (impl str.t "parse" α0)) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t) ]) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t))) in @@ -96,14 +96,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow numbers)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow numbers)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_failed.v b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_failed.v index 458be0570..e795bb85d 100644 --- a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_failed.v +++ b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_failed.v @@ -21,7 +21,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* numbers : M.Val @@ -76,7 +76,7 @@ Definition main : M unit := fun γ => (let* s := M.copy γ in let* α0 : ref str.t := M.read s in - M.call (str.t::["parse"] α0)) : + M.call (impl str.t "parse" α0)) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t) ]) : M (core.result.Result.t i32.t core.num.error.ParseIntError.t))) in @@ -96,14 +96,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow numbers)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow numbers)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_handle_via_filter_map.v b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_handle_via_filter_map.v index a76557f1b..e5b56e8c4 100644 --- a/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_handle_via_filter_map.v +++ b/CoqOfRust/examples/default/examples/error_handling/iterating_over_results_handle_via_filter_map.v @@ -24,7 +24,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* numbers : M.Val (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) := let* α0 : _ := @@ -72,11 +72,13 @@ Definition main : M unit := core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.call - ((core.result.Result.t + (impl + (core.result.Result.t i32.t - core.num.error.ParseIntError.t)::["ok"] + core.num.error.ParseIntError.t) + "ok" α1)) : M (core.option.Option.t i32.t) ]) : @@ -93,14 +95,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow numbers)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow numbers)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_combinators.v b/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_combinators.v index ca5580b52..0c8984c22 100644 --- a/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_combinators.v +++ b/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_combinators.v @@ -18,9 +18,9 @@ Definition multiply let* second_number_str := M.alloc second_number_str in let* α0 : ref str.t := M.read first_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.call - ((core.result.Result.t i32.t core.num.error.ParseIntError.t)::["and_then"] + (impl (core.result.Result.t i32.t core.num.error.ParseIntError.t) "and_then" α1 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -32,11 +32,11 @@ Definition multiply let* α0 : ref str.t := M.read second_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in M.call - ((core.result.Result.t - i32.t - core.num.error.ParseIntError.t)::["map"] + (impl + (core.result.Result.t i32.t core.num.error.ParseIntError.t) + "map" α1 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -87,7 +87,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -95,7 +95,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -118,7 +118,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -126,7 +126,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_match.v b/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_match.v index 1f751a257..3b2387d68 100644 --- a/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_match.v +++ b/CoqOfRust/examples/default/examples/error_handling/map_in_result_via_match.v @@ -20,7 +20,7 @@ Definition multiply let* second_number_str := M.alloc second_number_str in let* α0 : ref str.t := M.read first_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in let* α2 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := M.alloc α1 in let* α3 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := @@ -36,7 +36,7 @@ Definition multiply let* α0 : ref str.t := M.read second_number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in let* α2 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := @@ -126,7 +126,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -134,7 +134,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -157,7 +157,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -165,7 +165,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/error_handling/multiple_error_types.v b/CoqOfRust/examples/default/examples/error_handling/multiple_error_types.v index 6e609a118..a8adcc19c 100644 --- a/CoqOfRust/examples/default/examples/error_handling/multiple_error_types.v +++ b/CoqOfRust/examples/default/examples/error_handling/multiple_error_types.v @@ -19,17 +19,17 @@ Definition double_first (Trait := ℐ))) in let* α1 : ref (slice (ref str.t)) := M.call (α0 (borrow vec)) in let* α2 : core.option.Option.t (ref (ref str.t)) := - M.call ((slice (ref str.t))::["first"] α1) in + M.call (impl (slice (ref str.t)) "first" α1) in let* α3 : ref (ref str.t) := - M.call ((core.option.Option.t (ref (ref str.t)))::["unwrap"] α2) in + M.call (impl (core.option.Option.t (ref (ref str.t))) "unwrap" α2) in M.alloc α3 in let* α0 : ref (ref str.t) := M.read first in let* α1 : ref str.t := M.read (deref α0) in let* α2 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α1) in + M.call (impl str.t "parse" α1) in let* α3 : i32.t := M.call - ((core.result.Result.t i32.t core.num.error.ParseIntError.t)::["unwrap"] + (impl (core.result.Result.t i32.t core.num.error.ParseIntError.t) "unwrap" α2) in let* α4 : i32.t := BinOp.Panic.mul ((Integer.of_Z 2) : i32.t) α3 in let* α0 : M.Val i32.t := M.alloc α4 in @@ -63,11 +63,11 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* empty : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) "new") in M.alloc α0 in let* strings : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : ref str.t := M.read (mk_str "tofu") in @@ -80,7 +80,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -96,14 +96,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (multiple_error_types.double_first α5) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -121,14 +121,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (multiple_error_types.double_first α5) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -146,14 +146,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (multiple_error_types.double_first α5) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/option_and_unwrap.v b/CoqOfRust/examples/default/examples/error_handling/option_and_unwrap.v index 27f925afa..60c3ba2de 100644 --- a/CoqOfRust/examples/default/examples/error_handling/option_and_unwrap.v +++ b/CoqOfRust/examples/default/examples/error_handling/option_and_unwrap.v @@ -31,7 +31,7 @@ Definition give_adult (drink : core.option.Option.t (ref str.t)) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -55,7 +55,7 @@ Definition give_adult (drink : core.option.Option.t (ref str.t)) : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow inner)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow inner)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -63,7 +63,7 @@ Definition give_adult (drink : core.option.Option.t (ref str.t)) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -83,7 +83,7 @@ Definition give_adult (drink : core.option.Option.t (ref str.t)) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -109,7 +109,7 @@ Definition drink (drink : core.option.Option.t (ref str.t)) : M unit := let* inside : M.Val (ref str.t) := let* α0 : core.option.Option.t (ref str.t) := M.read drink in let* α1 : ref str.t := - M.call ((core.option.Option.t (ref str.t))::["unwrap"] α0) in + M.call (impl (core.option.Option.t (ref str.t)) "unwrap" α0) in M.alloc α1 in let* _ : M.Val unit := let* α0 : _ := @@ -139,14 +139,14 @@ Definition drink (drink : core.option.Option.t (ref str.t)) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow inside)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow inside)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/other_uses_of_question_mark.v b/CoqOfRust/examples/default/examples/error_handling/other_uses_of_question_mark.v index 222a6ce3c..96a1cecaf 100644 --- a/CoqOfRust/examples/default/examples/error_handling/other_uses_of_question_mark.v +++ b/CoqOfRust/examples/default/examples/error_handling/other_uses_of_question_mark.v @@ -28,11 +28,9 @@ Section Impl_core_fmt_Debug_for_other_uses_of_question_mark_EmptyVec_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "EmptyVec") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -62,12 +60,10 @@ Section Impl_core_fmt_Display_for_other_uses_of_question_mark_EmptyVec_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α4) in - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α5). + M.call (impl core.fmt.Arguments.t "new_const" α4) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; @@ -119,13 +115,13 @@ Definition double_first (Trait := ℐ))) in let* α2 : ref (slice (ref str.t)) := M.call (α1 (borrow vec)) in let* α3 : core.option.Option.t (ref (ref str.t)) := - M.call ((slice (ref str.t))::["first"] α2) in + M.call (impl (slice (ref str.t)) "first" α2) in let* α4 : core.result.Result.t (ref (ref str.t)) other_uses_of_question_mark.EmptyVec.t := M.call - ((core.option.Option.t (ref (ref str.t)))::["ok_or"] + (impl (core.option.Option.t (ref (ref str.t))) "ok_or" α3 other_uses_of_question_mark.EmptyVec.Build) in let* α5 : @@ -204,7 +200,7 @@ Definition double_first let* α1 : ref (ref str.t) := M.read first in let* α2 : ref str.t := M.read (deref α1) in let* α3 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α2) in + M.call (impl str.t "parse" α2) in let* α4 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -314,7 +310,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -322,7 +318,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -345,7 +341,7 @@ Definition print let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -353,7 +349,7 @@ Definition print let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -387,11 +383,11 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* empty : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) "new") in M.alloc α0 in let* strings : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : ref str.t := M.read (mk_str "tofu") in @@ -404,7 +400,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := diff --git a/CoqOfRust/examples/default/examples/error_handling/panic.v b/CoqOfRust/examples/default/examples/error_handling/panic.v index c0b39eef5..b4d4e18bc 100644 --- a/CoqOfRust/examples/default/examples/error_handling/panic.v +++ b/CoqOfRust/examples/default/examples/error_handling/panic.v @@ -41,14 +41,14 @@ Definition drink (beverage : ref str.t) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow beverage)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow beverage)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options.v b/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options.v index ce507b8d5..ecb98f39e 100644 --- a/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options.v +++ b/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options.v @@ -20,9 +20,9 @@ Definition double_first (Trait := ℐ))) in let* α1 : ref (slice (ref str.t)) := M.call (α0 (borrow vec)) in let* α2 : core.option.Option.t (ref (ref str.t)) := - M.call ((slice (ref str.t))::["first"] α1) in + M.call (impl (slice (ref str.t)) "first" α1) in M.call - ((core.option.Option.t (ref (ref str.t)))::["map"] + (impl (core.option.Option.t (ref (ref str.t))) "map" α2 (fun (α0 : ref (ref str.t)) => (let* α0 := M.alloc α0 in @@ -35,11 +35,11 @@ Definition double_first let* α1 : ref str.t := M.read (deref α0) in let* α2 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α1) in + M.call (impl str.t "parse" α1) in M.call - ((core.result.Result.t - i32.t - core.num.error.ParseIntError.t)::["map"] + (impl + (core.result.Result.t i32.t core.num.error.ParseIntError.t) + "map" α2 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -85,11 +85,11 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* empty : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) "new") in M.alloc α0 in let* strings : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : ref str.t := M.read (mk_str "tofu") in @@ -102,7 +102,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -125,14 +125,14 @@ Definition main : M unit := (core.result.Result.t i32.t core.num.error.ParseIntError.t)) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -157,14 +157,14 @@ Definition main : M unit := (core.result.Result.t i32.t core.num.error.ParseIntError.t)) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -189,14 +189,14 @@ Definition main : M unit := (core.result.Result.t i32.t core.num.error.ParseIntError.t)) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options_with_stop_error_processing.v b/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options_with_stop_error_processing.v index 94eef154b..584dae60e 100644 --- a/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options_with_stop_error_processing.v +++ b/CoqOfRust/examples/default/examples/error_handling/pulling_results_out_of_options_with_stop_error_processing.v @@ -27,12 +27,12 @@ Definition double_first (Trait := ℐ))) in let* α1 : ref (slice (ref str.t)) := M.call (α0 (borrow vec)) in let* α2 : core.option.Option.t (ref (ref str.t)) := - M.call ((slice (ref str.t))::["first"] α1) in + M.call (impl (slice (ref str.t)) "first" α1) in let* α3 : core.option.Option.t (core.result.Result.t i32.t core.num.error.ParseIntError.t) := M.call - ((core.option.Option.t (ref (ref str.t)))::["map"] + (impl (core.option.Option.t (ref (ref str.t))) "map" α2 (fun (α0 : ref (ref str.t)) => (let* α0 := M.alloc α0 in @@ -47,11 +47,13 @@ Definition double_first core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α1) in + M.call (impl str.t "parse" α1) in M.call - ((core.result.Result.t + (impl + (core.result.Result.t i32.t - core.num.error.ParseIntError.t)::["map"] + core.num.error.ParseIntError.t) + "map" α2 (fun (α0 : i32.t) => (let* α0 := M.alloc α0 in @@ -78,10 +80,10 @@ Definition double_first (core.option.Option.t i32.t) core.num.error.ParseIntError.t := M.call - ((core.option.Option.t - (core.result.Result.t - i32.t - core.num.error.ParseIntError.t))::["map_or"] + (impl + (core.option.Option.t + (core.result.Result.t i32.t core.num.error.ParseIntError.t)) + "map_or" α0 (core.result.Result.Ok core.option.Option.None) (fun (α0 : core.result.Result.t i32.t core.num.error.ParseIntError.t) => @@ -95,9 +97,11 @@ Definition double_first core.result.Result.t i32.t core.num.error.ParseIntError.t := M.read r in M.call - ((core.result.Result.t + (impl + (core.result.Result.t i32.t - core.num.error.ParseIntError.t)::["map"] + core.num.error.ParseIntError.t) + "map" α0 core.option.Option.Some)) : M @@ -141,11 +145,11 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* empty : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) "new") in M.alloc α0 in let* strings : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : ref str.t := M.read (mk_str "tofu") in @@ -158,7 +162,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -185,14 +189,14 @@ Definition main : M unit := core.num.error.ParseIntError.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -221,14 +225,14 @@ Definition main : M unit := core.num.error.ParseIntError.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -257,14 +261,14 @@ Definition main : M unit := core.num.error.ParseIntError.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/result_use_in_main.v b/CoqOfRust/examples/default/examples/error_handling/result_use_in_main.v index 062007bf2..ea5ed7eb2 100644 --- a/CoqOfRust/examples/default/examples/error_handling/result_use_in_main.v +++ b/CoqOfRust/examples/default/examples/error_handling/result_use_in_main.v @@ -22,7 +22,7 @@ Definition main let* number : M.Val i32.t := let* α0 : ref str.t := M.read number_str in let* α1 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α0) in + M.call (impl str.t "parse" α0) in let* α2 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := M.alloc α1 in @@ -67,14 +67,14 @@ Definition main let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow number)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow number)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v index 821065bf6..2efc24f1e 100644 --- a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v +++ b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert.v @@ -91,11 +91,9 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_get_or_insert M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -133,8 +131,10 @@ Definition main : M unit := let* α1 : mut_ref unpacking_options_and_defaults_via_get_or_insert.Fruit.t := M.call - ((core.option.Option.t - unpacking_options_and_defaults_via_get_or_insert.Fruit.t)::["get_or_insert"] + (impl + (core.option.Option.t + unpacking_options_and_defaults_via_get_or_insert.Fruit.t) + "get_or_insert" (borrow_mut my_fruit) α0) in M.alloc α1 in @@ -149,7 +149,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow first_available_fruit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -157,7 +157,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -172,7 +172,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow first_available_fruit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -180,7 +180,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v index c900c021e..ea82e727a 100644 --- a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v +++ b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v @@ -101,11 +101,9 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_get_or_insert M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -159,7 +157,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -180,8 +178,10 @@ Definition main : M unit := let* α1 : mut_ref unpacking_options_and_defaults_via_get_or_insert_with.Fruit.t := M.call - ((core.option.Option.t - unpacking_options_and_defaults_via_get_or_insert_with.Fruit.t)::["get_or_insert_with"] + (impl + (core.option.Option.t + unpacking_options_and_defaults_via_get_or_insert_with.Fruit.t) + "get_or_insert_with" (borrow_mut my_fruit) α0) in M.alloc α1 in @@ -196,7 +196,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow first_available_fruit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -204,7 +204,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -219,7 +219,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow first_available_fruit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -227,7 +227,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -249,8 +249,10 @@ Definition main : M unit := let* α1 : mut_ref unpacking_options_and_defaults_via_get_or_insert_with.Fruit.t := M.call - ((core.option.Option.t - unpacking_options_and_defaults_via_get_or_insert_with.Fruit.t)::["get_or_insert_with"] + (impl + (core.option.Option.t + unpacking_options_and_defaults_via_get_or_insert_with.Fruit.t) + "get_or_insert_with" (borrow_mut my_apple) α0) in M.alloc α1 in @@ -265,14 +267,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow should_be_apple)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow should_be_apple)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -286,14 +288,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow my_apple)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow my_apple)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or.v b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or.v index 1e834594a..af918caf7 100644 --- a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or.v +++ b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or.v @@ -90,11 +90,9 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_or_Fruit_t. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -149,8 +147,9 @@ Definition main : M unit := let* α2 : core.option.Option.t unpacking_options_and_defaults_via_or.Fruit.t := M.call - ((core.option.Option.t - unpacking_options_and_defaults_via_or.Fruit.t)::["or"] + (impl + (core.option.Option.t unpacking_options_and_defaults_via_or.Fruit.t) + "or" α0 α1) in let* α3 : @@ -159,8 +158,9 @@ Definition main : M unit := let* α4 : core.option.Option.t unpacking_options_and_defaults_via_or.Fruit.t := M.call - ((core.option.Option.t - unpacking_options_and_defaults_via_or.Fruit.t)::["or"] + (impl + (core.option.Option.t unpacking_options_and_defaults_via_or.Fruit.t) + "or" α2 α3) in M.alloc α4 in @@ -175,7 +175,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow first_available_fruit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -183,7 +183,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or_else.v b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or_else.v index d1aa2e4d2..f1909c3e0 100644 --- a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or_else.v +++ b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_and_defaults_via_or_else.v @@ -90,11 +90,9 @@ Section Impl_core_fmt_Debug_for_unpacking_options_and_defaults_via_or_else_Fruit M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -154,7 +152,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -186,7 +184,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -219,8 +217,10 @@ Definition main : M unit := core.option.Option.t unpacking_options_and_defaults_via_or_else.Fruit.t := M.call - ((core.option.Option.t - unpacking_options_and_defaults_via_or_else.Fruit.t)::["or_else"] + (impl + (core.option.Option.t + unpacking_options_and_defaults_via_or_else.Fruit.t) + "or_else" α0 α1) in let* α3 : @@ -233,8 +233,10 @@ Definition main : M unit := core.option.Option.t unpacking_options_and_defaults_via_or_else.Fruit.t := M.call - ((core.option.Option.t - unpacking_options_and_defaults_via_or_else.Fruit.t)::["or_else"] + (impl + (core.option.Option.t + unpacking_options_and_defaults_via_or_else.Fruit.t) + "or_else" α2 α3) in M.alloc α4 in @@ -249,7 +251,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow first_available_fruit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -257,7 +259,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_via_question_mark.v b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_via_question_mark.v index 6742bebbf..f9f5b0197 100644 --- a/CoqOfRust/examples/default/examples/error_handling/unpacking_options_via_question_mark.v +++ b/CoqOfRust/examples/default/examples/error_handling/unpacking_options_via_question_mark.v @@ -53,10 +53,7 @@ Section Impl_core_clone_Clone_for_unpacking_options_via_question_mark_Job_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -122,10 +119,7 @@ Section Impl_core_clone_Clone_for_unpacking_options_via_question_mark_PhoneNumbe ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -287,10 +281,8 @@ Section Impl_unpacking_options_via_question_mark_Person_t. M.read (unpacking_options_via_question_mark.PhoneNumber.Get_area_code α10)). - Global Instance AssociatedFunction_work_phone_area_code : - Notations.DoubleColon Self "work_phone_area_code" := { - Notations.double_colon := work_phone_area_code; - }. + Axiom work_phone_area_code_is_impl : + impl Self "work_phone_area_code" = work_phone_area_code. End Impl_unpacking_options_via_question_mark_Person_t. End Impl_unpacking_options_via_question_mark_Person_t. @@ -329,7 +321,9 @@ Definition main : M unit := let* _ : M.Val unit := let* α0 : core.option.Option.t u8.t := M.call - (unpacking_options_via_question_mark.Person.t::["work_phone_area_code"] + (impl + unpacking_options_via_question_mark.Person.t + "work_phone_area_code" (borrow p)) in let* α1 : M.Val (core.option.Option.t u8.t) := M.alloc α0 in let* α2 : M.Val (core.option.Option.t u8.t) := diff --git a/CoqOfRust/examples/default/examples/error_handling/wrapping_errors.v b/CoqOfRust/examples/default/examples/error_handling/wrapping_errors.v index 74e6b2e84..dff8f5463 100644 --- a/CoqOfRust/examples/default/examples/error_handling/wrapping_errors.v +++ b/CoqOfRust/examples/default/examples/error_handling/wrapping_errors.v @@ -41,7 +41,7 @@ Section Impl_core_fmt_Debug_for_wrapping_errors_DoubleError_t. let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "EmptyVec") in let* α2 : core.result.Result.t unit core.fmt.Error.t := - M.call (core.fmt.Formatter.t::["write_str"] α0 α1) in + M.call (impl core.fmt.Formatter.t "write_str" α0 α1) in M.alloc α2 | _ => M.break_match end) : @@ -63,7 +63,7 @@ Section Impl_core_fmt_Debug_for_wrapping_errors_DoubleError_t. M.read (pointer_coercion "Unsize" α2) in let* α4 : core.result.Result.t unit core.fmt.Error.t := M.call - (core.fmt.Formatter.t::["debug_tuple_field1_finish"] + (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α3) in @@ -74,9 +74,7 @@ Section Impl_core_fmt_Debug_for_wrapping_errors_DoubleError_t. ] in M.read α0. - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -123,9 +121,9 @@ Section Impl_core_fmt_Display_for_wrapping_errors_DoubleError_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α4) in + M.call (impl core.fmt.Arguments.t "new_const" α4) in let* α6 : core.result.Result.t unit core.fmt.Error.t := - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α5) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α5) in M.alloc α6 | _ => M.break_match end) : @@ -144,9 +142,9 @@ Section Impl_core_fmt_Display_for_wrapping_errors_DoubleError_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α4) in + M.call (impl core.fmt.Arguments.t "new_const" α4) in let* α6 : core.result.Result.t unit core.fmt.Error.t := - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α5) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α5) in M.alloc α6 | _ => M.break_match end) : @@ -154,9 +152,7 @@ Section Impl_core_fmt_Display_for_wrapping_errors_DoubleError_t. ] in M.read α1. - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Display.Trait Self := { core.fmt.Display.fmt := fmt; @@ -214,10 +210,7 @@ Section Impl_core_error_Error_for_wrapping_errors_DoubleError_t. ] in M.read α1. - Global Instance AssociatedFunction_source : - Notations.DoubleColon Self "source" := { - Notations.double_colon := source; - }. + Axiom source_is_impl : impl Self "source" = source. Global Instance ℐ : core.error.Error.Required.Trait Self := { core.error.Error.source := Datatypes.Some source; @@ -245,10 +238,7 @@ Section Impl_core_convert_From_core_num_error_ParseIntError_t_for_wrapping_error let* α0 : core.num.error.ParseIntError.t := M.read err in M.pure (wrapping_errors.DoubleError.Parse α0). - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := core.num.error.ParseIntError.t) := { @@ -289,13 +279,13 @@ Definition double_first (Trait := ℐ))) in let* α2 : ref (slice (ref str.t)) := M.call (α1 (borrow vec)) in let* α3 : core.option.Option.t (ref (ref str.t)) := - M.call ((slice (ref str.t))::["first"] α2) in + M.call (impl (slice (ref str.t)) "first" α2) in let* α4 : core.result.Result.t (ref (ref str.t)) wrapping_errors.DoubleError.t := M.call - ((core.option.Option.t (ref (ref str.t)))::["ok_or"] + (impl (core.option.Option.t (ref (ref str.t))) "ok_or" α3 wrapping_errors.DoubleError.EmptyVec) in let* α5 : @@ -372,7 +362,7 @@ Definition double_first let* α1 : ref (ref str.t) := M.read first in let* α2 : ref str.t := M.read (deref α1) in let* α3 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α2) in + M.call (impl str.t "parse" α2) in let* α4 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -480,7 +470,7 @@ Definition print (result : ltac:(wrapping_errors.Result i32.t)) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -488,7 +478,7 @@ Definition print (result : ltac:(wrapping_errors.Result i32.t)) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -512,7 +502,8 @@ Definition print (result : ltac:(wrapping_errors.Result i32.t)) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -520,7 +511,7 @@ Definition print (result : ltac:(wrapping_errors.Result i32.t)) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -556,7 +547,7 @@ Definition print (result : ltac:(wrapping_errors.Result i32.t)) : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow source)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -565,7 +556,7 @@ Definition print (result : ltac:(wrapping_errors.Result i32.t)) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -605,11 +596,11 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* empty : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) "new") in M.alloc α0 in let* strings : M.Val (alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t) := let* α0 : ref str.t := M.read (mk_str "tofu") in @@ -622,7 +613,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* α0 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := diff --git a/CoqOfRust/examples/default/examples/expressions/blocks.v b/CoqOfRust/examples/default/examples/expressions/blocks.v index 97bfc6503..5850a4e8d 100644 --- a/CoqOfRust/examples/default/examples/expressions/blocks.v +++ b/CoqOfRust/examples/default/examples/expressions/blocks.v @@ -61,14 +61,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow x)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow x)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -82,14 +82,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow y)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -103,14 +103,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow z)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow z)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/expressions/const_underscore_expression.v b/CoqOfRust/examples/default/examples/expressions/const_underscore_expression.v index cf1dea8ec..81977b72d 100644 --- a/CoqOfRust/examples/default/examples/expressions/const_underscore_expression.v +++ b/CoqOfRust/examples/default/examples/expressions/const_underscore_expression.v @@ -45,10 +45,7 @@ Section Impl_const_underscore_expression_BarTrait_for_const_underscore_expressio let* self := M.alloc self in M.read (const_underscore_expression.Bar.Get_test self). - Global Instance AssociatedFunction_show : - Notations.DoubleColon Self "show" := { - Notations.double_colon := show; - }. + Axiom show_is_impl : impl Self "show" = show. Global Instance ℐ : const_underscore_expression.BarTrait.Trait Self := { const_underscore_expression.BarTrait.show := show; diff --git a/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_into_iter.v b/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_into_iter.v index 7f5b0efbd..c16260ced 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_into_iter.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_into_iter.v @@ -29,7 +29,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -107,7 +107,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_const"] α3) in + (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in @@ -126,7 +126,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow name)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -137,7 +137,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α4 α8) in + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter.v b/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter.v index 435145315..1715f9f74 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter.v @@ -29,7 +29,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* α0 : _ := @@ -44,7 +44,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α2 : ref (slice (ref str.t)) := M.call (α1 (borrow names)) in let* α3 : core.slice.iter.Iter.t (ref str.t) := - M.call ((slice (ref str.t))::["iter"] α2) in + M.call (impl (slice (ref str.t)) "iter" α2) in let* α4 : core.slice.iter.Iter.t (ref str.t) := M.call (α0 α3) in let* α5 : M.Val (core.slice.iter.Iter.t (ref str.t)) := M.alloc α4 in let* α6 : M.Val unit := @@ -105,7 +105,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_const"] α3) in + (impl core.fmt.Arguments.t "new_const" + α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in @@ -125,7 +126,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow name)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := @@ -138,7 +139,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α4 α8) in + (impl core.fmt.Arguments.t "new_v1" + α4 + α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in @@ -163,14 +166,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow names)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow names)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter_mut.v b/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter_mut.v index 33b44e4b6..ac14415c9 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter_mut.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/for_and_iterators_iter_mut.v @@ -28,7 +28,7 @@ Definition main : M unit := let* α5 : alloc.boxed.Box.t (slice (ref str.t)) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α4) in let* α6 : alloc.vec.Vec.t (ref str.t) alloc.alloc.Global.t := - M.call ((slice (ref str.t))::["into_vec"] α5) in + M.call (impl (slice (ref str.t)) "into_vec" α5) in M.alloc α6 in let* _ : M.Val unit := let* α0 : _ := @@ -43,7 +43,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α2 : mut_ref (slice (ref str.t)) := M.call (α1 (borrow_mut names)) in let* α3 : core.slice.iter.IterMut.t (ref str.t) := - M.call ((slice (ref str.t))::["iter_mut"] α2) in + M.call (impl (slice (ref str.t)) "iter_mut" α2) in let* α4 : core.slice.iter.IterMut.t (ref str.t) := M.call (α0 α3) in let* α5 : M.Val (core.slice.iter.IterMut.t (ref str.t)) := M.alloc α4 in let* α6 : M.Val unit := @@ -123,14 +123,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow names)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow names)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_completely_inclusive.v b/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_completely_inclusive.v index f40bfa5b3..bc38f074f 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_completely_inclusive.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_completely_inclusive.v @@ -26,7 +26,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α1 : core.ops.range.RangeInclusive.t i32.t := M.call - ((core.ops.range.RangeInclusive.t i32.t)::["new"] + (impl (core.ops.range.RangeInclusive.t i32.t) "new" ((Integer.of_Z 1) : i32.t) ((Integer.of_Z 100) : i32.t)) in let* α2 : core.ops.range.RangeInclusive.t i32.t := M.call (α0 α1) in @@ -86,7 +86,8 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call + (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -112,7 +113,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_const"] α3) in + (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in @@ -140,7 +141,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_const"] α3) in + (impl core.fmt.Arguments.t "new_const" + α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in @@ -160,7 +162,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := @@ -173,7 +175,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α4 α8) in + (impl core.fmt.Arguments.t "new_v1" + α4 + α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_inclusive_to_exclusive.v b/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_inclusive_to_exclusive.v index 16bf57858..23402f0b4 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_inclusive_to_exclusive.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/for_and_range_inclusive_to_exclusive.v @@ -87,7 +87,8 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call + (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -113,7 +114,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_const"] α3) in + (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in @@ -141,7 +142,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_const"] α3) in + (impl core.fmt.Arguments.t "new_const" + α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in @@ -161,7 +163,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := @@ -174,7 +176,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α4 α8) in + (impl core.fmt.Arguments.t "new_v1" + α4 + α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/if_else.v b/CoqOfRust/examples/default/examples/flow_of_control/if_else.v index 6b430092c..c1f036b32 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/if_else.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/if_else.v @@ -48,14 +48,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -75,14 +75,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -97,14 +97,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -130,7 +130,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -148,7 +148,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -167,16 +167,16 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow big_n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow big_n)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/if_let.v b/CoqOfRust/examples/default/examples/flow_of_control/if_let.v index 2b02e779c..26e0e6430 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/if_let.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/if_let.v @@ -66,7 +66,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -74,7 +74,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -105,7 +105,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -113,7 +113,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -134,7 +134,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -163,7 +163,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -171,7 +171,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -195,7 +195,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -214,7 +214,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/if_let_challenge.v b/CoqOfRust/examples/default/examples/flow_of_control/if_let_challenge.v index d73593f2a..bbed1c9ef 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/if_let_challenge.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/if_let_challenge.v @@ -38,7 +38,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/if_let_dont_use_match.v b/CoqOfRust/examples/default/examples/flow_of_control/if_let_dont_use_match.v index 7b04efb23..4604e1586 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/if_let_dont_use_match.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/if_let_dont_use_match.v @@ -44,7 +44,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -52,7 +52,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/if_let_match_enum_values.v b/CoqOfRust/examples/default/examples/flow_of_control/if_let_match_enum_values.v index f47823c88..00026101a 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/if_let_match_enum_values.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/if_let_match_enum_values.v @@ -69,7 +69,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -97,7 +97,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -129,7 +129,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow value)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow value)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -137,7 +138,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -167,7 +168,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/infinite_loop.v b/CoqOfRust/examples/default/examples/flow_of_control/infinite_loop.v index 31b16e68a..06c7918a0 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/infinite_loop.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/infinite_loop.v @@ -41,7 +41,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -68,7 +68,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -88,14 +88,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow count)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow count)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -113,7 +113,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/loop_nesting_and_labels.v b/CoqOfRust/examples/default/examples/flow_of_control/loop_nesting_and_labels.v index 01595408e..468859f5f 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/loop_nesting_and_labels.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/loop_nesting_and_labels.v @@ -35,7 +35,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -53,7 +53,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -71,7 +71,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -85,7 +85,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match.v b/CoqOfRust/examples/default/examples/flow_of_control/match.v index 013766618..18aa79b09 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match.v @@ -45,14 +45,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow number)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow number)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -69,7 +69,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -83,7 +83,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -97,7 +97,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -111,7 +111,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -125,7 +125,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -139,7 +139,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -153,7 +153,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -167,7 +167,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -194,16 +194,16 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow boolean)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow boolean)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow binary)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow binary)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_binding.v b/CoqOfRust/examples/default/examples/flow_of_control/match_binding.v index f35671040..9375869b1 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_binding.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_binding.v @@ -36,7 +36,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -56,7 +56,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -72,14 +72,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt) : @@ -95,14 +95,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt) : @@ -119,14 +119,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt) : diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_binding_destructure_enum_variants.v b/CoqOfRust/examples/default/examples/flow_of_control/match_binding_destructure_enum_variants.v index c3bda64e2..bff39dbfb 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_binding_destructure_enum_variants.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_binding_destructure_enum_variants.v @@ -47,7 +47,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -55,7 +55,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -78,7 +78,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -86,7 +86,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_arrays_slices.v b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_arrays_slices.v index 0b3304c7f..4a3699144 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_arrays_slices.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_arrays_slices.v @@ -75,10 +75,10 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow second)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow second)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow third)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow third)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -86,7 +86,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -114,7 +114,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow third)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow third)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -122,7 +122,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -150,7 +150,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow second)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow second)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -158,7 +158,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -188,9 +188,10 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow second)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow second)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow tail)) in + M.call + (impl core.fmt.rt.Argument.t "new_debug" (borrow tail)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -198,7 +199,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -217,11 +218,14 @@ Definition main : M unit := let* α6 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow first)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow first)) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow middle)) in + M.call + (impl core.fmt.rt.Argument.t "new_debug" (borrow middle)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow last)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow last)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -229,7 +233,7 @@ Definition main : M unit := let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt) : diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_enums.v b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_enums.v index b5d2c7c4e..fd5661bfb 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_enums.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_enums.v @@ -161,7 +161,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -182,7 +182,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -202,7 +202,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -222,7 +222,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -252,11 +252,11 @@ Definition main : M unit := let* α6 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow r)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow r)) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow g)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow g)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow b)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow b)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -264,7 +264,7 @@ Definition main : M unit := let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt @@ -294,11 +294,11 @@ Definition main : M unit := let* α6 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow h)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow h)) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow v)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow v)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -306,7 +306,7 @@ Definition main : M unit := let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt @@ -336,11 +336,11 @@ Definition main : M unit := let* α6 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow h)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow h)) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow l)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow l)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -348,7 +348,7 @@ Definition main : M unit := let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt @@ -378,11 +378,11 @@ Definition main : M unit := let* α6 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow c)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow c)) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow m)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow m)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow y)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -390,7 +390,7 @@ Definition main : M unit := let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt @@ -423,13 +423,13 @@ Definition main : M unit := let* α7 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow c)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow c)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow m)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow m)) in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow y)) in let* α11 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow k)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow k)) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α9; α10; α11 ] in let* α13 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -437,7 +437,7 @@ Definition main : M unit := let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α7 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α7 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_pointers_ref.v b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_pointers_ref.v index fba33bab6..29427a013 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_pointers_ref.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_pointers_ref.v @@ -77,14 +77,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow val)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow val)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt) : @@ -107,14 +107,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow val)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow val)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt) : @@ -148,7 +148,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow r)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow r)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -156,7 +156,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt) : @@ -187,7 +187,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow m)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow m)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -195,7 +195,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_structs.v b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_structs.v index 1190e1143..4eca8706e 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_structs.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_structs.v @@ -77,9 +77,11 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow b)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow b)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow y)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow y)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -87,7 +89,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -116,7 +118,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -124,7 +126,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -147,7 +149,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow y)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -155,7 +157,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples.v b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples.v index f4aa96366..5578be7af 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples.v @@ -37,14 +37,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow triple)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow triple)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -72,9 +72,9 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow y)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow z)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow z)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -82,7 +82,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -103,7 +103,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -124,7 +124,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -148,7 +148,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -164,7 +164,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples_fixed.v b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples_fixed.v index 80a23adfb..930f1c229 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples_fixed.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_destructuring_tuples_fixed.v @@ -37,14 +37,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow triple)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow triple)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -72,9 +72,9 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow y)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow z)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow z)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -82,7 +82,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -105,7 +105,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -126,7 +126,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -151,7 +151,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -167,7 +167,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_guards.v b/CoqOfRust/examples/default/examples/flow_of_control/match_guards.v index 79ca05516..cb218e547 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_guards.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_guards.v @@ -57,7 +57,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -65,7 +65,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -88,7 +88,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -96,7 +96,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -120,7 +120,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -128,7 +128,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -152,7 +152,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -160,7 +160,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/flow_of_control/match_guards_unreachable.v b/CoqOfRust/examples/default/examples/flow_of_control/match_guards_unreachable.v index c494012c6..333822d32 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/match_guards_unreachable.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/match_guards_unreachable.v @@ -30,7 +30,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -45,7 +45,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : diff --git a/CoqOfRust/examples/default/examples/flow_of_control/while.v b/CoqOfRust/examples/default/examples/flow_of_control/while.v index 78ada3a17..244c1b491 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/while.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/while.v @@ -50,7 +50,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -72,7 +72,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -95,7 +95,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -113,7 +113,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -121,7 +122,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/while_let.v b/CoqOfRust/examples/default/examples/flow_of_control/while_let.v index c9e69e516..525555d5c 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/while_let.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/while_let.v @@ -54,7 +54,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -74,7 +74,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -82,7 +82,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/flow_of_control/while_let_match_is_weird.v b/CoqOfRust/examples/default/examples/flow_of_control/while_let_match_is_weird.v index fd34031d4..cfc9bb264 100644 --- a/CoqOfRust/examples/default/examples/flow_of_control/while_let_match_is_weird.v +++ b/CoqOfRust/examples/default/examples/flow_of_control/while_let_match_is_weird.v @@ -59,7 +59,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -79,7 +79,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -87,7 +87,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/associated_functions_and_methods.v b/CoqOfRust/examples/default/examples/functions/associated_functions_and_methods.v index ded0acc4f..f58c16bb5 100644 --- a/CoqOfRust/examples/default/examples/functions/associated_functions_and_methods.v +++ b/CoqOfRust/examples/default/examples/functions/associated_functions_and_methods.v @@ -33,10 +33,7 @@ Section Impl_associated_functions_and_methods_Point_t. associated_functions_and_methods.Point.x := α1; |}. - Global Instance AssociatedFunction_origin : - Notations.DoubleColon Self "origin" := { - Notations.double_colon := origin; - }. + Axiom origin_is_impl : impl Self "origin" = origin. (* fn new(x: f64, y: f64) -> Point { @@ -57,9 +54,7 @@ Section Impl_associated_functions_and_methods_Point_t. associated_functions_and_methods.Point.y := α1; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_associated_functions_and_methods_Point_t. End Impl_associated_functions_and_methods_Point_t. @@ -93,10 +88,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. let* α0 : ref associated_functions_and_methods.Rectangle.t := M.read self in M.read (associated_functions_and_methods.Rectangle.Get_p1 (deref α0)). - Global Instance AssociatedFunction_get_p1 : - Notations.DoubleColon Self "get_p1" := { - Notations.double_colon := get_p1; - }. + Axiom get_p1_is_impl : impl Self "get_p1" = get_p1. (* fn area(&self) -> f64 { @@ -156,7 +148,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. let* α4 : f64.t := M.read y2 in let* α5 : f64.t := BinOp.Panic.sub α3 α4 in let* α6 : f64.t := BinOp.Panic.mul α2 α5 in - let* α7 : f64.t := M.call (f64.t::["abs"] α6) in + let* α7 : f64.t := M.call (impl f64.t "abs" α6) in M.alloc α7 end) : M (M.Val f64.t) @@ -166,10 +158,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. ] in M.read α1. - Global Instance AssociatedFunction_area : - Notations.DoubleColon Self "area" := { - Notations.double_colon := area; - }. + Axiom area_is_impl : impl Self "area" = area. (* fn perimeter(&self) -> f64 { @@ -224,11 +213,11 @@ Section Impl_associated_functions_and_methods_Rectangle_t. let* α1 : f64.t := M.read x1 in let* α2 : f64.t := M.read x2 in let* α3 : f64.t := BinOp.Panic.sub α1 α2 in - let* α4 : f64.t := M.call (f64.t::["abs"] α3) in + let* α4 : f64.t := M.call (impl f64.t "abs" α3) in let* α5 : f64.t := M.read y1 in let* α6 : f64.t := M.read y2 in let* α7 : f64.t := BinOp.Panic.sub α5 α6 in - let* α8 : f64.t := M.call (f64.t::["abs"] α7) in + let* α8 : f64.t := M.call (impl f64.t "abs" α7) in let* α9 : f64.t := BinOp.Panic.add α4 α8 in let* α10 : f64.t := BinOp.Panic.mul α0 α9 in M.alloc α10 @@ -240,10 +229,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. ] in M.read α1. - Global Instance AssociatedFunction_perimeter : - Notations.DoubleColon Self "perimeter" := { - Notations.double_colon := perimeter; - }. + Axiom perimeter_is_impl : impl Self "perimeter" = perimeter. (* fn translate(&mut self, x: f64, y: f64) { @@ -305,10 +291,7 @@ Section Impl_associated_functions_and_methods_Rectangle_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_translate : - Notations.DoubleColon Self "translate" := { - Notations.double_colon := translate; - }. + Axiom translate_is_impl : impl Self "translate" = translate. End Impl_associated_functions_and_methods_Rectangle_t. End Impl_associated_functions_and_methods_Rectangle_t. @@ -368,11 +351,11 @@ Section Impl_associated_functions_and_methods_Pair_t. M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow first)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow second)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in @@ -381,7 +364,7 @@ Section Impl_associated_functions_and_methods_Pair_t. let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -391,10 +374,7 @@ Section Impl_associated_functions_and_methods_Pair_t. ] in M.read α0. - Global Instance AssociatedFunction_destroy : - Notations.DoubleColon Self "destroy" := { - Notations.double_colon := destroy; - }. + Axiom destroy_is_impl : impl Self "destroy" = destroy. End Impl_associated_functions_and_methods_Pair_t. End Impl_associated_functions_and_methods_Pair_t. @@ -438,11 +418,11 @@ fn main() { Definition main : M unit := let* rectangle : M.Val associated_functions_and_methods.Rectangle.t := let* α0 : associated_functions_and_methods.Point.t := - M.call associated_functions_and_methods.Point.t::["origin"] in + M.call (impl associated_functions_and_methods.Point.t "origin") in let* α1 : f64.t := M.read (UnsupportedLiteral : M.Val f64.t) in let* α2 : f64.t := M.read (UnsupportedLiteral : M.Val f64.t) in let* α3 : associated_functions_and_methods.Point.t := - M.call (associated_functions_and_methods.Point.t::["new"] α1 α2) in + M.call (impl associated_functions_and_methods.Point.t "new" α1 α2) in M.alloc {| associated_functions_and_methods.Rectangle.p1 := α0; @@ -459,18 +439,18 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : f64.t := M.call - (associated_functions_and_methods.Rectangle.t::["perimeter"] + (impl associated_functions_and_methods.Rectangle.t "perimeter" (borrow rectangle)) in let* α6 : M.Val f64.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -485,28 +465,28 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : f64.t := M.call - (associated_functions_and_methods.Rectangle.t::["area"] + (impl associated_functions_and_methods.Rectangle.t "area" (borrow rectangle)) in let* α6 : M.Val f64.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in let* square : M.Val associated_functions_and_methods.Rectangle.t := let* α0 : associated_functions_and_methods.Point.t := - M.call associated_functions_and_methods.Point.t::["origin"] in + M.call (impl associated_functions_and_methods.Point.t "origin") in let* α1 : f64.t := M.read (UnsupportedLiteral : M.Val f64.t) in let* α2 : f64.t := M.read (UnsupportedLiteral : M.Val f64.t) in let* α3 : associated_functions_and_methods.Point.t := - M.call (associated_functions_and_methods.Point.t::["new"] α1 α2) in + M.call (impl associated_functions_and_methods.Point.t "new" α1 α2) in M.alloc {| associated_functions_and_methods.Rectangle.p1 := α0; @@ -517,7 +497,7 @@ Definition main : M unit := let* α1 : f64.t := M.read (UnsupportedLiteral : M.Val f64.t) in let* α2 : unit := M.call - (associated_functions_and_methods.Rectangle.t::["translate"] + (impl associated_functions_and_methods.Rectangle.t "translate" (borrow_mut square) α0 α1) in @@ -525,17 +505,17 @@ Definition main : M unit := let* pair : M.Val associated_functions_and_methods.Pair.t := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 1) : i32.t)) in let* α1 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 2) : i32.t)) in M.alloc (associated_functions_and_methods.Pair.Build_t α0 α1) in let* _ : M.Val unit := let* α0 : associated_functions_and_methods.Pair.t := M.read pair in let* α1 : unit := - M.call (associated_functions_and_methods.Pair.t::["destroy"] α0) in + M.call (impl associated_functions_and_methods.Pair.t "destroy" α0) in M.alloc α1 in let* α0 : M.Val unit := M.alloc tt in M.read α0. diff --git a/CoqOfRust/examples/default/examples/functions/diverging_functions_example_sum_odd_numbers.v b/CoqOfRust/examples/default/examples/functions/diverging_functions_example_sum_odd_numbers.v index c6724e0f2..cb1865fb2 100644 --- a/CoqOfRust/examples/default/examples/functions/diverging_functions_example_sum_odd_numbers.v +++ b/CoqOfRust/examples/default/examples/functions/diverging_functions_example_sum_odd_numbers.v @@ -42,14 +42,14 @@ Definition main : M unit := M.call ("unimplemented parent_kind" ((Integer.of_Z 9) : u32.t)) in let* α6 : M.Val u32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/diverging_functions_no_info_in_return_type.v b/CoqOfRust/examples/default/examples/functions/diverging_functions_no_info_in_return_type.v index 17ca41b2e..a648ef806 100644 --- a/CoqOfRust/examples/default/examples/functions/diverging_functions_no_info_in_return_type.v +++ b/CoqOfRust/examples/default/examples/functions/diverging_functions_no_info_in_return_type.v @@ -29,7 +29,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in let* α0 : M.Val unit := M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions.v b/CoqOfRust/examples/default/examples/functions/functions.v index 5597001f4..8663fcbc7 100644 --- a/CoqOfRust/examples/default/examples/functions/functions.v +++ b/CoqOfRust/examples/default/examples/functions/functions.v @@ -82,7 +82,7 @@ Definition fizzbuzz (n : u32.t) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -103,7 +103,7 @@ Definition fizzbuzz (n : u32.t) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -125,7 +125,7 @@ Definition fizzbuzz (n : u32.t) : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -142,7 +142,7 @@ Definition fizzbuzz (n : u32.t) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow n)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow n)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -150,7 +150,7 @@ Definition fizzbuzz (n : u32.t) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -174,7 +174,7 @@ Definition fizzbuzz_to (n : u32.t) : M unit := let* α1 : u32.t := M.read n in let* α2 : core.ops.range.RangeInclusive.t u32.t := M.call - ((core.ops.range.RangeInclusive.t u32.t)::["new"] + (impl (core.ops.range.RangeInclusive.t u32.t) "new" ((Integer.of_Z 1) : u32.t) α1) in let* α3 : core.ops.range.RangeInclusive.t u32.t := M.call (α0 α2) in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures.v b/CoqOfRust/examples/default/examples/functions/functions_closures.v index 02b473945..7dfc28292 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures.v @@ -82,14 +82,14 @@ Definition main : M unit := M.call (α5 (borrow closure_annotated) ((Integer.of_Z 1) : i32.t)) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -112,14 +112,14 @@ Definition main : M unit := M.call (α5 (borrow closure_inferred) ((Integer.of_Z 1) : i32.t)) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -143,14 +143,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (α5 (borrow one) tt) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_as_input_parameters.v b/CoqOfRust/examples/default/examples/functions/functions_closures_as_input_parameters.v index 26caa260e..16e8b0832 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_as_input_parameters.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_as_input_parameters.v @@ -109,14 +109,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow greeting)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow greeting)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -124,7 +124,7 @@ Definition main : M unit := let* α0 : ref str.t := M.read (mk_str "!!!") in let* α1 : unit := M.call - (alloc.string.String.t::["push_str"] (borrow_mut farewell) α0) in + (impl alloc.string.String.t "push_str" (borrow_mut farewell) α0) in M.alloc α1 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -137,14 +137,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow farewell)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow farewell)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -157,7 +157,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -201,14 +201,14 @@ Definition main : M unit := M.call (functions_closures_as_input_parameters.apply_to_3 α5) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_as_output_parameters.v b/CoqOfRust/examples/default/examples/functions/functions_closures_as_output_parameters.v index 993e977bc..7453b23da 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_as_output_parameters.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_as_output_parameters.v @@ -27,14 +27,14 @@ Definition create_fn : M _ (* OpaqueTy *) := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow text)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow text)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in let* α0 : M.Val unit := M.alloc tt in @@ -70,14 +70,14 @@ Definition create_fnmut : M _ (* OpaqueTy *) := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow text)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow text)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in let* α0 : M.Val unit := M.alloc tt in @@ -111,14 +111,14 @@ Definition create_fnonce : M _ (* OpaqueTy *) := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow text)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow text)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in let* α0 : M.Val unit := M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_capturing.v b/CoqOfRust/examples/default/examples/functions/functions_closures_capturing.v index cd6a89cc0..20f50daf2 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_capturing.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_capturing.v @@ -92,14 +92,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow color)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow color)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in let* α0 : M.Val unit := M.alloc tt in @@ -144,14 +144,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow count)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow count)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -181,7 +181,7 @@ Definition main : M unit := let* movable : M.Val (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 3) : i32.t)) in M.alloc α0 in let* consume : M.Val (unit -> M unit) := @@ -196,14 +196,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow movable)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow movable)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_example_Iterator_any.v b/CoqOfRust/examples/default/examples/functions/functions_closures_example_Iterator_any.v index 1acd2d03e..39b30e60f 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_example_Iterator_any.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_example_Iterator_any.v @@ -43,7 +43,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* vec2 : M.Val (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) := let* α0 : M.Val (array i32.t) := @@ -58,7 +58,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -82,7 +82,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α7 : ref (slice i32.t) := M.call (α6 (borrow vec1)) in let* α8 : core.slice.iter.Iter.t i32.t := - M.call ((slice i32.t)::["iter"] α7) in + M.call (impl (slice i32.t) "iter" α7) in let* α9 : M.Val (core.slice.iter.Iter.t i32.t) := M.alloc α8 in let* α10 : bool.t := M.call @@ -105,14 +105,14 @@ Definition main : M unit := M bool.t)) in let* α11 : M.Val bool.t := M.alloc α10 in let* α12 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α11)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α11)) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α12 ] in let* α14 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α13) in let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in @@ -160,14 +160,14 @@ Definition main : M unit := M bool.t)) in let* α11 : M.Val bool.t := M.alloc α10 in let* α12 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α11)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α11)) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α12 ] in let* α14 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α13) in let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in @@ -182,18 +182,18 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : usize.t := M.call - ((alloc.vec.Vec.t i32.t alloc.alloc.Global.t)::["len"] + (impl (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) "len" (borrow vec1)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -215,14 +215,14 @@ Definition main : M unit := let* α6 : ref i32.t := M.call (α5 (borrow vec1) ((Integer.of_Z 0) : usize.t)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] α6) in + M.call (impl core.fmt.rt.Argument.t "new_display" α6) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -258,7 +258,7 @@ Definition main : M unit := let* α6 : M.Val (ref (array i32.t)) := M.alloc (borrow array1) in let* α7 : ref (slice i32.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.slice.iter.Iter.t i32.t := - M.call ((slice i32.t)::["iter"] α7) in + M.call (impl (slice i32.t) "iter" α7) in let* α9 : M.Val (core.slice.iter.Iter.t i32.t) := M.alloc α8 in let* α10 : bool.t := M.call @@ -281,14 +281,14 @@ Definition main : M unit := M bool.t)) in let* α11 : M.Val bool.t := M.alloc α10 in let* α12 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α11)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α11)) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α12 ] in let* α14 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α13) in let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in @@ -333,14 +333,14 @@ Definition main : M unit := M bool.t)) in let* α10 : M.Val bool.t := M.alloc α9 in let* α11 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α10)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α10)) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α11 ] in let* α13 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α12) in let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_find.v b/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_find.v index dd73c7a57..85906aafa 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_find.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_find.v @@ -45,7 +45,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* vec2 : M.Val (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) := let* α0 : M.Val (array i32.t) := @@ -60,7 +60,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* iter : M.Val (core.slice.iter.Iter.t i32.t) := let* α0 : _ := @@ -70,7 +70,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α1 : ref (slice i32.t) := M.call (α0 (borrow vec1)) in let* α2 : core.slice.iter.Iter.t i32.t := - M.call ((slice i32.t)::["iter"] α1) in + M.call (impl (slice i32.t) "iter" α1) in M.alloc α2 in let* into_iter : M.Val (alloc.vec.into_iter.IntoIter.t i32.t alloc.alloc.Global.t) := @@ -122,14 +122,14 @@ Definition main : M unit := M bool.t)) in let* α7 : M.Val (core.option.Option.t (ref i32.t)) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -169,14 +169,14 @@ Definition main : M unit := M bool.t)) in let* α7 : M.Val (core.option.Option.t i32.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -212,7 +212,7 @@ Definition main : M unit := let* α6 : M.Val (ref (array i32.t)) := M.alloc (borrow array1) in let* α7 : ref (slice i32.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.slice.iter.Iter.t i32.t := - M.call ((slice i32.t)::["iter"] α7) in + M.call (impl (slice i32.t) "iter" α7) in let* α9 : M.Val (core.slice.iter.Iter.t i32.t) := M.alloc α8 in let* α10 : core.option.Option.t (ref i32.t) := M.call @@ -238,14 +238,14 @@ Definition main : M unit := M bool.t)) in let* α11 : M.Val (core.option.Option.t (ref i32.t)) := M.alloc α10 in let* α12 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α11)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α11)) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α12 ] in let* α14 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α13) in let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in @@ -293,14 +293,14 @@ Definition main : M unit := M bool.t)) in let* α10 : M.Val (core.option.Option.t (ref i32.t)) := M.alloc α9 in let* α11 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α10)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α10)) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α11 ] in let* α13 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α12) in let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_position.v b/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_position.v index a1b56b4b2..66c861dd4 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_position.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_example_searching_through_iterators_Iterator_position.v @@ -34,7 +34,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* index_of_first_even_number : M.Val (core.option.Option.t usize.t) := let* α0 : _ := @@ -50,7 +50,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α2 : ref (slice i32.t) := M.call (α1 (borrow vec)) in let* α3 : core.slice.iter.Iter.t i32.t := - M.call ((slice i32.t)::["iter"] α2) in + M.call (impl (slice i32.t) "iter" α2) in let* α4 : M.Val (core.slice.iter.Iter.t i32.t) := M.alloc α3 in let* α5 : core.option.Option.t usize.t := M.call diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_forced_capturing_with_move.v b/CoqOfRust/examples/default/examples/functions/functions_closures_forced_capturing_with_move.v index 1f3f8d562..cb2f6eea8 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_forced_capturing_with_move.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_forced_capturing_with_move.v @@ -36,7 +36,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* contains : M.Val ((ref i32.t) -> M bool.t) := M.alloc @@ -54,7 +54,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α1 : ref (slice i32.t) := M.call (α0 (borrow haystack)) in let* α2 : ref i32.t := M.read needle in - M.call ((slice i32.t)::["contains"] α1 α2)) : + M.call (impl (slice i32.t) "contains" α1 α2)) : M bool.t ]) : M bool.t) in @@ -77,14 +77,14 @@ Definition main : M unit := let* α7 : bool.t := M.call (α5 (borrow contains) (borrow α6)) in let* α8 : M.Val bool.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -107,14 +107,14 @@ Definition main : M unit := let* α7 : bool.t := M.call (α5 (borrow contains) (borrow α6)) in let* α8 : M.Val bool.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_input_functions.v b/CoqOfRust/examples/default/examples/functions/functions_closures_input_functions.v index e8c5d7b20..07bbe44ff 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_input_functions.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_input_functions.v @@ -36,7 +36,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -64,7 +64,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in let* α0 : M.Val unit := M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_closures_type_anonymity_define_and_use.v b/CoqOfRust/examples/default/examples/functions/functions_closures_type_anonymity_define_and_use.v index 9ac9d5e94..01702f9fd 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_closures_type_anonymity_define_and_use.v +++ b/CoqOfRust/examples/default/examples/functions/functions_closures_type_anonymity_define_and_use.v @@ -49,14 +49,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow x)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in let* α0 : M.Val unit := M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/functions_order.v b/CoqOfRust/examples/default/examples/functions/functions_order.v index 7004cfc07..6433e62ad 100644 --- a/CoqOfRust/examples/default/examples/functions/functions_order.v +++ b/CoqOfRust/examples/default/examples/functions/functions_order.v @@ -34,10 +34,7 @@ Section Impl_functions_order_SomeType_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_meth2 : - Notations.DoubleColon Self "meth2" := { - Notations.double_colon := meth2; - }. + Axiom meth2_is_impl : impl Self "meth2" = meth2. (* pub fn meth1(self) { @@ -48,15 +45,12 @@ Section Impl_functions_order_SomeType_t. let* self := M.alloc self in let* _ : M.Val unit := let* α0 : functions_order.SomeType.t := M.read self in - let* α1 : unit := M.call (functions_order.SomeType.t::["meth2"] α0) in + let* α1 : unit := M.call (impl functions_order.SomeType.t "meth2" α0) in M.alloc α1 in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_meth1 : - Notations.DoubleColon Self "meth1" := { - Notations.double_colon := meth1; - }. + Axiom meth1_is_impl : impl Self "meth1" = meth1. End Impl_functions_order_SomeType_t. End Impl_functions_order_SomeType_t. @@ -81,10 +75,7 @@ Section Impl_functions_order_SomeTrait_for_functions_order_SomeType_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_some_trait_bar : - Notations.DoubleColon Self "some_trait_bar" := { - Notations.double_colon := some_trait_bar; - }. + Axiom some_trait_bar_is_impl : impl Self "some_trait_bar" = some_trait_bar. (* fn some_trait_foo(&self) { @@ -96,10 +87,7 @@ Section Impl_functions_order_SomeTrait_for_functions_order_SomeType_t. let* α0 : ref functions_order.SomeType.t := M.read self in M.call (some_trait_bar α0). - Global Instance AssociatedFunction_some_trait_foo : - Notations.DoubleColon Self "some_trait_foo" := { - Notations.double_colon := some_trait_foo; - }. + Axiom some_trait_foo_is_impl : impl Self "some_trait_foo" = some_trait_foo. Global Instance ℐ : functions_order.SomeTrait.Trait Self := { functions_order.SomeTrait.some_trait_bar := some_trait_bar; @@ -119,10 +107,7 @@ Section Impl_functions_order_SomeTrait_for_functions_order_OtherType_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_some_trait_foo : - Notations.DoubleColon Self "some_trait_foo" := { - Notations.double_colon := some_trait_foo; - }. + Axiom some_trait_foo_is_impl : impl Self "some_trait_foo" = some_trait_foo. (* fn some_trait_bar(&self) {} @@ -131,10 +116,7 @@ Section Impl_functions_order_SomeTrait_for_functions_order_OtherType_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_some_trait_bar : - Notations.DoubleColon Self "some_trait_bar" := { - Notations.double_colon := some_trait_bar; - }. + Axiom some_trait_bar_is_impl : impl Self "some_trait_bar" = some_trait_bar. Global Instance ℐ : functions_order.SomeTrait.Trait Self := { functions_order.SomeTrait.some_trait_foo := some_trait_foo; @@ -294,7 +276,7 @@ Definition main : M unit := let* _ : M.Val unit := let* α0 : unit := M.call - (functions_order.SomeType.t::["meth1"] + (impl functions_order.SomeType.t "meth1" (functions_order.SomeType.Build_t ((Integer.of_Z 0) : u32.t))) in M.alloc α0 in let* α0 : M.Val unit := M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/functions/higher_order_functions.v b/CoqOfRust/examples/default/examples/functions/higher_order_functions.v index 6b241cd1d..c95b3fc23 100644 --- a/CoqOfRust/examples/default/examples/functions/higher_order_functions.v +++ b/CoqOfRust/examples/default/examples/functions/higher_order_functions.v @@ -57,7 +57,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -159,14 +159,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow acc)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow acc)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -295,7 +295,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow sum_of_squared_odd_numbers)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -303,7 +303,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_associated_types_problem.v b/CoqOfRust/examples/default/examples/generics/generics_associated_types_problem.v index 076b7c057..664d61722 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_associated_types_problem.v +++ b/CoqOfRust/examples/default/examples/generics/generics_associated_types_problem.v @@ -71,10 +71,7 @@ Section Impl_generics_associated_types_problem_Contains_i32_t_i32_t_for_generics let* α7 : bool.t := M.call (α4 (borrow α6) (borrow number_2)) in M.pure (BinOp.Pure.and α3 α7). - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn first(&self) -> i32 { @@ -87,10 +84,7 @@ Section Impl_generics_associated_types_problem_Contains_i32_t_i32_t_for_generics M.read self in M.read (generics_associated_types_problem.Container.Get_0 (deref α0)). - Global Instance AssociatedFunction_first : - Notations.DoubleColon Self "first" := { - Notations.double_colon := first; - }. + Axiom first_is_impl : impl Self "first" = first. (* fn last(&self) -> i32 { @@ -103,10 +97,7 @@ Section Impl_generics_associated_types_problem_Contains_i32_t_i32_t_for_generics M.read self in M.read (generics_associated_types_problem.Container.Get_1 (deref α0)). - Global Instance AssociatedFunction_last : - Notations.DoubleColon Self "last" := { - Notations.double_colon := last; - }. + Axiom last_is_impl : impl Self "last" = last. Global Instance ℐ : generics_associated_types_problem.Contains.Trait Self @@ -193,10 +184,10 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α5) in let* α7 : M.Val (ref i32.t) := M.alloc (borrow number_1) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (ref i32.t) := M.alloc (borrow number_2) in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α9)) in let* α11 : _ := ltac:(M.get_method (fun ℐ => generics_associated_types_problem.Contains.contains @@ -208,7 +199,7 @@ Definition main : M unit := M.call (α11 (borrow container) (borrow number_1) (borrow number_2)) in let* α13 : M.Val bool.t := M.alloc α12 in let* α14 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α13)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α13)) in let* α15 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α10; α14 ] in let* α16 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -216,7 +207,7 @@ Definition main : M unit := let* α17 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α16) in let* α18 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α17) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α17) in let* α19 : unit := M.call (std.io.stdio._print α18) in M.alloc α19 in M.alloc tt in @@ -239,14 +230,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (α5 (borrow container)) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -269,14 +260,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (α5 (borrow container)) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -294,14 +285,14 @@ Definition main : M unit := (generics_associated_types_problem.difference (borrow container)) in let* α6 : M.Val i32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_associated_types_solution.v b/CoqOfRust/examples/default/examples/generics/generics_associated_types_solution.v index eb1269e73..d29142f16 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_associated_types_solution.v +++ b/CoqOfRust/examples/default/examples/generics/generics_associated_types_solution.v @@ -90,10 +90,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated let* α7 : bool.t := M.call (α4 (borrow α6) (borrow number_2)) in M.pure (BinOp.Pure.and α3 α7). - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn first(&self) -> i32 { @@ -106,10 +103,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated M.read self in M.read (generics_associated_types_solution.Container.Get_0 (deref α0)). - Global Instance AssociatedFunction_first : - Notations.DoubleColon Self "first" := { - Notations.double_colon := first; - }. + Axiom first_is_impl : impl Self "first" = first. (* fn last(&self) -> i32 { @@ -122,10 +116,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated M.read self in M.read (generics_associated_types_solution.Container.Get_1 (deref α0)). - Global Instance AssociatedFunction_last : - Notations.DoubleColon Self "last" := { - Notations.double_colon := last; - }. + Axiom last_is_impl : impl Self "last" = last. (* fn a(&self) -> i32 { @@ -138,9 +129,7 @@ Section Impl_generics_associated_types_solution_Contains_for_generics_associated M.read self in M.read (generics_associated_types_solution.Container.Get_0 (deref α0)). - Global Instance AssociatedFunction_a : Notations.DoubleColon Self "a" := { - Notations.double_colon := a; - }. + Axiom a_is_impl : impl Self "a" = a. Global Instance ℐ : generics_associated_types_solution.Contains.Trait Self := { @@ -240,10 +229,10 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α5) in let* α7 : M.Val (ref i32.t) := M.alloc (borrow number_1) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (ref i32.t) := M.alloc (borrow number_2) in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α9)) in let* α11 : _ := ltac:(M.get_method (fun ℐ => generics_associated_types_solution.Contains.contains @@ -253,7 +242,7 @@ Definition main : M unit := M.call (α11 (borrow container) (borrow number_1) (borrow number_2)) in let* α13 : M.Val bool.t := M.alloc α12 in let* α14 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α13)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α13)) in let* α15 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α10; α14 ] in let* α16 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -261,7 +250,7 @@ Definition main : M unit := let* α17 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α16) in let* α18 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α17) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α17) in let* α19 : unit := M.call (std.io.stdio._print α18) in M.alloc α19 in M.alloc tt in @@ -282,14 +271,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (α5 (borrow container)) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -310,14 +299,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (α5 (borrow container)) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -335,14 +324,14 @@ Definition main : M unit := (generics_associated_types_solution.difference (borrow container)) in let* α6 : M.Val i32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_bounds.v b/CoqOfRust/examples/default/examples/generics/generics_bounds.v index 233b452d8..d85a2f8d1 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_bounds.v +++ b/CoqOfRust/examples/default/examples/generics/generics_bounds.v @@ -51,11 +51,15 @@ Section Impl_core_fmt_Debug_for_generics_bounds_Rectangle_t. let* α9 : M.Val (ref (ref f64.t)) := M.alloc (borrow α8) in let* α10 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α9) in M.call - (core.fmt.Formatter.t::["debug_struct_field2_finish"] α0 α1 α2 α5 α6 α10). + (impl core.fmt.Formatter.t "debug_struct_field2_finish" + α0 + α1 + α2 + α5 + α6 + α10). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -97,10 +101,7 @@ Section Impl_generics_bounds_HasArea_for_generics_bounds_Rectangle_t. M.read (generics_bounds.Rectangle.Get_height (deref α2)) in BinOp.Panic.mul α1 α3. - Global Instance AssociatedFunction_area : - Notations.DoubleColon Self "area" := { - Notations.double_colon := area; - }. + Axiom area_is_impl : impl Self "area" = area. Global Instance ℐ : generics_bounds.HasArea.Trait Self := { generics_bounds.HasArea.area := area; @@ -129,14 +130,14 @@ Definition print_debug let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -218,14 +219,14 @@ Definition main : M unit := let* α6 : f64.t := M.call (α5 (borrow rectangle)) in let* α7 : M.Val f64.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_bounds_test_case_empty_bounds.v b/CoqOfRust/examples/default/examples/generics/generics_bounds_test_case_empty_bounds.v index cc6a38e99..597ab203e 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_bounds_test_case_empty_bounds.v +++ b/CoqOfRust/examples/default/examples/generics/generics_bounds_test_case_empty_bounds.v @@ -117,14 +117,14 @@ Definition main : M unit := M.call (generics_bounds_test_case_empty_bounds.red (borrow cardinal)) in let* α6 : M.Val (ref str.t) := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -142,14 +142,14 @@ Definition main : M unit := (generics_bounds_test_case_empty_bounds.blue (borrow blue_jay)) in let* α6 : M.Val (ref str.t) := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_implementation.v b/CoqOfRust/examples/default/examples/generics/generics_implementation.v index 0341ce0b2..2cc900762 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_implementation.v +++ b/CoqOfRust/examples/default/examples/generics/generics_implementation.v @@ -41,10 +41,7 @@ Section Impl_generics_implementation_Val_t. let* α0 : ref generics_implementation.Val.t := M.read self in M.pure (borrow (generics_implementation.Val.Get_val (deref α0))). - Global Instance AssociatedFunction_value : - Notations.DoubleColon Self "value" := { - Notations.double_colon := value; - }. + Axiom value_is_impl : impl Self "value" = value. End Impl_generics_implementation_Val_t. End Impl_generics_implementation_Val_t. @@ -64,10 +61,7 @@ Section Impl_generics_implementation_GenVal_t_T. let* α0 : ref (generics_implementation.GenVal.t T) := M.read self in M.pure (borrow (generics_implementation.GenVal.Get_gen_val (deref α0))). - Global Instance AssociatedFunction_value : - Notations.DoubleColon Self "value" := { - Notations.double_colon := value; - }. + Axiom value_is_impl : impl Self "value" = value. End Impl_generics_implementation_GenVal_t_T. End Impl_generics_implementation_GenVal_t_T. @@ -99,23 +93,23 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : ref f64.t := - M.call (generics_implementation.Val.t::["value"] (borrow x)) in + M.call (impl generics_implementation.Val.t "value" (borrow x)) in let* α7 : M.Val (ref f64.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : ref i32.t := M.call - ((generics_implementation.GenVal.t i32.t)::["value"] (borrow y)) in + (impl (generics_implementation.GenVal.t i32.t) "value" (borrow y)) in let* α10 : M.Val (ref i32.t) := M.alloc α9 in let* α11 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α10)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α10)) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α11 ] in let* α13 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α12) in let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_multiple_bounds.v b/CoqOfRust/examples/default/examples/generics/generics_multiple_bounds.v index 6a1fa8de1..62f3a70d8 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_multiple_bounds.v +++ b/CoqOfRust/examples/default/examples/generics/generics_multiple_bounds.v @@ -24,14 +24,14 @@ Definition compare_prints let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -45,14 +45,14 @@ Definition compare_prints let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -84,14 +84,14 @@ Definition compare_types let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -105,14 +105,14 @@ Definition compare_types let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow u)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow u)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -155,7 +155,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* _ : M.Val unit := let* α0 : unit := diff --git a/CoqOfRust/examples/default/examples/generics/generics_new_type_idiom.v b/CoqOfRust/examples/default/examples/generics/generics_new_type_idiom.v index 296080adf..4ec72a2e6 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_new_type_idiom.v +++ b/CoqOfRust/examples/default/examples/generics/generics_new_type_idiom.v @@ -40,10 +40,7 @@ Section Impl_generics_new_type_idiom_Years_t. let* α2 : i64.t := BinOp.Panic.mul α1 ((Integer.of_Z 365) : i64.t) in M.pure (generics_new_type_idiom.Days.Build_t α2). - Global Instance AssociatedFunction_to_days : - Notations.DoubleColon Self "to_days" := { - Notations.double_colon := to_days; - }. + Axiom to_days_is_impl : impl Self "to_days" = to_days. End Impl_generics_new_type_idiom_Years_t. End Impl_generics_new_type_idiom_Years_t. @@ -63,10 +60,7 @@ Section Impl_generics_new_type_idiom_Days_t. let* α2 : i64.t := BinOp.Panic.div α1 ((Integer.of_Z 365) : i64.t) in M.pure (generics_new_type_idiom.Years.Build_t α2). - Global Instance AssociatedFunction_to_years : - Notations.DoubleColon Self "to_years" := { - Notations.double_colon := to_years; - }. + Axiom to_years_is_impl : impl Self "to_years" = to_years. End Impl_generics_new_type_idiom_Days_t. End Impl_generics_new_type_idiom_Days_t. @@ -97,7 +91,7 @@ Definition main : M unit := (generics_new_type_idiom.Years.Build_t ((Integer.of_Z 5) : i64.t)) in let* age_days : M.Val generics_new_type_idiom.Days.t := let* α0 : generics_new_type_idiom.Days.t := - M.call (generics_new_type_idiom.Years.t::["to_days"] (borrow age)) in + M.call (impl generics_new_type_idiom.Years.t "to_days" (borrow age)) in M.alloc α0 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -112,14 +106,14 @@ Definition main : M unit := M.call (generics_new_type_idiom.old_enough (borrow age)) in let* α6 : M.Val bool.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -134,20 +128,20 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : generics_new_type_idiom.Years.t := M.call - (generics_new_type_idiom.Days.t::["to_years"] (borrow age_days)) in + (impl generics_new_type_idiom.Days.t "to_years" (borrow age_days)) in let* α6 : M.Val generics_new_type_idiom.Years.t := M.alloc α5 in let* α7 : bool.t := M.call (generics_new_type_idiom.old_enough (borrow α6)) in let* α8 : M.Val bool.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_phantom_type.v b/CoqOfRust/examples/default/examples/generics/generics_phantom_type.v index 1a532a094..b670991ff 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_phantom_type.v +++ b/CoqOfRust/examples/default/examples/generics/generics_phantom_type.v @@ -73,9 +73,7 @@ Section Impl_core_cmp_PartialEq_for_generics_phantom_type_PhantomTuple_t_A_B. (borrow (generics_phantom_type.PhantomTuple.Get_1 (deref α6)))) in M.pure (BinOp.Pure.and α3 α7). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -162,9 +160,7 @@ Section Impl_core_cmp_PartialEq_for_generics_phantom_type_PhantomStruct_t_A_B. (generics_phantom_type.PhantomStruct.Get_phantom (deref α6)))) in M.pure (BinOp.Pure.and α3 α7). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self diff --git a/CoqOfRust/examples/default/examples/generics/generics_phantom_type_test_case_unit_clarification.v b/CoqOfRust/examples/default/examples/generics/generics_phantom_type_test_case_unit_clarification.v index 92e0f3776..28ff63e10 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_phantom_type_test_case_unit_clarification.v +++ b/CoqOfRust/examples/default/examples/generics/generics_phantom_type_test_case_unit_clarification.v @@ -26,9 +26,7 @@ Section Impl_core_fmt_Debug_for_generics_phantom_type_test_case_unit_clarificati let* α2 := M.read α1 in never_to_any α2. - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -52,10 +50,7 @@ Section Impl_core_clone_Clone_for_generics_phantom_type_test_case_unit_clarifica M.read self in M.read (deref α0). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -99,9 +94,7 @@ Section Impl_core_fmt_Debug_for_generics_phantom_type_test_case_unit_clarificati let* α2 := M.read α1 in never_to_any α2. - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -125,10 +118,7 @@ Section Impl_core_clone_Clone_for_generics_phantom_type_test_case_unit_clarifica M.read self in M.read (deref α0). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -205,11 +195,9 @@ Section Impl_core_fmt_Debug_for_generics_phantom_type_test_case_unit_clarificati let* α7 : M.Val (ref (ref (core.marker.PhantomData.t Unit))) := M.alloc (borrow α6) in let* α8 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α7) in - M.call (core.fmt.Formatter.t::["debug_tuple_field2_finish"] α0 α1 α4 α8). + M.call (impl core.fmt.Formatter.t "debug_tuple_field2_finish" α0 α1 α4 α8). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -264,10 +252,7 @@ Section Impl_core_clone_Clone_for_generics_phantom_type_test_case_unit_clarifica M.pure (generics_phantom_type_test_case_unit_clarification.Length.Build_t α2 α5). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -328,9 +313,7 @@ Section Impl_core_ops_arith_Add_for_generics_phantom_type_test_case_unit_clarifi α2 core.marker.PhantomData.Build). - Global Instance AssociatedFunction_add : Notations.DoubleColon Self "add" := { - Notations.double_colon := add; - }. + Axiom add_is_impl : impl Self "add" = add. Global Instance ℐ : core.ops.arith.Add.Trait Self @@ -449,7 +432,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (generics_phantom_type_test_case_unit_clarification.Length.Get_0 two_feet))) in @@ -459,7 +442,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -474,7 +457,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (generics_phantom_type_test_case_unit_clarification.Length.Get_0 two_meters))) in @@ -484,7 +467,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/generics/generics_traits.v b/CoqOfRust/examples/default/examples/generics/generics_traits.v index 7160190dc..6bb090354 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_traits.v +++ b/CoqOfRust/examples/default/examples/generics/generics_traits.v @@ -36,10 +36,7 @@ Section Impl_generics_traits_DoubleDrop_T_for_U. let* Pattern := M.alloc Pattern in M.pure tt. - Global Instance AssociatedFunction_double_drop : - Notations.DoubleColon Self "double_drop" := { - Notations.double_colon := double_drop; - }. + Axiom double_drop_is_impl : impl Self "double_drop" = double_drop. Global Instance ℐ : generics_traits.DoubleDrop.Trait Self (T := T) := { generics_traits.DoubleDrop.double_drop := double_drop; diff --git a/CoqOfRust/examples/default/examples/generics/generics_where_clauses.v b/CoqOfRust/examples/default/examples/generics/generics_where_clauses.v index 07cdb61bc..661acbc33 100644 --- a/CoqOfRust/examples/default/examples/generics/generics_where_clauses.v +++ b/CoqOfRust/examples/default/examples/generics/generics_where_clauses.v @@ -38,24 +38,21 @@ Section Impl_generics_where_clauses_PrintInOption_for_T. let* α6 : M.Val (core.option.Option.t T) := M.alloc (core.option.Option.Some α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_print_in_option : - Notations.DoubleColon Self "print_in_option" := { - Notations.double_colon := print_in_option; - }. + Axiom print_in_option_is_impl : impl Self "print_in_option" = print_in_option. Global Instance ℐ : generics_where_clauses.PrintInOption.Trait Self := { generics_where_clauses.PrintInOption.print_in_option := print_in_option; @@ -85,7 +82,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* _ : M.Val unit := let* α0 : _ := diff --git a/CoqOfRust/examples/default/examples/guessing_game/guessing_game.v b/CoqOfRust/examples/default/examples/guessing_game/guessing_game.v index 1b1d34114..9d9abbf89 100644 --- a/CoqOfRust/examples/default/examples/guessing_game/guessing_game.v +++ b/CoqOfRust/examples/default/examples/guessing_game/guessing_game.v @@ -56,7 +56,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -74,26 +74,26 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in let* guess : M.Val alloc.string.String.t := let* α0 : alloc.string.String.t := - M.call alloc.string.String.t::["new"] in + M.call (impl alloc.string.String.t "new") in M.alloc α0 in let* _ : M.Val usize.t := let* α0 : std.io.stdio.Stdin.t := M.call std.io.stdio.stdin in let* α1 : M.Val std.io.stdio.Stdin.t := M.alloc α0 in let* α2 : core.result.Result.t usize.t std.io.error.Error.t := M.call - (std.io.stdio.Stdin.t::["read_line"] + (impl std.io.stdio.Stdin.t "read_line" (borrow α1) (borrow_mut guess)) in let* α3 : ref str.t := M.read (mk_str "Failed to read line") in let* α4 : usize.t := M.call - ((core.result.Result.t usize.t std.io.error.Error.t)::["expect"] + (impl (core.result.Result.t usize.t std.io.error.Error.t) "expect" α2 α3) in M.alloc α4 in @@ -104,9 +104,9 @@ Definition main : M unit := (Self := alloc.string.String.t) (Trait := ℐ))) in let* α1 : ref str.t := M.call (α0 (borrow guess)) in - let* α2 : ref str.t := M.call (str.t::["trim"] α1) in + let* α2 : ref str.t := M.call (impl str.t "trim" α1) in let* α3 : core.result.Result.t u32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α2) in + M.call (impl str.t "parse" α2) in let* α4 : M.Val (core.result.Result.t u32.t core.num.error.ParseIntError.t) := M.alloc α3 in @@ -148,14 +148,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow guess)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow guess)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -181,7 +181,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -201,7 +201,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -222,7 +222,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/hello_world/formatted_print.v b/CoqOfRust/examples/default/examples/hello_world/formatted_print.v index 98bff2838..b386cec61 100644 --- a/CoqOfRust/examples/default/examples/hello_world/formatted_print.v +++ b/CoqOfRust/examples/default/examples/hello_world/formatted_print.v @@ -74,14 +74,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in @@ -95,14 +95,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in @@ -116,14 +116,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in @@ -136,14 +136,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in @@ -158,14 +158,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i32.t := M.alloc ((Integer.of_Z 69420) : i32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_binary"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_binary" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -180,14 +180,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i32.t := M.alloc ((Integer.of_Z 69420) : i32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_octal"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_octal" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -202,14 +202,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i32.t := M.alloc ((Integer.of_Z 69420) : i32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_lower_hex"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_lower_hex" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -224,14 +224,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i32.t := M.alloc ((Integer.of_Z 69420) : i32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_upper_hex"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_upper_hex" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -246,7 +246,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i32.t := M.alloc ((Integer.of_Z 1) : i32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in @@ -254,7 +254,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) " "%char core.fmt.rt.Alignment.Right @@ -267,9 +267,9 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α9 α13 α14) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α9 α13 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -284,7 +284,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i32.t := M.alloc ((Integer.of_Z 1) : i32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in @@ -292,7 +292,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) "0"%char core.fmt.rt.Alignment.Left @@ -305,9 +305,9 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α9 α13 α14) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α9 α13 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -322,10 +322,10 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i32.t := M.alloc ((Integer.of_Z 1) : i32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α5)) in let* α7 : M.Val usize.t := M.alloc ((Integer.of_Z 5) : usize.t) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["from_usize"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "from_usize" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in @@ -333,7 +333,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) "0"%char core.fmt.rt.Alignment.Right @@ -346,9 +346,9 @@ Definition main : M unit := let* α15 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α17 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α11 α15 α16) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α11 α15 α16) in let* α18 : unit := M.call (std.io.stdio._print α17) in M.alloc α18 in M.alloc tt in @@ -361,14 +361,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in @@ -384,9 +384,9 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow number)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow number)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["from_usize"] (borrow width)) in + M.call (impl core.fmt.rt.Argument.t "from_usize" (borrow width)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5; α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in @@ -394,7 +394,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) " "%char core.fmt.rt.Alignment.Right @@ -407,9 +407,9 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α9 α13 α14) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α9 α13 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/hello_world/hello_world.v b/CoqOfRust/examples/default/examples/hello_world/hello_world.v index d8961c7cd..7fa41d647 100644 --- a/CoqOfRust/examples/default/examples/hello_world/hello_world.v +++ b/CoqOfRust/examples/default/examples/hello_world/hello_world.v @@ -20,7 +20,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/ink_contracts/Proofs/erc20.v b/CoqOfRust/examples/default/examples/ink_contracts/Proofs/erc20.v index 66b784947..c4a314cf0 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/Proofs/erc20.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/Proofs/erc20.v @@ -221,6 +221,9 @@ Lemma run_env (env : erc20.Env.t) (storage : erc20.Erc20.t) : | state }}. Proof. run_symbolic. + pose proof (H := erc20.Impl_erc20_Erc20_t.init_env_is_impl). + unfold erc20.Impl_erc20_Erc20_t.Self in H. + rewrite H. eapply Run.Call. { run_symbolic. } diff --git a/CoqOfRust/examples/default/examples/ink_contracts/basic_contract_caller.v b/CoqOfRust/examples/default/examples/ink_contracts/basic_contract_caller.v index 29e620a16..7d2a4aa61 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/basic_contract_caller.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/basic_contract_caller.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_basic_contract_caller_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (basic_contract_caller.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_basic_contract_caller_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -111,9 +105,7 @@ Section Impl_basic_contract_caller_OtherContract_t. let* α0 : bool.t := M.read init_value in M.pure {| basic_contract_caller.OtherContract.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn flip(&mut self) { @@ -133,10 +125,7 @@ Section Impl_basic_contract_caller_OtherContract_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -148,9 +137,7 @@ Section Impl_basic_contract_caller_OtherContract_t. let* α0 : ref basic_contract_caller.OtherContract.t := M.read self in M.read (basic_contract_caller.OtherContract.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_basic_contract_caller_OtherContract_t. End Impl_basic_contract_caller_OtherContract_t. @@ -198,9 +185,7 @@ Section Impl_basic_contract_caller_BasicContractCaller_t. {| basic_contract_caller.BasicContractCaller.other_contract := α0; |} in M.read α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn flip_and_get(&mut self) -> bool { @@ -215,7 +200,7 @@ Section Impl_basic_contract_caller_BasicContractCaller_t. M.read self in let* α1 : unit := M.call - (basic_contract_caller.OtherContract.t::["flip"] + (impl basic_contract_caller.OtherContract.t "flip" (borrow_mut (basic_contract_caller.BasicContractCaller.Get_other_contract (deref α0)))) in @@ -224,16 +209,13 @@ Section Impl_basic_contract_caller_BasicContractCaller_t. M.read self in let* α1 : bool.t := M.call - (basic_contract_caller.OtherContract.t::["get"] + (impl basic_contract_caller.OtherContract.t "get" (borrow (basic_contract_caller.BasicContractCaller.Get_other_contract (deref α0)))) in let* α0 : M.Val bool.t := M.alloc α1 in M.read α0. - Global Instance AssociatedFunction_flip_and_get : - Notations.DoubleColon Self "flip_and_get" := { - Notations.double_colon := flip_and_get; - }. + Axiom flip_and_get_is_impl : impl Self "flip_and_get" = flip_and_get. End Impl_basic_contract_caller_BasicContractCaller_t. End Impl_basic_contract_caller_BasicContractCaller_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v b/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v index fb5716230..8ab7bff19 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_call_runtime_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (call_runtime.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_call_runtime_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -113,10 +107,7 @@ Section Impl_core_convert_From_call_runtime_AccountId_t_for_call_runtime_MultiAd let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := call_runtime.AccountId.t) := { @@ -179,10 +170,7 @@ Section Impl_core_default_Default_for_call_runtime_RuntimeCaller_t. Definition default : M call_runtime.RuntimeCaller.t := M.pure call_runtime.RuntimeCaller.Build. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -210,11 +198,9 @@ Section Impl_core_fmt_Debug_for_call_runtime_RuntimeError_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "CallRuntimeFailed") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -246,9 +232,7 @@ Section Impl_core_cmp_PartialEq_for_call_runtime_RuntimeError_t. let* other := M.alloc other in M.pure true. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -279,10 +263,8 @@ Section Impl_core_cmp_Eq_for_call_runtime_RuntimeError_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -333,10 +315,7 @@ Section Impl_core_convert_From_call_runtime_EnvError_t_for_call_runtime_RuntimeE ] in M.read α0. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := call_runtime.EnvError.t) := { @@ -365,10 +344,9 @@ Section Impl_call_runtime_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_call_runtime {Call : Set} : - Notations.DoubleColon Self "call_runtime" := { - Notations.double_colon := call_runtime (Call := Call); - }. + Axiom call_runtime_is_impl : + forall {Call : Set}, + impl Self "call_runtime" = call_runtime (Call := Call). End Impl_call_runtime_Env_t. End Impl_call_runtime_Env_t. @@ -386,10 +364,7 @@ Section Impl_call_runtime_RuntimeCaller_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -398,11 +373,9 @@ Section Impl_call_runtime_RuntimeCaller_t. *) Definition env (self : ref Self) : M call_runtime.Env.t := let* self := M.alloc self in - M.call call_runtime.RuntimeCaller.t::["init_env"]. + M.call (impl call_runtime.RuntimeCaller.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -417,9 +390,7 @@ Section Impl_call_runtime_RuntimeCaller_t. (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn transfer_through_runtime( @@ -445,7 +416,7 @@ Section Impl_call_runtime_RuntimeCaller_t. let* value := M.alloc value in let* α0 : mut_ref call_runtime.RuntimeCaller.t := M.read self in let* α1 : call_runtime.Env.t := - M.call (call_runtime.RuntimeCaller.t::["env"] (borrow (deref α0))) in + M.call (impl call_runtime.RuntimeCaller.t "env" (borrow (deref α0))) in let* α2 : M.Val call_runtime.Env.t := M.alloc α1 in let* α3 : _ := ltac:(M.get_method (fun ℐ => @@ -466,7 +437,7 @@ Section Impl_call_runtime_RuntimeCaller_t. call_runtime.BalancesCall.Transfer.value := α6; |})) in let* α8 : core.result.Result.t unit call_runtime.EnvError.t := - M.call (call_runtime.Env.t::["call_runtime"] (borrow α2) (borrow α7)) in + M.call (impl call_runtime.Env.t "call_runtime" (borrow α2) (borrow α7)) in let* α9 : _ := ltac:(M.get_method (fun ℐ => core.convert.Into.into @@ -474,12 +445,12 @@ Section Impl_call_runtime_RuntimeCaller_t. (T := call_runtime.RuntimeError.t) (Trait := ℐ))) in M.call - ((core.result.Result.t unit call_runtime.EnvError.t)::["map_err"] α8 α9). + (impl (core.result.Result.t unit call_runtime.EnvError.t) "map_err" + α8 + α9). - Global Instance AssociatedFunction_transfer_through_runtime : - Notations.DoubleColon Self "transfer_through_runtime" := { - Notations.double_colon := transfer_through_runtime; - }. + Axiom transfer_through_runtime_is_impl : + impl Self "transfer_through_runtime" = transfer_through_runtime. (* pub fn call_nonexistent_extrinsic(&mut self) -> Result<(), RuntimeError> { @@ -492,11 +463,11 @@ Section Impl_call_runtime_RuntimeCaller_t. let* self := M.alloc self in let* α0 : mut_ref call_runtime.RuntimeCaller.t := M.read self in let* α1 : call_runtime.Env.t := - M.call (call_runtime.RuntimeCaller.t::["env"] (borrow (deref α0))) in + M.call (impl call_runtime.RuntimeCaller.t "env" (borrow (deref α0))) in let* α2 : M.Val call_runtime.Env.t := M.alloc α1 in let* α3 : M.Val unit := M.alloc tt in let* α4 : core.result.Result.t unit call_runtime.EnvError.t := - M.call (call_runtime.Env.t::["call_runtime"] (borrow α2) (borrow α3)) in + M.call (impl call_runtime.Env.t "call_runtime" (borrow α2) (borrow α3)) in let* α5 : _ := ltac:(M.get_method (fun ℐ => core.convert.Into.into @@ -504,11 +475,11 @@ Section Impl_call_runtime_RuntimeCaller_t. (T := call_runtime.RuntimeError.t) (Trait := ℐ))) in M.call - ((core.result.Result.t unit call_runtime.EnvError.t)::["map_err"] α4 α5). + (impl (core.result.Result.t unit call_runtime.EnvError.t) "map_err" + α4 + α5). - Global Instance AssociatedFunction_call_nonexistent_extrinsic : - Notations.DoubleColon Self "call_nonexistent_extrinsic" := { - Notations.double_colon := call_nonexistent_extrinsic; - }. + Axiom call_nonexistent_extrinsic_is_impl : + impl Self "call_nonexistent_extrinsic" = call_nonexistent_extrinsic. End Impl_call_runtime_RuntimeCaller_t. End Impl_call_runtime_RuntimeCaller_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v b/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v index 5b9b7b570..d4fb36e13 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_conditional_compilation_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (conditional_compilation.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_conditional_compilation_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -171,10 +165,7 @@ Section Impl_conditional_compilation_Env_t. let* α0 : ref conditional_compilation.Env.t := M.read self in M.read (conditional_compilation.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -191,10 +182,7 @@ Section Impl_conditional_compilation_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. (* fn block_number(&self) -> BlockNumber { @@ -209,10 +197,7 @@ Section Impl_conditional_compilation_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_block_number : - Notations.DoubleColon Self "block_number" := { - Notations.double_colon := block_number; - }. + Axiom block_number_is_impl : impl Self "block_number" = block_number. End Impl_conditional_compilation_Env_t. End Impl_conditional_compilation_Env_t. @@ -241,10 +226,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -253,11 +235,9 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. *) Definition env (self : ref Self) : M conditional_compilation.Env.t := let* self := M.alloc self in - M.call conditional_compilation.ConditionalCompilation.t::["init_env"]. + M.call (impl conditional_compilation.ConditionalCompilation.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -273,9 +253,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α1 : bool.t := M.call α0 in M.pure {| conditional_compilation.ConditionalCompilation.value := α1; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_foo(value: bool) -> Self { @@ -287,10 +265,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α0 : bool.t := M.read value in M.pure {| conditional_compilation.ConditionalCompilation.value := α0; |}. - Global Instance AssociatedFunction_new_foo : - Notations.DoubleColon Self "new_foo" := { - Notations.double_colon := new_foo; - }. + Axiom new_foo_is_impl : impl Self "new_foo" = new_foo. (* pub fn new_bar(value: bool) -> Self { @@ -302,10 +277,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α0 : bool.t := M.read value in M.pure {| conditional_compilation.ConditionalCompilation.value := α0; |}. - Global Instance AssociatedFunction_new_bar : - Notations.DoubleColon Self "new_bar" := { - Notations.double_colon := new_bar; - }. + Axiom new_bar_is_impl : impl Self "new_bar" = new_bar. (* pub fn new_foo_bar(value: bool) -> Self { @@ -317,10 +289,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α0 : bool.t := M.read value in M.pure {| conditional_compilation.ConditionalCompilation.value := α0; |}. - Global Instance AssociatedFunction_new_foo_bar : - Notations.DoubleColon Self "new_foo_bar" := { - Notations.double_colon := new_foo_bar; - }. + Axiom new_foo_bar_is_impl : impl Self "new_foo_bar" = new_foo_bar. (* pub fn inherent_flip_foo(&mut self) { @@ -348,14 +317,16 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. (UnOp.not α2) in let* caller : M.Val conditional_compilation.AccountId.t := let* α0 : conditional_compilation.Env.t := - M.call conditional_compilation.ConditionalCompilation.t::["init_env"] in + M.call + (impl conditional_compilation.ConditionalCompilation.t "init_env") in let* α1 : M.Val conditional_compilation.Env.t := M.alloc α0 in let* α2 : conditional_compilation.AccountId.t := - M.call (conditional_compilation.Env.t::["caller"] (borrow α1)) in + M.call (impl conditional_compilation.Env.t "caller" (borrow α1)) in M.alloc α2 in let* _ : M.Val unit := let* α0 : conditional_compilation.Env.t := - M.call conditional_compilation.ConditionalCompilation.t::["init_env"] in + M.call + (impl conditional_compilation.ConditionalCompilation.t "init_env") in let* α1 : M.Val conditional_compilation.Env.t := M.alloc α0 in let* α2 : mut_ref conditional_compilation.ConditionalCompilation.t := M.read self in @@ -366,7 +337,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α4 : conditional_compilation.AccountId.t := M.read caller in let* α5 : unit := M.call - (conditional_compilation.Env.t::["emit_event"] + (impl conditional_compilation.Env.t "emit_event" (borrow α1) (conditional_compilation.Event.Changes {| @@ -377,10 +348,8 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_inherent_flip_foo : - Notations.DoubleColon Self "inherent_flip_foo" := { - Notations.double_colon := inherent_flip_foo; - }. + Axiom inherent_flip_foo_is_impl : + impl Self "inherent_flip_foo" = inherent_flip_foo. (* pub fn inherent_flip_bar(&mut self) { @@ -398,17 +367,20 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* self := M.alloc self in let* caller : M.Val conditional_compilation.AccountId.t := let* α0 : conditional_compilation.Env.t := - M.call conditional_compilation.ConditionalCompilation.t::["init_env"] in + M.call + (impl conditional_compilation.ConditionalCompilation.t "init_env") in let* α1 : M.Val conditional_compilation.Env.t := M.alloc α0 in let* α2 : conditional_compilation.AccountId.t := - M.call (conditional_compilation.Env.t::["caller"] (borrow α1)) in + M.call (impl conditional_compilation.Env.t "caller" (borrow α1)) in M.alloc α2 in let* block_number : M.Val u32.t := let* α0 : conditional_compilation.Env.t := - M.call conditional_compilation.ConditionalCompilation.t::["init_env"] in + M.call + (impl conditional_compilation.ConditionalCompilation.t "init_env") in let* α1 : M.Val conditional_compilation.Env.t := M.alloc α0 in let* α2 : u32.t := - M.call (conditional_compilation.Env.t::["block_number"] (borrow α1)) in + M.call + (impl conditional_compilation.Env.t "block_number" (borrow α1)) in M.alloc α2 in let* _ : M.Val unit := let* α0 : mut_ref conditional_compilation.ConditionalCompilation.t := @@ -424,7 +396,8 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. (UnOp.not α2) in let* _ : M.Val unit := let* α0 : conditional_compilation.Env.t := - M.call conditional_compilation.ConditionalCompilation.t::["init_env"] in + M.call + (impl conditional_compilation.ConditionalCompilation.t "init_env") in let* α1 : M.Val conditional_compilation.Env.t := M.alloc α0 in let* α2 : mut_ref conditional_compilation.ConditionalCompilation.t := M.read self in @@ -436,7 +409,7 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α5 : u32.t := M.read block_number in let* α6 : unit := M.call - (conditional_compilation.Env.t::["emit_event"] + (impl conditional_compilation.Env.t "emit_event" (borrow α1) (conditional_compilation.Event.ChangesDated {| @@ -448,10 +421,8 @@ Section Impl_conditional_compilation_ConditionalCompilation_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_inherent_flip_bar : - Notations.DoubleColon Self "inherent_flip_bar" := { - Notations.double_colon := inherent_flip_bar; - }. + Axiom inherent_flip_bar_is_impl : + impl Self "inherent_flip_bar" = inherent_flip_bar. End Impl_conditional_compilation_ConditionalCompilation_t. End Impl_conditional_compilation_ConditionalCompilation_t. @@ -481,10 +452,7 @@ Section Impl_conditional_compilation_Flip_for_conditional_compilation_Conditiona let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* fn get(&self) -> bool { @@ -498,9 +466,7 @@ Section Impl_conditional_compilation_Flip_for_conditional_compilation_Conditiona M.read (conditional_compilation.ConditionalCompilation.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn push_foo(&mut self, value: bool) { @@ -517,20 +483,22 @@ Section Impl_conditional_compilation_Flip_for_conditional_compilation_Conditiona let* value := M.alloc value in let* caller : M.Val conditional_compilation.AccountId.t := let* α0 : conditional_compilation.Env.t := - M.call conditional_compilation.ConditionalCompilation.t::["init_env"] in + M.call + (impl conditional_compilation.ConditionalCompilation.t "init_env") in let* α1 : M.Val conditional_compilation.Env.t := M.alloc α0 in let* α2 : conditional_compilation.AccountId.t := - M.call (conditional_compilation.Env.t::["caller"] (borrow α1)) in + M.call (impl conditional_compilation.Env.t "caller" (borrow α1)) in M.alloc α2 in let* _ : M.Val unit := let* α0 : conditional_compilation.Env.t := - M.call conditional_compilation.ConditionalCompilation.t::["init_env"] in + M.call + (impl conditional_compilation.ConditionalCompilation.t "init_env") in let* α1 : M.Val conditional_compilation.Env.t := M.alloc α0 in let* α2 : bool.t := M.read value in let* α3 : conditional_compilation.AccountId.t := M.read caller in let* α4 : unit := M.call - (conditional_compilation.Env.t::["emit_event"] + (impl conditional_compilation.Env.t "emit_event" (borrow α1) (conditional_compilation.Event.Changes {| @@ -548,10 +516,7 @@ Section Impl_conditional_compilation_Flip_for_conditional_compilation_Conditiona let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_push_foo : - Notations.DoubleColon Self "push_foo" := { - Notations.double_colon := push_foo; - }. + Axiom push_foo_is_impl : impl Self "push_foo" = push_foo. Global Instance ℐ : conditional_compilation.Flip.Trait Self := { conditional_compilation.Flip.flip := flip; diff --git a/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v b/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v index 6d8c117a2..135be7932 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_contract_terminate_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (contract_terminate.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_contract_terminate_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -104,10 +98,7 @@ Section Impl_contract_terminate_Env_t. let* α0 : ref contract_terminate.Env.t := M.read self in M.read (contract_terminate.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn terminate_contract(&self, _account: AccountId) { @@ -124,10 +115,8 @@ Section Impl_contract_terminate_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_terminate_contract : - Notations.DoubleColon Self "terminate_contract" := { - Notations.double_colon := terminate_contract; - }. + Axiom terminate_contract_is_impl : + impl Self "terminate_contract" = terminate_contract. End Impl_contract_terminate_Env_t. End Impl_contract_terminate_Env_t. @@ -151,10 +140,7 @@ Section Impl_contract_terminate_JustTerminate_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -163,11 +149,9 @@ Section Impl_contract_terminate_JustTerminate_t. *) Definition env (self : ref Self) : M contract_terminate.Env.t := let* self := M.alloc self in - M.call contract_terminate.JustTerminate.t::["init_env"]. + M.call (impl contract_terminate.JustTerminate.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -176,9 +160,7 @@ Section Impl_contract_terminate_JustTerminate_t. *) Definition new : M Self := M.pure contract_terminate.JustTerminate.Build. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn terminate_me(&mut self) { @@ -191,25 +173,22 @@ Section Impl_contract_terminate_JustTerminate_t. let* α0 : mut_ref contract_terminate.JustTerminate.t := M.read self in let* α1 : contract_terminate.Env.t := M.call - (contract_terminate.JustTerminate.t::["env"] (borrow (deref α0))) in + (impl contract_terminate.JustTerminate.t "env" (borrow (deref α0))) in let* α2 : M.Val contract_terminate.Env.t := M.alloc α1 in let* α3 : mut_ref contract_terminate.JustTerminate.t := M.read self in let* α4 : contract_terminate.Env.t := M.call - (contract_terminate.JustTerminate.t::["env"] (borrow (deref α3))) in + (impl contract_terminate.JustTerminate.t "env" (borrow (deref α3))) in let* α5 : M.Val contract_terminate.Env.t := M.alloc α4 in let* α6 : contract_terminate.AccountId.t := - M.call (contract_terminate.Env.t::["caller"] (borrow α5)) in + M.call (impl contract_terminate.Env.t "caller" (borrow α5)) in let* α7 : unit := M.call - (contract_terminate.Env.t::["terminate_contract"] (borrow α2) α6) in + (impl contract_terminate.Env.t "terminate_contract" (borrow α2) α6) in M.alloc α7 in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_terminate_me : - Notations.DoubleColon Self "terminate_me" := { - Notations.double_colon := terminate_me; - }. + Axiom terminate_me_is_impl : impl Self "terminate_me" = terminate_me. End Impl_contract_terminate_JustTerminate_t. End Impl_contract_terminate_JustTerminate_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v b/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v index 98241f744..60f5df4d7 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_contract_transfer_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (contract_transfer.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_contract_transfer_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -106,10 +100,7 @@ Section Impl_contract_transfer_Env_t. let* α0 : ref contract_transfer.Env.t := M.read self in M.read (contract_transfer.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn balance(&self) -> Balance { @@ -122,10 +113,7 @@ Section Impl_contract_transfer_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_balance : - Notations.DoubleColon Self "balance" := { - Notations.double_colon := balance; - }. + Axiom balance_is_impl : impl Self "balance" = balance. (* fn transfer(&mut self, _to: AccountId, _value: Balance) -> Result<(), ()> { @@ -144,10 +132,7 @@ Section Impl_contract_transfer_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn transferred_value(&self) -> Balance { @@ -162,10 +147,8 @@ Section Impl_contract_transfer_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_transferred_value : - Notations.DoubleColon Self "transferred_value" := { - Notations.double_colon := transferred_value; - }. + Axiom transferred_value_is_impl : + impl Self "transferred_value" = transferred_value. End Impl_contract_transfer_Env_t. End Impl_contract_transfer_Env_t. @@ -189,10 +172,7 @@ Section Impl_contract_transfer_GiveMe_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -201,11 +181,9 @@ Section Impl_contract_transfer_GiveMe_t. *) Definition env (self : ref Self) : M contract_transfer.Env.t := let* self := M.alloc self in - M.call contract_transfer.GiveMe.t::["init_env"]. + M.call (impl contract_transfer.GiveMe.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -214,9 +192,7 @@ Section Impl_contract_transfer_GiveMe_t. *) Definition new : M Self := M.pure contract_transfer.GiveMe.Build. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn give_me(&mut self, value: Balance) { @@ -250,14 +226,14 @@ Section Impl_contract_transfer_GiveMe_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow value)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow value)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -272,20 +248,20 @@ Section Impl_contract_transfer_GiveMe_t. M.read (pointer_coercion "Unsize" α3) in let* α5 : mut_ref contract_transfer.GiveMe.t := M.read self in let* α6 : contract_transfer.Env.t := - M.call (contract_transfer.GiveMe.t::["env"] (borrow (deref α5))) in + M.call (impl contract_transfer.GiveMe.t "env" (borrow (deref α5))) in let* α7 : M.Val contract_transfer.Env.t := M.alloc α6 in let* α8 : u128.t := - M.call (contract_transfer.Env.t::["balance"] (borrow α7)) in + M.call (impl contract_transfer.Env.t "balance" (borrow α7)) in let* α9 : M.Val u128.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α11) in let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in M.alloc tt in @@ -293,10 +269,10 @@ Section Impl_contract_transfer_GiveMe_t. let* α0 : u128.t := M.read value in let* α1 : mut_ref contract_transfer.GiveMe.t := M.read self in let* α2 : contract_transfer.Env.t := - M.call (contract_transfer.GiveMe.t::["env"] (borrow (deref α1))) in + M.call (impl contract_transfer.GiveMe.t "env" (borrow (deref α1))) in let* α3 : M.Val contract_transfer.Env.t := M.alloc α2 in let* α4 : u128.t := - M.call (contract_transfer.Env.t::["balance"] (borrow α3)) in + M.call (impl contract_transfer.Env.t "balance" (borrow α3)) in let* α5 : M.Val bool.t := M.alloc (UnOp.not (BinOp.Pure.le α0 α4)) in let* α6 : bool.t := M.read (use α5) in if α6 then @@ -308,20 +284,20 @@ Section Impl_contract_transfer_GiveMe_t. M.alloc tt in let* α0 : mut_ref contract_transfer.GiveMe.t := M.read self in let* α1 : contract_transfer.Env.t := - M.call (contract_transfer.GiveMe.t::["env"] (borrow (deref α0))) in + M.call (impl contract_transfer.GiveMe.t "env" (borrow (deref α0))) in let* α2 : M.Val contract_transfer.Env.t := M.alloc α1 in let* α3 : mut_ref contract_transfer.GiveMe.t := M.read self in let* α4 : contract_transfer.Env.t := - M.call (contract_transfer.GiveMe.t::["env"] (borrow (deref α3))) in + M.call (impl contract_transfer.GiveMe.t "env" (borrow (deref α3))) in let* α5 : M.Val contract_transfer.Env.t := M.alloc α4 in let* α6 : contract_transfer.AccountId.t := - M.call (contract_transfer.Env.t::["caller"] (borrow α5)) in + M.call (impl contract_transfer.Env.t "caller" (borrow α5)) in let* α7 : u128.t := M.read value in let* α8 : core.result.Result.t unit unit := - M.call (contract_transfer.Env.t::["transfer"] (borrow_mut α2) α6 α7) in + M.call (impl contract_transfer.Env.t "transfer" (borrow_mut α2) α6 α7) in let* α9 : M.Val (core.result.Result.t unit unit) := M.alloc α8 in let* α10 : bool.t := - M.call ((core.result.Result.t unit unit)::["is_err"] (borrow α9)) in + M.call (impl (core.result.Result.t unit unit) "is_err" (borrow α9)) in let* α11 : M.Val bool.t := M.alloc α10 in let* α12 : bool.t := M.read (use α11) in let* α0 : M.Val unit := @@ -337,10 +313,7 @@ Section Impl_contract_transfer_GiveMe_t. M.alloc tt in M.read α0. - Global Instance AssociatedFunction_give_me : - Notations.DoubleColon Self "give_me" := { - Notations.double_colon := give_me; - }. + Axiom give_me_is_impl : impl Self "give_me" = give_me. (* pub fn was_it_ten(&self) { @@ -361,30 +334,31 @@ Section Impl_contract_transfer_GiveMe_t. M.read (pointer_coercion "Unsize" α3) in let* α5 : ref contract_transfer.GiveMe.t := M.read self in let* α6 : contract_transfer.Env.t := - M.call (contract_transfer.GiveMe.t::["env"] α5) in + M.call (impl contract_transfer.GiveMe.t "env" α5) in let* α7 : M.Val contract_transfer.Env.t := M.alloc α6 in let* α8 : u128.t := - M.call (contract_transfer.Env.t::["transferred_value"] (borrow α7)) in + M.call + (impl contract_transfer.Env.t "transferred_value" (borrow α7)) in let* α9 : M.Val u128.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α11) in let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in M.alloc tt in let* _ : M.Val unit := let* α0 : ref contract_transfer.GiveMe.t := M.read self in let* α1 : contract_transfer.Env.t := - M.call (contract_transfer.GiveMe.t::["env"] α0) in + M.call (impl contract_transfer.GiveMe.t "env" α0) in let* α2 : M.Val contract_transfer.Env.t := M.alloc α1 in let* α3 : u128.t := - M.call (contract_transfer.Env.t::["transferred_value"] (borrow α2)) in + M.call (impl contract_transfer.Env.t "transferred_value" (borrow α2)) in let* α4 : M.Val bool.t := M.alloc (UnOp.not (BinOp.Pure.eq α3 ((Integer.of_Z 10) : u128.t))) in let* α5 : bool.t := M.read (use α4) in @@ -398,9 +372,6 @@ Section Impl_contract_transfer_GiveMe_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_was_it_ten : - Notations.DoubleColon Self "was_it_ten" := { - Notations.double_colon := was_it_ten; - }. + Axiom was_it_ten_is_impl : impl Self "was_it_ten" = was_it_ten. End Impl_contract_transfer_GiveMe_t. End Impl_contract_transfer_GiveMe_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v b/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v index 98827b5e1..86b8ac0b5 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v @@ -32,12 +32,10 @@ Section Impl_custom_allocator_CustomAllocator_t. let* α3 : alloc.boxed.Box.t (slice bool.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α2) in let* α4 : alloc.vec.Vec.t bool.t alloc.alloc.Global.t := - M.call ((slice bool.t)::["into_vec"] α3) in + M.call (impl (slice bool.t) "into_vec" α3) in M.pure {| custom_allocator.CustomAllocator.value := α4; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn default() -> Self { @@ -49,12 +47,9 @@ Section Impl_custom_allocator_CustomAllocator_t. ltac:(M.get_method (fun ℐ => core.default.Default.default (Self := bool.t) (Trait := ℐ))) in let* α1 : bool.t := M.call α0 in - M.call (custom_allocator.CustomAllocator.t::["new"] α1). + M.call (impl custom_allocator.CustomAllocator.t "new" α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. (* pub fn flip(&mut self) { @@ -93,10 +88,7 @@ Section Impl_custom_allocator_CustomAllocator_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -119,8 +111,6 @@ Section Impl_custom_allocator_CustomAllocator_t. ((Integer.of_Z 0) : usize.t)) in M.read (deref α2). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_custom_allocator_CustomAllocator_t. End Impl_custom_allocator_CustomAllocator_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v b/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v index 9e0f28405..cdefccf1f 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_custom_environment_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (custom_environment.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_custom_environment_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -108,10 +102,7 @@ Section Impl_core_default_Default_for_custom_environment_Topics_t. Definition default : M custom_environment.Topics.t := M.pure custom_environment.Topics.Build. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -189,10 +180,7 @@ Section Impl_core_default_Default_for_custom_environment_EventWithTopics_t. custom_environment.EventWithTopics.fifth_topic := α9; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -225,10 +213,7 @@ Section Impl_custom_environment_Env_t. let* α0 : ref custom_environment.Env.t := M.read self in M.read (custom_environment.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -245,10 +230,7 @@ Section Impl_custom_environment_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_custom_environment_Env_t. End Impl_custom_environment_Env_t. @@ -266,10 +248,7 @@ Section Impl_custom_environment_Topics_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -278,11 +257,9 @@ Section Impl_custom_environment_Topics_t. *) Definition env (self : ref Self) : M custom_environment.Env.t := let* self := M.alloc self in - M.call custom_environment.Topics.t::["init_env"]. + M.call (impl custom_environment.Topics.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -297,9 +274,7 @@ Section Impl_custom_environment_Topics_t. (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn trigger(&mut self) { @@ -312,7 +287,7 @@ Section Impl_custom_environment_Topics_t. let* _ : M.Val unit := let* α0 : mut_ref custom_environment.Topics.t := M.read self in let* α1 : custom_environment.Env.t := - M.call (custom_environment.Topics.t::["env"] (borrow (deref α0))) in + M.call (impl custom_environment.Topics.t "env" (borrow (deref α0))) in let* α2 : M.Val custom_environment.Env.t := M.alloc α1 in let* α3 : _ := ltac:(M.get_method (fun ℐ => @@ -322,16 +297,13 @@ Section Impl_custom_environment_Topics_t. let* α4 : custom_environment.EventWithTopics.t := M.call α3 in let* α5 : unit := M.call - (custom_environment.Env.t::["emit_event"] + (impl custom_environment.Env.t "emit_event" (borrow α2) (custom_environment.Event.EventWithTopics α4)) in M.alloc α5 in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_trigger : - Notations.DoubleColon Self "trigger" := { - Notations.double_colon := trigger; - }. + Axiom trigger_is_impl : impl Self "trigger" = trigger. End Impl_custom_environment_Topics_t. End Impl_custom_environment_Topics_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/dns.v b/CoqOfRust/examples/default/examples/ink_contracts/dns.v index 8caec25be..e89c13d75 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/dns.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/dns.v @@ -45,10 +45,7 @@ Section Impl_core_default_Default_for_dns_Mapping_t_K_V. let* α3 : core.marker.PhantomData.t V := M.call α2 in M.pure {| dns.Mapping._key := α1; dns.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -74,10 +71,7 @@ Section Impl_dns_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -94,9 +88,7 @@ Section Impl_dns_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -115,10 +107,7 @@ Section Impl_dns_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn new() -> Mapping { @@ -130,9 +119,7 @@ Section Impl_dns_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn remove(&self, _key: K) { @@ -146,10 +133,7 @@ Section Impl_dns_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -166,10 +150,7 @@ Section Impl_dns_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -183,10 +164,7 @@ Section Impl_dns_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_dns_Mapping_t_K_V. End Impl_dns_Mapping_t_K_V. @@ -215,10 +193,7 @@ Section Impl_core_default_Default_for_dns_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (dns.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -247,10 +222,7 @@ Section Impl_core_clone_Clone_for_dns_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -293,9 +265,7 @@ Section Impl_core_cmp_PartialEq_for_dns_AccountId_t. let* α3 : u128.t := M.read (dns.AccountId.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -321,10 +291,7 @@ Section Impl_core_convert_From_array_u8_t_for_dns_AccountId_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -448,10 +415,7 @@ Section Impl_dns_Env_t. let* α0 : ref dns.Env.t := M.read self in M.read (dns.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -465,10 +429,7 @@ Section Impl_dns_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_dns_Env_t. End Impl_dns_Env_t. @@ -530,7 +491,7 @@ Section Impl_core_default_Default_for_dns_DomainNameService_t. Definition default : M Self := let* name_to_address : M.Val (dns.Mapping.t (array u8.t) dns.AccountId.t) := let* α0 : dns.Mapping.t (array u8.t) dns.AccountId.t := - M.call (dns.Mapping.t (array u8.t) dns.AccountId.t)::["new"] in + M.call (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "new") in M.alloc α0 in let* _ : M.Val (core.option.Option.t u32.t) := let* α0 : _ := @@ -540,14 +501,14 @@ Section Impl_core_default_Default_for_dns_DomainNameService_t. let* α2 : dns.AccountId.t := M.call dns.zero_address in let* α3 : core.option.Option.t u32.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["insert"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "insert" (borrow_mut name_to_address) α1 α2) in M.alloc α3 in let* name_to_owner : M.Val (dns.Mapping.t (array u8.t) dns.AccountId.t) := let* α0 : dns.Mapping.t (array u8.t) dns.AccountId.t := - M.call (dns.Mapping.t (array u8.t) dns.AccountId.t)::["new"] in + M.call (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "new") in M.alloc α0 in let* _ : M.Val (core.option.Option.t u32.t) := let* α0 : _ := @@ -557,7 +518,7 @@ Section Impl_core_default_Default_for_dns_DomainNameService_t. let* α2 : dns.AccountId.t := M.call dns.zero_address in let* α3 : core.option.Option.t u32.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["insert"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "insert" (borrow_mut name_to_owner) α1 α2) in @@ -576,10 +537,7 @@ Section Impl_core_default_Default_for_dns_DomainNameService_t. |} in M.read α0. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -625,9 +583,7 @@ Section Impl_core_cmp_PartialEq_for_dns_Error_t. let* α0 : M.Val bool.t := M.alloc (BinOp.Pure.eq α0 α1) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -658,10 +614,8 @@ Section Impl_core_cmp_Eq_for_dns_Error_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -686,10 +640,7 @@ Section Impl_dns_DomainNameService_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -698,11 +649,9 @@ Section Impl_dns_DomainNameService_t. *) Definition env (self : ref Self) : M dns.Env.t := let* self := M.alloc self in - M.call dns.DomainNameService.t::["init_env"]. + M.call (impl dns.DomainNameService.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -717,9 +666,7 @@ Section Impl_dns_DomainNameService_t. (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn register(&mut self, name: Hash) -> Result<()> { @@ -746,16 +693,16 @@ Section Impl_dns_DomainNameService_t. (let* caller : M.Val dns.AccountId.t := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : dns.Env.t := - M.call (dns.DomainNameService.t::["env"] (borrow (deref α0))) in + M.call (impl dns.DomainNameService.t "env" (borrow (deref α0))) in let* α2 : M.Val dns.Env.t := M.alloc α1 in let* α3 : dns.AccountId.t := - M.call (dns.Env.t::["caller"] (borrow α2)) in + M.call (impl dns.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : bool.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["contains"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "contains" (borrow (dns.DomainNameService.Get_name_to_owner (deref α0))) (borrow name)) in let* α2 : M.Val bool.t := M.alloc α1 in @@ -774,7 +721,7 @@ Section Impl_dns_DomainNameService_t. let* α2 : dns.AccountId.t := M.read caller in let* α3 : core.option.Option.t u32.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["insert"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "insert" (borrow_mut (dns.DomainNameService.Get_name_to_owner (deref α0))) α1 α2) in @@ -782,13 +729,13 @@ Section Impl_dns_DomainNameService_t. let* _ : M.Val unit := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : dns.Env.t := - M.call (dns.DomainNameService.t::["env"] (borrow (deref α0))) in + M.call (impl dns.DomainNameService.t "env" (borrow (deref α0))) in let* α2 : M.Val dns.Env.t := M.alloc α1 in let* α3 : array u8.t := M.read name in let* α4 : dns.AccountId.t := M.read caller in let* α5 : unit := M.call - (dns.Env.t::["emit_event"] + (impl dns.Env.t "emit_event" (borrow α2) (dns.Event.Register {| dns.Register.name := α3; dns.Register.from := α4; |})) in @@ -797,10 +744,7 @@ Section Impl_dns_DomainNameService_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_register : - Notations.DoubleColon Self "register" := { - Notations.double_colon := register; - }. + Axiom register_is_impl : impl Self "register" = register. (* fn get_owner_or_default(&self, name: Hash) -> AccountId { @@ -818,18 +762,16 @@ Section Impl_dns_DomainNameService_t. let* α0 : ref dns.DomainNameService.t := M.read self in let* α1 : core.option.Option.t dns.AccountId.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["get"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "get" (borrow (dns.DomainNameService.Get_name_to_owner (deref α0))) (borrow name)) in let* α2 : ref dns.DomainNameService.t := M.read self in let* α3 : dns.AccountId.t := M.read (dns.DomainNameService.Get_default_address (deref α2)) in - M.call ((core.option.Option.t dns.AccountId.t)::["unwrap_or"] α1 α3). + M.call (impl (core.option.Option.t dns.AccountId.t) "unwrap_or" α1 α3). - Global Instance AssociatedFunction_get_owner_or_default : - Notations.DoubleColon Self "get_owner_or_default" := { - Notations.double_colon := get_owner_or_default; - }. + Axiom get_owner_or_default_is_impl : + impl Self "get_owner_or_default" = get_owner_or_default. (* pub fn set_address(&mut self, name: Hash, new_address: AccountId) -> Result<()> { @@ -864,17 +806,17 @@ Section Impl_dns_DomainNameService_t. (let* caller : M.Val dns.AccountId.t := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : dns.Env.t := - M.call (dns.DomainNameService.t::["env"] (borrow (deref α0))) in + M.call (impl dns.DomainNameService.t "env" (borrow (deref α0))) in let* α2 : M.Val dns.Env.t := M.alloc α1 in let* α3 : dns.AccountId.t := - M.call (dns.Env.t::["caller"] (borrow α2)) in + M.call (impl dns.Env.t "caller" (borrow α2)) in M.alloc α3 in let* owner : M.Val dns.AccountId.t := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : array u8.t := M.read name in let* α2 : dns.AccountId.t := M.call - (dns.DomainNameService.t::["get_owner_or_default"] + (impl dns.DomainNameService.t "get_owner_or_default" (borrow (deref α0)) α1) in M.alloc α2 in @@ -900,7 +842,7 @@ Section Impl_dns_DomainNameService_t. let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : core.option.Option.t dns.AccountId.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["get"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "get" (borrow (dns.DomainNameService.Get_name_to_address (deref α0))) (borrow name)) in M.alloc α1 in @@ -910,7 +852,7 @@ Section Impl_dns_DomainNameService_t. let* α2 : dns.AccountId.t := M.read new_address in let* α3 : core.option.Option.t u32.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["insert"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "insert" (borrow_mut (dns.DomainNameService.Get_name_to_address (deref α0))) α1 @@ -919,7 +861,7 @@ Section Impl_dns_DomainNameService_t. let* _ : M.Val unit := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : dns.Env.t := - M.call (dns.DomainNameService.t::["env"] (borrow (deref α0))) in + M.call (impl dns.DomainNameService.t "env" (borrow (deref α0))) in let* α2 : M.Val dns.Env.t := M.alloc α1 in let* α3 : array u8.t := M.read name in let* α4 : dns.AccountId.t := M.read caller in @@ -927,7 +869,7 @@ Section Impl_dns_DomainNameService_t. let* α6 : dns.AccountId.t := M.read new_address in let* α7 : unit := M.call - (dns.Env.t::["emit_event"] + (impl dns.Env.t "emit_event" (borrow α2) (dns.Event.SetAddress {| @@ -941,10 +883,7 @@ Section Impl_dns_DomainNameService_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_set_address : - Notations.DoubleColon Self "set_address" := { - Notations.double_colon := set_address; - }. + Axiom set_address_is_impl : impl Self "set_address" = set_address. (* pub fn transfer(&mut self, name: Hash, to: AccountId) -> Result<()> { @@ -980,17 +919,17 @@ Section Impl_dns_DomainNameService_t. (let* caller : M.Val dns.AccountId.t := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : dns.Env.t := - M.call (dns.DomainNameService.t::["env"] (borrow (deref α0))) in + M.call (impl dns.DomainNameService.t "env" (borrow (deref α0))) in let* α2 : M.Val dns.Env.t := M.alloc α1 in let* α3 : dns.AccountId.t := - M.call (dns.Env.t::["caller"] (borrow α2)) in + M.call (impl dns.Env.t "caller" (borrow α2)) in M.alloc α3 in let* owner : M.Val dns.AccountId.t := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : array u8.t := M.read name in let* α2 : dns.AccountId.t := M.call - (dns.DomainNameService.t::["get_owner_or_default"] + (impl dns.DomainNameService.t "get_owner_or_default" (borrow (deref α0)) α1) in M.alloc α2 in @@ -1016,7 +955,7 @@ Section Impl_dns_DomainNameService_t. let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : core.option.Option.t dns.AccountId.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["get"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "get" (borrow (dns.DomainNameService.Get_name_to_owner (deref α0))) (borrow name)) in M.alloc α1 in @@ -1026,7 +965,7 @@ Section Impl_dns_DomainNameService_t. let* α2 : dns.AccountId.t := M.read to in let* α3 : core.option.Option.t u32.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["insert"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "insert" (borrow_mut (dns.DomainNameService.Get_name_to_owner (deref α0))) α1 α2) in @@ -1034,7 +973,7 @@ Section Impl_dns_DomainNameService_t. let* _ : M.Val unit := let* α0 : mut_ref dns.DomainNameService.t := M.read self in let* α1 : dns.Env.t := - M.call (dns.DomainNameService.t::["env"] (borrow (deref α0))) in + M.call (impl dns.DomainNameService.t "env" (borrow (deref α0))) in let* α2 : M.Val dns.Env.t := M.alloc α1 in let* α3 : array u8.t := M.read name in let* α4 : dns.AccountId.t := M.read caller in @@ -1042,7 +981,7 @@ Section Impl_dns_DomainNameService_t. let* α6 : dns.AccountId.t := M.read to in let* α7 : unit := M.call - (dns.Env.t::["emit_event"] + (impl dns.Env.t "emit_event" (borrow α2) (dns.Event.Transfer {| @@ -1056,10 +995,7 @@ Section Impl_dns_DomainNameService_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn get_address_or_default(&self, name: Hash) -> AccountId { @@ -1077,18 +1013,16 @@ Section Impl_dns_DomainNameService_t. let* α0 : ref dns.DomainNameService.t := M.read self in let* α1 : core.option.Option.t dns.AccountId.t := M.call - ((dns.Mapping.t (array u8.t) dns.AccountId.t)::["get"] + (impl (dns.Mapping.t (array u8.t) dns.AccountId.t) "get" (borrow (dns.DomainNameService.Get_name_to_address (deref α0))) (borrow name)) in let* α2 : ref dns.DomainNameService.t := M.read self in let* α3 : dns.AccountId.t := M.read (dns.DomainNameService.Get_default_address (deref α2)) in - M.call ((core.option.Option.t dns.AccountId.t)::["unwrap_or"] α1 α3). + M.call (impl (core.option.Option.t dns.AccountId.t) "unwrap_or" α1 α3). - Global Instance AssociatedFunction_get_address_or_default : - Notations.DoubleColon Self "get_address_or_default" := { - Notations.double_colon := get_address_or_default; - }. + Axiom get_address_or_default_is_impl : + impl Self "get_address_or_default" = get_address_or_default. (* pub fn get_address(&self, name: Hash) -> AccountId { @@ -1103,12 +1037,9 @@ Section Impl_dns_DomainNameService_t. let* name := M.alloc name in let* α0 : ref dns.DomainNameService.t := M.read self in let* α1 : array u8.t := M.read name in - M.call (dns.DomainNameService.t::["get_address_or_default"] α0 α1). + M.call (impl dns.DomainNameService.t "get_address_or_default" α0 α1). - Global Instance AssociatedFunction_get_address : - Notations.DoubleColon Self "get_address" := { - Notations.double_colon := get_address; - }. + Axiom get_address_is_impl : impl Self "get_address" = get_address. (* pub fn get_owner(&self, name: Hash) -> AccountId { @@ -1123,11 +1054,8 @@ Section Impl_dns_DomainNameService_t. let* name := M.alloc name in let* α0 : ref dns.DomainNameService.t := M.read self in let* α1 : array u8.t := M.read name in - M.call (dns.DomainNameService.t::["get_owner_or_default"] α0 α1). + M.call (impl dns.DomainNameService.t "get_owner_or_default" α0 α1). - Global Instance AssociatedFunction_get_owner : - Notations.DoubleColon Self "get_owner" := { - Notations.double_colon := get_owner; - }. + Axiom get_owner_is_impl : impl Self "get_owner" = get_owner. End Impl_dns_DomainNameService_t. End Impl_dns_DomainNameService_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/e2e_call_runtime.v b/CoqOfRust/examples/default/examples/ink_contracts/e2e_call_runtime.v index 35cb0bcdd..bd0b6cb73 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/e2e_call_runtime.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/e2e_call_runtime.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_e2e_call_runtime_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (e2e_call_runtime.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_e2e_call_runtime_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -107,10 +101,7 @@ Section Impl_e2e_call_runtime_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_balance : - Notations.DoubleColon Self "balance" := { - Notations.double_colon := balance; - }. + Axiom balance_is_impl : impl Self "balance" = balance. End Impl_e2e_call_runtime_Env_t. End Impl_e2e_call_runtime_Env_t. @@ -130,10 +121,7 @@ Section Impl_core_default_Default_for_e2e_call_runtime_Contract_t. Definition default : M e2e_call_runtime.Contract.t := M.pure e2e_call_runtime.Contract.Build. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -155,10 +143,7 @@ Section Impl_e2e_call_runtime_Contract_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -167,11 +152,9 @@ Section Impl_e2e_call_runtime_Contract_t. *) Definition env (self : ref Self) : M e2e_call_runtime.Env.t := let* self := M.alloc self in - M.call e2e_call_runtime.Contract.t::["init_env"]. + M.call (impl e2e_call_runtime.Contract.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -180,9 +163,7 @@ Section Impl_e2e_call_runtime_Contract_t. *) Definition new : M Self := M.pure e2e_call_runtime.Contract.Build. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn get_contract_balance(&self) -> Balance { @@ -195,13 +176,11 @@ Section Impl_e2e_call_runtime_Contract_t. let* self := M.alloc self in let* α0 : ref e2e_call_runtime.Contract.t := M.read self in let* α1 : e2e_call_runtime.Env.t := - M.call (e2e_call_runtime.Contract.t::["env"] α0) in + M.call (impl e2e_call_runtime.Contract.t "env" α0) in let* α2 : M.Val e2e_call_runtime.Env.t := M.alloc α1 in - M.call (e2e_call_runtime.Env.t::["balance"] (borrow α2)). + M.call (impl e2e_call_runtime.Env.t "balance" (borrow α2)). - Global Instance AssociatedFunction_get_contract_balance : - Notations.DoubleColon Self "get_contract_balance" := { - Notations.double_colon := get_contract_balance; - }. + Axiom get_contract_balance_is_impl : + impl Self "get_contract_balance" = get_contract_balance. End Impl_e2e_call_runtime_Contract_t. End Impl_e2e_call_runtime_Contract_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v b/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v index 3d6183c41..10fecdae8 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v @@ -45,10 +45,7 @@ Section Impl_core_default_Default_for_erc1155_Mapping_t_K_V. let* α3 : core.marker.PhantomData.t V := M.call α2 in M.pure {| erc1155.Mapping._key := α1; erc1155.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -74,10 +71,7 @@ Section Impl_erc1155_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -94,9 +88,7 @@ Section Impl_erc1155_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -115,10 +107,7 @@ Section Impl_erc1155_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn remove(&self, _key: K) { @@ -132,10 +121,7 @@ Section Impl_erc1155_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -152,10 +138,7 @@ Section Impl_erc1155_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -169,10 +152,7 @@ Section Impl_erc1155_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_erc1155_Mapping_t_K_V. End Impl_erc1155_Mapping_t_K_V. @@ -201,10 +181,7 @@ Section Impl_core_default_Default_for_erc1155_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (erc1155.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -233,10 +210,7 @@ Section Impl_core_clone_Clone_for_erc1155_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -282,9 +256,7 @@ Section Impl_core_cmp_PartialEq_for_erc1155_AccountId_t. let* α3 : u128.t := M.read (erc1155.AccountId.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -310,10 +282,7 @@ Section Impl_core_convert_From_array_u8_t_for_erc1155_AccountId_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -412,9 +381,7 @@ Section Impl_core_cmp_PartialEq_for_erc1155_Error_t. let* α0 : M.Val bool.t := M.alloc (BinOp.Pure.eq α0 α1) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -445,10 +412,8 @@ Section Impl_core_cmp_Eq_for_erc1155_Error_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -636,10 +601,7 @@ Section Impl_erc1155_Env_t. let* α0 : ref erc1155.Env.t := M.read self in M.read (erc1155.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -653,10 +615,7 @@ Section Impl_erc1155_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_erc1155_Env_t. End Impl_erc1155_Env_t. @@ -722,10 +681,7 @@ Section Impl_core_default_Default_for_erc1155_Contract_t. erc1155.Contract.token_id_nonce := α5; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -747,10 +703,7 @@ Section Impl_erc1155_Contract_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -759,11 +712,9 @@ Section Impl_erc1155_Contract_t. *) Definition env (self : ref Self) : M erc1155.Env.t := let* self := M.alloc self in - M.call erc1155.Contract.t::["init_env"]. + M.call (impl erc1155.Contract.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -778,9 +729,7 @@ Section Impl_erc1155_Contract_t. (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn create(&mut self, value: Balance) -> TokenId { @@ -812,10 +761,10 @@ Section Impl_erc1155_Contract_t. let* caller : M.Val erc1155.AccountId.t := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := - M.call (erc1155.Env.t::["caller"] (borrow α2)) in + M.call (impl erc1155.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* β : M.Val u128.t := @@ -833,7 +782,9 @@ Section Impl_erc1155_Contract_t. let* α4 : u128.t := M.read value in let* α5 : core.option.Option.t u32.t := M.call - ((erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t)::["insert"] + (impl + (erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t) + "insert" (borrow_mut (erc1155.Contract.Get_balances (deref α0))) (α1, α3) α4) in @@ -841,7 +792,7 @@ Section Impl_erc1155_Contract_t. let* _ : M.Val unit := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := M.read caller in let* α4 : u128.t := M.read value in @@ -861,7 +812,7 @@ Section Impl_erc1155_Contract_t. let* α11 : u128.t := M.read value in let* α12 : unit := M.call - (erc1155.Env.t::["emit_event"] + (impl erc1155.Env.t "emit_event" (borrow α2) (erc1155.Event.TransferSingle {| @@ -875,10 +826,7 @@ Section Impl_erc1155_Contract_t. let* α0 : mut_ref erc1155.Contract.t := M.read self in M.read (erc1155.Contract.Get_token_id_nonce (deref α0)). - Global Instance AssociatedFunction_create : - Notations.DoubleColon Self "create" := { - Notations.double_colon := create; - }. + Axiom create_is_impl : impl Self "create" = create. (* pub fn mint(&mut self, token_id: TokenId, value: Balance) -> Result<()> { @@ -934,10 +882,10 @@ Section Impl_erc1155_Contract_t. let* caller : M.Val erc1155.AccountId.t := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := - M.call (erc1155.Env.t::["caller"] (borrow α2)) in + M.call (impl erc1155.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val (core.option.Option.t u32.t) := let* α0 : mut_ref erc1155.Contract.t := M.read self in @@ -946,9 +894,9 @@ Section Impl_erc1155_Contract_t. let* α3 : u128.t := M.read value in let* α4 : core.option.Option.t u32.t := M.call - ((erc1155.Mapping.t - (erc1155.AccountId.t * u128.t) - u128.t)::["insert"] + (impl + (erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t) + "insert" (borrow_mut (erc1155.Contract.Get_balances (deref α0))) (α1, α2) α3) in @@ -956,7 +904,7 @@ Section Impl_erc1155_Contract_t. let* _ : M.Val unit := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := M.read caller in let* α4 : erc1155.AccountId.t := M.read caller in @@ -964,7 +912,7 @@ Section Impl_erc1155_Contract_t. let* α6 : u128.t := M.read value in let* α7 : unit := M.call - (erc1155.Env.t::["emit_event"] + (impl erc1155.Env.t "emit_event" (borrow α2) (erc1155.Event.TransferSingle {| @@ -979,10 +927,7 @@ Section Impl_erc1155_Contract_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_mint : - Notations.DoubleColon Self "mint" := { - Notations.double_colon := mint; - }. + Axiom mint_is_impl : impl Self "mint" = mint. (* fn perform_transfer( @@ -1032,14 +977,14 @@ Section Impl_erc1155_Contract_t. let* α3 : M.Val (erc1155.AccountId.t * u128.t) := M.alloc (α1, α2) in let* α4 : core.option.Option.t u128.t := M.call - ((erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t)::["get"] + (impl (erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t) "get" (borrow (erc1155.Contract.Get_balances (deref α0))) (borrow α3)) in let* α5 : ref str.t := M.read (mk_str "Caller should have ensured that `from` holds `token_id`.") in let* α6 : u128.t := - M.call ((core.option.Option.t u128.t)::["expect"] α4 α5) in + M.call (impl (core.option.Option.t u128.t) "expect" α4 α5) in M.alloc α6 in let* _ : M.Val unit := let β : M.Val u128.t := sender_balance in @@ -1054,7 +999,9 @@ Section Impl_erc1155_Contract_t. let* α3 : u128.t := M.read sender_balance in let* α4 : core.option.Option.t u32.t := M.call - ((erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t)::["insert"] + (impl + (erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t) + "insert" (borrow_mut (erc1155.Contract.Get_balances (deref α0))) (α1, α2) α3) in @@ -1066,13 +1013,13 @@ Section Impl_erc1155_Contract_t. let* α3 : M.Val (erc1155.AccountId.t * u128.t) := M.alloc (α1, α2) in let* α4 : core.option.Option.t u128.t := M.call - ((erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t)::["get"] + (impl (erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t) "get" (borrow (erc1155.Contract.Get_balances (deref α0))) (borrow α3)) in let* α5 : M.Val u128.t := M.alloc ((Integer.of_Z 0) : u128.t) in let* α6 : u128.t := M.read (use α5) in let* α7 : u128.t := - M.call ((core.option.Option.t u128.t)::["unwrap_or"] α4 α6) in + M.call (impl (core.option.Option.t u128.t) "unwrap_or" α4 α6) in M.alloc α7 in let* _ : M.Val unit := let β : M.Val u128.t := recipient_balance in @@ -1087,7 +1034,9 @@ Section Impl_erc1155_Contract_t. let* α3 : u128.t := M.read recipient_balance in let* α4 : core.option.Option.t u32.t := M.call - ((erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t)::["insert"] + (impl + (erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t) + "insert" (borrow_mut (erc1155.Contract.Get_balances (deref α0))) (α1, α2) α3) in @@ -1095,15 +1044,15 @@ Section Impl_erc1155_Contract_t. let* caller : M.Val erc1155.AccountId.t := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := - M.call (erc1155.Env.t::["caller"] (borrow α2)) in + M.call (impl erc1155.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := M.read caller in let* α4 : erc1155.AccountId.t := M.read from in @@ -1112,7 +1061,7 @@ Section Impl_erc1155_Contract_t. let* α7 : u128.t := M.read value in let* α8 : unit := M.call - (erc1155.Env.t::["emit_event"] + (impl erc1155.Env.t "emit_event" (borrow α2) (erc1155.Event.TransferSingle {| @@ -1126,10 +1075,8 @@ Section Impl_erc1155_Contract_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_perform_transfer : - Notations.DoubleColon Self "perform_transfer" := { - Notations.double_colon := perform_transfer; - }. + Axiom perform_transfer_is_impl : + impl Self "perform_transfer" = perform_transfer. (* fn transfer_acceptance_check( @@ -1222,10 +1169,8 @@ Section Impl_erc1155_Contract_t. let* data := M.alloc data in M.pure tt. - Global Instance AssociatedFunction_transfer_acceptance_check : - Notations.DoubleColon Self "transfer_acceptance_check" := { - Notations.double_colon := transfer_acceptance_check; - }. + Axiom transfer_acceptance_check_is_impl : + impl Self "transfer_acceptance_check" = transfer_acceptance_check. End Impl_erc1155_Contract_t. End Impl_erc1155_Contract_t. @@ -1252,16 +1197,14 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α3 : M.Val (erc1155.AccountId.t * erc1155.AccountId.t) := M.alloc (α1, α2) in M.call - ((erc1155.Mapping.t - (erc1155.AccountId.t * erc1155.AccountId.t) - unit)::["contains"] + (impl + (erc1155.Mapping.t (erc1155.AccountId.t * erc1155.AccountId.t) unit) + "contains" (borrow (erc1155.Contract.Get_approvals (deref α0))) (borrow α3)). - Global Instance AssociatedFunction_is_approved_for_all : - Notations.DoubleColon Self "is_approved_for_all" := { - Notations.double_colon := is_approved_for_all; - }. + Axiom is_approved_for_all_is_impl : + impl Self "is_approved_for_all" = is_approved_for_all. (* fn balance_of(&self, owner: AccountId, token_id: TokenId) -> Balance { @@ -1282,17 +1225,14 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α3 : M.Val (erc1155.AccountId.t * u128.t) := M.alloc (α1, α2) in let* α4 : core.option.Option.t u128.t := M.call - ((erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t)::["get"] + (impl (erc1155.Mapping.t (erc1155.AccountId.t * u128.t) u128.t) "get" (borrow (erc1155.Contract.Get_balances (deref α0))) (borrow α3)) in let* α5 : M.Val u128.t := M.alloc ((Integer.of_Z 0) : u128.t) in let* α6 : u128.t := M.read (use α5) in - M.call ((core.option.Option.t u128.t)::["unwrap_or"] α4 α6). + M.call (impl (core.option.Option.t u128.t) "unwrap_or" α4 α6). - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* fn safe_transfer_from( @@ -1338,10 +1278,10 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (let* caller : M.Val erc1155.AccountId.t := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := - M.call (erc1155.Env.t::["caller"] (borrow α2)) in + M.call (impl erc1155.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : _ := @@ -1440,7 +1380,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α3 : u128.t := M.read token_id in let* α4 : u128.t := M.read value in let* α5 : unit := - M.call (erc1155.Contract.t::["perform_transfer"] α0 α1 α2 α3 α4) in + M.call (impl erc1155.Contract.t "perform_transfer" α0 α1 α2 α3 α4) in M.alloc α5 in let* _ : M.Val unit := let* α0 : mut_ref erc1155.Contract.t := M.read self in @@ -1452,7 +1392,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α6 : alloc.vec.Vec.t u8.t alloc.alloc.Global.t := M.read data in let* α7 : unit := M.call - (erc1155.Contract.t::["transfer_acceptance_check"] + (impl erc1155.Contract.t "transfer_acceptance_check" α0 α1 α2 @@ -1465,10 +1405,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_safe_transfer_from : - Notations.DoubleColon Self "safe_transfer_from" := { - Notations.double_colon := safe_transfer_from; - }. + Axiom safe_transfer_from_is_impl : + impl Self "safe_transfer_from" = safe_transfer_from. (* fn safe_batch_transfer_from( @@ -1529,10 +1467,10 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (let* caller : M.Val erc1155.AccountId.t := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := - M.call (erc1155.Env.t::["caller"] (borrow α2)) in + M.call (impl erc1155.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : _ := @@ -1601,7 +1539,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* _ : M.Val unit := let* α0 : bool.t := M.call - ((alloc.vec.Vec.t u128.t alloc.alloc.Global.t)::["is_empty"] + (impl (alloc.vec.Vec.t u128.t alloc.alloc.Global.t) "is_empty" (borrow token_ids)) in let* α1 : M.Val bool.t := M.alloc (UnOp.not (UnOp.not α0)) in let* α2 : bool.t := M.read (use α1) in @@ -1623,11 +1561,11 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* _ : M.Val unit := let* α0 : usize.t := M.call - ((alloc.vec.Vec.t u128.t alloc.alloc.Global.t)::["len"] + (impl (alloc.vec.Vec.t u128.t alloc.alloc.Global.t) "len" (borrow token_ids)) in let* α1 : usize.t := M.call - ((alloc.vec.Vec.t u128.t alloc.alloc.Global.t)::["len"] + (impl (alloc.vec.Vec.t u128.t alloc.alloc.Global.t) "len" (borrow values)) in let* α2 : M.Val bool.t := M.alloc (UnOp.not (BinOp.Pure.eq α0 α1)) in let* α3 : bool.t := M.read (use α2) in @@ -1664,7 +1602,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (Trait := ℐ))) in let* α2 : ref (slice u128.t) := M.call (α1 (borrow token_ids)) in let* α3 : core.slice.iter.Iter.t u128.t := - M.call ((slice u128.t)::["iter"] α2) in + M.call (impl (slice u128.t) "iter" α2) in let* α4 : _ := ltac:(M.get_method (fun ℐ => core.ops.deref.Deref.deref @@ -1672,7 +1610,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (Trait := ℐ))) in let* α5 : ref (slice u128.t) := M.call (α4 (borrow values)) in let* α6 : core.slice.iter.Iter.t u128.t := - M.call ((slice u128.t)::["iter"] α5) in + M.call (impl (slice u128.t) "iter" α5) in let* α7 : core.iter.adapters.zip.Zip.t (core.slice.iter.Iter.t u128.t) @@ -1900,7 +1838,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α4 : u128.t := M.read v in let* α5 : unit := M.call - (erc1155.Contract.t::["perform_transfer"] + (impl erc1155.Contract.t "perform_transfer" α0 α1 α2 @@ -1943,7 +1881,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α10 : alloc.vec.Vec.t u8.t alloc.alloc.Global.t := M.read data in let* α11 : unit := M.call - (erc1155.Contract.t::["transfer_acceptance_check"] + (impl erc1155.Contract.t "transfer_acceptance_check" α0 α1 α2 @@ -1956,10 +1894,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_safe_batch_transfer_from : - Notations.DoubleColon Self "safe_batch_transfer_from" := { - Notations.double_colon := safe_batch_transfer_from; - }. + Axiom safe_batch_transfer_from_is_impl : + impl Self "safe_batch_transfer_from" = safe_batch_transfer_from. (* fn balance_of_batch(&self, owners: Vec, token_ids: Vec) -> Vec { @@ -1985,7 +1921,7 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* token_ids := M.alloc token_ids in let* output : M.Val (alloc.vec.Vec.t u128.t alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t u128.t alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t u128.t alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t u128.t alloc.alloc.Global.t) "new") in M.alloc α0 in let* _ : M.Val unit := let* α0 : _ := @@ -2117,9 +2053,11 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. M.read amount in let* α1 : unit := M.call - ((alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t u128.t - alloc.alloc.Global.t)::["push"] + alloc.alloc.Global.t) + "push" (borrow_mut output) α0) in M.alloc α1 in @@ -2142,10 +2080,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. M.pure (use α3) in M.read output. - Global Instance AssociatedFunction_balance_of_batch : - Notations.DoubleColon Self "balance_of_batch" := { - Notations.double_colon := balance_of_batch; - }. + Axiom balance_of_batch_is_impl : + impl Self "balance_of_batch" = balance_of_batch. (* fn set_approval_for_all(&mut self, operator: AccountId, approved: bool) -> Result<()> { @@ -2180,10 +2116,10 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. (let* caller : M.Val erc1155.AccountId.t := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := - M.call (erc1155.Env.t::["caller"] (borrow α2)) in + M.call (impl erc1155.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : _ := @@ -2218,9 +2154,11 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α2 : erc1155.AccountId.t := M.read operator in let* α3 : core.option.Option.t u32.t := M.call - ((erc1155.Mapping.t + (impl + (erc1155.Mapping.t (erc1155.AccountId.t * erc1155.AccountId.t) - unit)::["insert"] + unit) + "insert" (borrow_mut (erc1155.Contract.Get_approvals (deref α0))) (α1, α2) tt) in @@ -2233,9 +2171,11 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* α2 : erc1155.AccountId.t := M.read operator in let* α3 : unit := M.call - ((erc1155.Mapping.t + (impl + (erc1155.Mapping.t (erc1155.AccountId.t * erc1155.AccountId.t) - unit)::["remove"] + unit) + "remove" (borrow (erc1155.Contract.Get_approvals (deref α0))) (α1, α2)) in M.alloc α3 in @@ -2243,14 +2183,14 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. let* _ : M.Val unit := let* α0 : mut_ref erc1155.Contract.t := M.read self in let* α1 : erc1155.Env.t := - M.call (erc1155.Contract.t::["env"] (borrow (deref α0))) in + M.call (impl erc1155.Contract.t "env" (borrow (deref α0))) in let* α2 : M.Val erc1155.Env.t := M.alloc α1 in let* α3 : erc1155.AccountId.t := M.read caller in let* α4 : erc1155.AccountId.t := M.read operator in let* α5 : bool.t := M.read approved in let* α6 : unit := M.call - (erc1155.Env.t::["emit_event"] + (impl erc1155.Env.t "emit_event" (borrow α2) (erc1155.Event.ApprovalForAll {| @@ -2263,10 +2203,8 @@ Section Impl_erc1155_Erc1155_for_erc1155_Contract_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_set_approval_for_all : - Notations.DoubleColon Self "set_approval_for_all" := { - Notations.double_colon := set_approval_for_all; - }. + Axiom set_approval_for_all_is_impl : + impl Self "set_approval_for_all" = set_approval_for_all. Global Instance ℐ : erc1155.Erc1155.Trait Self := { erc1155.Erc1155.is_approved_for_all := is_approved_for_all; @@ -2329,21 +2267,18 @@ Section Impl_erc1155_Erc1155TokenReceiver_for_erc1155_Contract_t. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in never_to_any α9. - Global Instance AssociatedFunction_on_received : - Notations.DoubleColon Self "on_received" := { - Notations.double_colon := on_received; - }. + Axiom on_received_is_impl : impl Self "on_received" = on_received. (* fn on_batch_received( @@ -2393,21 +2328,19 @@ Section Impl_erc1155_Erc1155TokenReceiver_for_erc1155_Contract_t. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in never_to_any α9. - Global Instance AssociatedFunction_on_batch_received : - Notations.DoubleColon Self "on_batch_received" := { - Notations.double_colon := on_batch_received; - }. + Axiom on_batch_received_is_impl : + impl Self "on_batch_received" = on_batch_received. Global Instance ℐ : erc1155.Erc1155TokenReceiver.Trait Self := { erc1155.Erc1155TokenReceiver.on_received := on_received; diff --git a/CoqOfRust/examples/default/examples/ink_contracts/erc20.v b/CoqOfRust/examples/default/examples/ink_contracts/erc20.v index cc6b70158..5c5e8431b 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/erc20.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/erc20.v @@ -49,10 +49,7 @@ Section Impl_core_default_Default_for_erc20_Mapping_t_K_V. let* α3 : core.marker.PhantomData.t V := M.call α2 in M.pure {| erc20.Mapping._key := α1; erc20.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -81,9 +78,7 @@ Section Impl_erc20_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) { @@ -98,10 +93,7 @@ Section Impl_erc20_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. End Impl_erc20_Mapping_t_K_V. *) End Impl_erc20_Mapping_t_K_V. *) @@ -130,10 +122,7 @@ Section Impl_core_default_Default_for_erc20_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (erc20.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -162,10 +151,7 @@ Section Impl_core_clone_Clone_for_erc20_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -255,10 +241,7 @@ Section Impl_core_default_Default_for_erc20_Erc20_t. erc20.Erc20.allowances := α5; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -342,10 +325,7 @@ Section Impl_erc20_Env_t. let* α0 : ref erc20.Env.t := M.read self in M.read (erc20.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -361,10 +341,7 @@ Section Impl_erc20_Env_t. let* events := M.read ref_events in M.write ref_events (event :: events). - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_erc20_Env_t. End Impl_erc20_Env_t. @@ -381,10 +358,7 @@ Section Impl_erc20_Erc20_t. let* env : erc20.Env.t * ref (list erc20.Event.t) := M.read_env in M.pure (fst env). - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -393,11 +367,9 @@ Section Impl_erc20_Erc20_t. *) Definition env (self : ref Self) : M erc20.Env.t := let* self := M.alloc self in - M.call erc20.Erc20.t::["init_env"]. + M.call (impl erc20.Erc20.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. End Impl_erc20_Erc20_t. End Impl_erc20_Erc20_t. @@ -433,29 +405,29 @@ Section Impl_erc20_Erc20_t_2. let* α1 : erc20.Mapping.t erc20.AccountId.t u128.t := M.call α0 in M.alloc α1 in let* caller : M.Val erc20.AccountId.t := - let* α0 : erc20.Env.t := M.call erc20.Erc20.t::["init_env"] in + let* α0 : erc20.Env.t := M.call (impl erc20.Erc20.t "init_env") in let* α1 : M.Val erc20.Env.t := M.alloc α0 in let* α2 : erc20.AccountId.t := - M.call (erc20.Env.t::["caller"] (borrow α1)) in + M.call (impl erc20.Env.t "caller" (borrow α1)) in M.alloc α2 in let* _ : M.Val unit := let* α0 : erc20.AccountId.t := M.read caller in let* α1 : u128.t := M.read total_supply in let* α2 : unit := M.call - ((erc20.Mapping.t erc20.AccountId.t u128.t)::["insert"] + (impl (erc20.Mapping.t erc20.AccountId.t u128.t) "insert" (borrow_mut balances) α0 α1) in M.alloc α2 in let* _ : M.Val unit := - let* α0 : erc20.Env.t := M.call erc20.Erc20.t::["init_env"] in + let* α0 : erc20.Env.t := M.call (impl erc20.Erc20.t "init_env") in let* α1 : M.Val erc20.Env.t := M.alloc α0 in let* α2 : erc20.AccountId.t := M.read caller in let* α3 : u128.t := M.read total_supply in let* α4 : unit := M.call - (erc20.Env.t::["emit_event"] + (impl erc20.Env.t "emit_event" (borrow α1) (erc20.Event.Transfer {| @@ -483,9 +455,7 @@ Section Impl_erc20_Erc20_t_2. |} in M.read α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn total_supply(&self) -> Balance { @@ -497,10 +467,7 @@ Section Impl_erc20_Erc20_t_2. let* α0 : ref erc20.Erc20.t := M.read self in M.read (erc20.Erc20.Get_total_supply (deref α0)). - Global Instance AssociatedFunction_total_supply : - Notations.DoubleColon Self "total_supply" := { - Notations.double_colon := total_supply; - }. + Axiom total_supply_is_impl : impl Self "total_supply" = total_supply. (* fn balance_of_impl(&self, owner: &AccountId) -> Balance { @@ -517,15 +484,12 @@ Section Impl_erc20_Erc20_t_2. let* α1 : ref erc20.AccountId.t := M.read owner in let* α2 : core.option.Option.t u128.t := M.call - ((erc20.Mapping.t erc20.AccountId.t u128.t)::["get"] + (impl (erc20.Mapping.t erc20.AccountId.t u128.t) "get" (borrow (erc20.Erc20.Get_balances (deref α0))) α1) in - M.call ((core.option.Option.t u128.t)::["unwrap_or_default"] α2). + M.call (impl (core.option.Option.t u128.t) "unwrap_or_default" α2). - Global Instance AssociatedFunction_balance_of_impl : - Notations.DoubleColon Self "balance_of_impl" := { - Notations.double_colon := balance_of_impl; - }. + Axiom balance_of_impl_is_impl : impl Self "balance_of_impl" = balance_of_impl. (* fn balance_of(&self, owner: AccountId) -> Balance { @@ -539,12 +503,9 @@ Section Impl_erc20_Erc20_t_2. let* self := M.alloc self in let* owner := M.alloc owner in let* α0 : ref erc20.Erc20.t := M.read self in - M.call (erc20.Erc20.t::["balance_of_impl"] α0 (borrow owner)). + M.call (impl erc20.Erc20.t "balance_of_impl" α0 (borrow owner)). - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* fn allowance_impl(&self, owner: &AccountId, spender: &AccountId) -> Balance { @@ -568,17 +529,14 @@ Section Impl_erc20_Erc20_t_2. M.alloc (α2, α4) in let* α6 : core.option.Option.t u128.t := M.call - ((erc20.Mapping.t - (erc20.AccountId.t * erc20.AccountId.t) - u128.t)::["get"] + (impl + (erc20.Mapping.t (erc20.AccountId.t * erc20.AccountId.t) u128.t) + "get" (borrow (erc20.Erc20.Get_allowances (deref α0))) (borrow α5)) in - M.call ((core.option.Option.t u128.t)::["unwrap_or_default"] α6). + M.call (impl (core.option.Option.t u128.t) "unwrap_or_default" α6). - Global Instance AssociatedFunction_allowance_impl : - Notations.DoubleColon Self "allowance_impl" := { - Notations.double_colon := allowance_impl; - }. + Axiom allowance_impl_is_impl : impl Self "allowance_impl" = allowance_impl. (* fn allowance(&self, owner: AccountId, spender: AccountId) -> Balance { @@ -595,12 +553,9 @@ Section Impl_erc20_Erc20_t_2. let* spender := M.alloc spender in let* α0 : ref erc20.Erc20.t := M.read self in M.call - (erc20.Erc20.t::["allowance_impl"] α0 (borrow owner) (borrow spender)). + (impl erc20.Erc20.t "allowance_impl" α0 (borrow owner) (borrow spender)). - Global Instance AssociatedFunction_allowance : - Notations.DoubleColon Self "allowance" := { - Notations.double_colon := allowance; - }. + Axiom allowance_is_impl : impl Self "allowance" = allowance. (* fn transfer_from_to(&mut self, from: &AccountId, to: &AccountId, value: Balance) -> Result<()> { @@ -636,7 +591,8 @@ Section Impl_erc20_Erc20_t_2. let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : ref erc20.AccountId.t := M.read from in let* α2 : u128.t := - M.call (erc20.Erc20.t::["balance_of_impl"] (borrow (deref α0)) α1) in + M.call + (impl erc20.Erc20.t "balance_of_impl" (borrow (deref α0)) α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : u128.t := M.read from_balance in @@ -660,7 +616,7 @@ Section Impl_erc20_Erc20_t_2. let* α5 : u128.t := BinOp.Panic.sub α3 α4 in let* α6 : unit := M.call - ((erc20.Mapping.t erc20.AccountId.t u128.t)::["insert"] + (impl (erc20.Mapping.t erc20.AccountId.t u128.t) "insert" (borrow_mut (erc20.Erc20.Get_balances (deref α0))) α2 α5) in @@ -669,7 +625,8 @@ Section Impl_erc20_Erc20_t_2. let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : ref erc20.AccountId.t := M.read to in let* α2 : u128.t := - M.call (erc20.Erc20.t::["balance_of_impl"] (borrow (deref α0)) α1) in + M.call + (impl erc20.Erc20.t "balance_of_impl" (borrow (deref α0)) α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : mut_ref erc20.Erc20.t := M.read self in @@ -680,7 +637,7 @@ Section Impl_erc20_Erc20_t_2. let* α5 : u128.t := BinOp.Panic.add α3 α4 in let* α6 : unit := M.call - ((erc20.Mapping.t erc20.AccountId.t u128.t)::["insert"] + (impl (erc20.Mapping.t erc20.AccountId.t u128.t) "insert" (borrow_mut (erc20.Erc20.Get_balances (deref α0))) α2 α5) in @@ -688,7 +645,7 @@ Section Impl_erc20_Erc20_t_2. let* _ : M.Val unit := let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : erc20.Env.t := - M.call (erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val erc20.Env.t := M.alloc α1 in let* α3 : ref erc20.AccountId.t := M.read from in let* α4 : erc20.AccountId.t := M.read (deref α3) in @@ -697,7 +654,7 @@ Section Impl_erc20_Erc20_t_2. let* α7 : u128.t := M.read value in let* α8 : unit := M.call - (erc20.Env.t::["emit_event"] + (impl erc20.Env.t "emit_event" (borrow α2) (erc20.Event.Transfer {| @@ -710,10 +667,8 @@ Section Impl_erc20_Erc20_t_2. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_transfer_from_to : - Notations.DoubleColon Self "transfer_from_to" := { - Notations.double_colon := transfer_from_to; - }. + Axiom transfer_from_to_is_impl : + impl Self "transfer_from_to" = transfer_from_to. (* fn transfer(&mut self, to: AccountId, value: Balance) -> Result<()> { @@ -732,23 +687,24 @@ Section Impl_erc20_Erc20_t_2. let* from : M.Val erc20.AccountId.t := let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : erc20.Env.t := - M.call (erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val erc20.Env.t := M.alloc α1 in let* α3 : erc20.AccountId.t := - M.call (erc20.Env.t::["caller"] (borrow α2)) in + M.call (impl erc20.Env.t "caller" (borrow α2)) in M.alloc α3 in let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : u128.t := M.read value in let* α2 : core.result.Result.t unit erc20.Error.t := M.call - (erc20.Erc20.t::["transfer_from_to"] α0 (borrow from) (borrow to) α1) in + (impl erc20.Erc20.t "transfer_from_to" + α0 + (borrow from) + (borrow to) + α1) in let* α0 : M.Val (core.result.Result.t unit erc20.Error.t) := M.alloc α2 in M.read α0. - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn approve(&mut self, spender: AccountId, value: Balance) -> Result<()> { @@ -773,10 +729,10 @@ Section Impl_erc20_Erc20_t_2. let* owner : M.Val erc20.AccountId.t := let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : erc20.Env.t := - M.call (erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val erc20.Env.t := M.alloc α1 in let* α3 : erc20.AccountId.t := - M.call (erc20.Env.t::["caller"] (borrow α2)) in + M.call (impl erc20.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : mut_ref erc20.Erc20.t := M.read self in @@ -785,9 +741,9 @@ Section Impl_erc20_Erc20_t_2. let* α3 : u128.t := M.read value in let* α4 : unit := M.call - ((erc20.Mapping.t - (erc20.AccountId.t * erc20.AccountId.t) - u128.t)::["insert"] + (impl + (erc20.Mapping.t (erc20.AccountId.t * erc20.AccountId.t) u128.t) + "insert" (borrow_mut (erc20.Erc20.Get_allowances (deref α0))) (α1, α2) α3) in @@ -795,14 +751,14 @@ Section Impl_erc20_Erc20_t_2. let* _ : M.Val unit := let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : erc20.Env.t := - M.call (erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val erc20.Env.t := M.alloc α1 in let* α3 : erc20.AccountId.t := M.read owner in let* α4 : erc20.AccountId.t := M.read spender in let* α5 : u128.t := M.read value in let* α6 : unit := M.call - (erc20.Env.t::["emit_event"] + (impl erc20.Env.t "emit_event" (borrow α2) (erc20.Event.Approval {| @@ -815,10 +771,7 @@ Section Impl_erc20_Erc20_t_2. M.alloc (core.result.Result.Ok tt) in M.read α0. - Global Instance AssociatedFunction_approve : - Notations.DoubleColon Self "approve" := { - Notations.double_colon := approve; - }. + Axiom approve_is_impl : impl Self "approve" = approve. (* fn transfer_from(&mut self, from: AccountId, to: AccountId, value: Balance) -> Result<()> { @@ -847,16 +800,16 @@ Section Impl_erc20_Erc20_t_2. (let* caller : M.Val erc20.AccountId.t := let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : erc20.Env.t := - M.call (erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val erc20.Env.t := M.alloc α1 in let* α3 : erc20.AccountId.t := - M.call (erc20.Env.t::["caller"] (borrow α2)) in + M.call (impl erc20.Env.t "caller" (borrow α2)) in M.alloc α3 in let* allowance : M.Val u128.t := let* α0 : mut_ref erc20.Erc20.t := M.read self in let* α1 : u128.t := M.call - (erc20.Erc20.t::["allowance_impl"] + (impl erc20.Erc20.t "allowance_impl" (borrow (deref α0)) (borrow from) (borrow caller)) in @@ -885,7 +838,7 @@ Section Impl_erc20_Erc20_t_2. let* α2 : u128.t := M.read value in let* α3 : core.result.Result.t unit erc20.Error.t := M.call - (erc20.Erc20.t::["transfer_from_to"] + (impl erc20.Erc20.t "transfer_from_to" α1 (borrow from) (borrow to) @@ -954,9 +907,9 @@ Section Impl_erc20_Erc20_t_2. let* α5 : u128.t := BinOp.Panic.sub α3 α4 in let* α6 : unit := M.call - ((erc20.Mapping.t - (erc20.AccountId.t * erc20.AccountId.t) - u128.t)::["insert"] + (impl + (erc20.Mapping.t (erc20.AccountId.t * erc20.AccountId.t) u128.t) + "insert" (borrow_mut (erc20.Erc20.Get_allowances (deref α0))) (α1, α2) α5) in @@ -965,9 +918,6 @@ Section Impl_erc20_Erc20_t_2. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_transfer_from : - Notations.DoubleColon Self "transfer_from" := { - Notations.double_colon := transfer_from; - }. + Axiom transfer_from_is_impl : impl Self "transfer_from" = transfer_from. End Impl_erc20_Erc20_t_2. End Impl_erc20_Erc20_t_2. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/erc721.v b/CoqOfRust/examples/default/examples/ink_contracts/erc721.v index 95fded688..a70a97b81 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/erc721.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/erc721.v @@ -45,10 +45,7 @@ Section Impl_core_default_Default_for_erc721_Mapping_t_K_V. let* α3 : core.marker.PhantomData.t V := M.call α2 in M.pure {| erc721.Mapping._key := α1; erc721.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -74,10 +71,7 @@ Section Impl_erc721_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -94,9 +88,7 @@ Section Impl_erc721_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -115,10 +107,7 @@ Section Impl_erc721_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn remove(&self, _key: K) { @@ -132,10 +121,7 @@ Section Impl_erc721_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -152,10 +138,7 @@ Section Impl_erc721_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -169,10 +152,7 @@ Section Impl_erc721_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_erc721_Mapping_t_K_V. End Impl_erc721_Mapping_t_K_V. @@ -201,10 +181,7 @@ Section Impl_core_default_Default_for_erc721_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (erc721.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -233,10 +210,7 @@ Section Impl_core_clone_Clone_for_erc721_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -279,9 +253,7 @@ Section Impl_core_cmp_PartialEq_for_erc721_AccountId_t. let* α3 : u128.t := M.read (erc721.AccountId.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -307,10 +279,7 @@ Section Impl_core_convert_From_array_u8_t_for_erc721_AccountId_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -404,10 +373,7 @@ Section Impl_core_default_Default_for_erc721_Erc721_t. erc721.Erc721.operator_approvals := α7; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -458,9 +424,7 @@ Section Impl_core_cmp_PartialEq_for_erc721_Error_t. let* α0 : M.Val bool.t := M.alloc (BinOp.Pure.eq α0 α1) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -491,10 +455,8 @@ Section Impl_core_cmp_Eq_for_erc721_Error_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -515,10 +477,7 @@ Section Impl_core_clone_Clone_for_erc721_Error_t. let* α0 : ref erc721.Error.t := M.read self in M.read (deref α0). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -633,10 +592,7 @@ Section Impl_erc721_Env_t. let* α0 : ref erc721.Env.t := M.read self in M.read (erc721.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -650,10 +606,7 @@ Section Impl_erc721_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_erc721_Env_t. End Impl_erc721_Env_t. @@ -671,10 +624,7 @@ Section Impl_erc721_Erc721_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -683,11 +633,9 @@ Section Impl_erc721_Erc721_t. *) Definition env (self : ref Self) : M erc721.Env.t := let* self := M.alloc self in - M.call erc721.Erc721.t::["init_env"]. + M.call (impl erc721.Erc721.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -700,9 +648,7 @@ Section Impl_erc721_Erc721_t. core.default.Default.default (Self := erc721.Erc721.t) (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn balance_of_or_zero(&self, of: &AccountId) -> u32 { @@ -719,17 +665,15 @@ Section Impl_erc721_Erc721_t. let* α1 : ref erc721.AccountId.t := M.read of in let* α2 : core.option.Option.t u32.t := M.call - ((erc721.Mapping.t erc721.AccountId.t u32.t)::["get"] + (impl (erc721.Mapping.t erc721.AccountId.t u32.t) "get" (borrow (erc721.Erc721.Get_owned_tokens_count (deref α0))) α1) in let* α3 : M.Val u32.t := M.alloc ((Integer.of_Z 0) : u32.t) in let* α4 : u32.t := M.read (use α3) in - M.call ((core.option.Option.t u32.t)::["unwrap_or"] α2 α4). + M.call (impl (core.option.Option.t u32.t) "unwrap_or" α2 α4). - Global Instance AssociatedFunction_balance_of_or_zero : - Notations.DoubleColon Self "balance_of_or_zero" := { - Notations.double_colon := balance_of_or_zero; - }. + Axiom balance_of_or_zero_is_impl : + impl Self "balance_of_or_zero" = balance_of_or_zero. (* fn clear_approval(&mut self, id: TokenId) { @@ -747,17 +691,14 @@ Section Impl_erc721_Erc721_t. let* α1 : u32.t := M.read id in let* α2 : unit := M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["remove"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "remove" (borrow (erc721.Erc721.Get_token_approvals (deref α0))) α1) in M.alloc α2 in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_clear_approval : - Notations.DoubleColon Self "clear_approval" := { - Notations.double_colon := clear_approval; - }. + Axiom clear_approval_is_impl : impl Self "clear_approval" = clear_approval. (* fn approved_for_all(&self, owner: AccountId, operator: AccountId) -> bool { @@ -778,16 +719,14 @@ Section Impl_erc721_Erc721_t. let* α3 : M.Val (erc721.AccountId.t * erc721.AccountId.t) := M.alloc (α1, α2) in M.call - ((erc721.Mapping.t - (erc721.AccountId.t * erc721.AccountId.t) - unit)::["contains"] + (impl + (erc721.Mapping.t (erc721.AccountId.t * erc721.AccountId.t) unit) + "contains" (borrow (erc721.Erc721.Get_operator_approvals (deref α0))) (borrow α3)). - Global Instance AssociatedFunction_approved_for_all : - Notations.DoubleColon Self "approved_for_all" := { - Notations.double_colon := approved_for_all; - }. + Axiom approved_for_all_is_impl : + impl Self "approved_for_all" = approved_for_all. (* pub fn owner_of(&self, id: TokenId) -> Option { @@ -802,14 +741,11 @@ Section Impl_erc721_Erc721_t. let* id := M.alloc id in let* α0 : ref erc721.Erc721.t := M.read self in M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["get"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "get" (borrow (erc721.Erc721.Get_token_owner (deref α0))) (borrow id)). - Global Instance AssociatedFunction_owner_of : - Notations.DoubleColon Self "owner_of" := { - Notations.double_colon := owner_of; - }. + Axiom owner_of_is_impl : impl Self "owner_of" = owner_of. (* fn approved_or_owner(&self, from: Option, id: TokenId) -> bool { @@ -835,7 +771,7 @@ Section Impl_erc721_Erc721_t. let* α0 : ref erc721.Erc721.t := M.read self in let* α1 : u32.t := M.read id in let* α2 : core.option.Option.t erc721.AccountId.t := - M.call (erc721.Erc721.t::["owner_of"] α0 α1) in + M.call (impl erc721.Erc721.t "owner_of" α0 α1) in M.alloc α2 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -870,7 +806,7 @@ Section Impl_erc721_Erc721_t. let* α8 : ref erc721.Erc721.t := M.read self in let* α9 : core.option.Option.t erc721.AccountId.t := M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["get"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "get" (borrow (erc721.Erc721.Get_token_approvals (deref α8))) (borrow id)) in let* α10 : M.Val (core.option.Option.t erc721.AccountId.t) := M.alloc α9 in @@ -879,21 +815,21 @@ Section Impl_erc721_Erc721_t. let* α13 : core.option.Option.t erc721.AccountId.t := M.read owner in let* α14 : ref str.t := M.read (mk_str "Error with AccountId") in let* α15 : erc721.AccountId.t := - M.call ((core.option.Option.t erc721.AccountId.t)::["expect"] α13 α14) in + M.call + (impl (core.option.Option.t erc721.AccountId.t) "expect" α13 α14) in let* α16 : core.option.Option.t erc721.AccountId.t := M.read from in let* α17 : ref str.t := M.read (mk_str "Error with AccountId") in let* α18 : erc721.AccountId.t := - M.call ((core.option.Option.t erc721.AccountId.t)::["expect"] α16 α17) in + M.call + (impl (core.option.Option.t erc721.AccountId.t) "expect" α16 α17) in let* α19 : bool.t := - M.call (erc721.Erc721.t::["approved_for_all"] α12 α15 α18) in + M.call (impl erc721.Erc721.t "approved_for_all" α12 α15 α18) in let* α0 : M.Val bool.t := M.alloc (BinOp.Pure.and α4 (BinOp.Pure.or (BinOp.Pure.or α6 α11) α19)) in M.read α0. - Global Instance AssociatedFunction_approved_or_owner : - Notations.DoubleColon Self "approved_or_owner" := { - Notations.double_colon := approved_or_owner; - }. + Axiom approved_or_owner_is_impl : + impl Self "approved_or_owner" = approved_or_owner. (* fn exists(&self, id: TokenId) -> bool { @@ -908,14 +844,11 @@ Section Impl_erc721_Erc721_t. let* id := M.alloc id in let* α0 : ref erc721.Erc721.t := M.read self in M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["contains"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "contains" (borrow (erc721.Erc721.Get_token_owner (deref α0))) (borrow id)). - Global Instance AssociatedFunction_exists_ : - Notations.DoubleColon Self "exists_" := { - Notations.double_colon := exists_; - }. + Axiom exists__is_impl : impl Self "exists_" = exists_. (* pub fn balance_of(&self, owner: AccountId) -> u32 { @@ -929,12 +862,9 @@ Section Impl_erc721_Erc721_t. let* self := M.alloc self in let* owner := M.alloc owner in let* α0 : ref erc721.Erc721.t := M.read self in - M.call (erc721.Erc721.t::["balance_of_or_zero"] α0 (borrow owner)). + M.call (impl erc721.Erc721.t "balance_of_or_zero" α0 (borrow owner)). - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* pub fn get_approved(&self, id: TokenId) -> Option { @@ -949,14 +879,11 @@ Section Impl_erc721_Erc721_t. let* id := M.alloc id in let* α0 : ref erc721.Erc721.t := M.read self in M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["get"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "get" (borrow (erc721.Erc721.Get_token_approvals (deref α0))) (borrow id)). - Global Instance AssociatedFunction_get_approved : - Notations.DoubleColon Self "get_approved" := { - Notations.double_colon := get_approved; - }. + Axiom get_approved_is_impl : impl Self "get_approved" = get_approved. (* pub fn is_approved_for_all(&self, owner: AccountId, operator: AccountId) -> bool { @@ -974,12 +901,10 @@ Section Impl_erc721_Erc721_t. let* α0 : ref erc721.Erc721.t := M.read self in let* α1 : erc721.AccountId.t := M.read owner in let* α2 : erc721.AccountId.t := M.read operator in - M.call (erc721.Erc721.t::["approved_for_all"] α0 α1 α2). + M.call (impl erc721.Erc721.t "approved_for_all" α0 α1 α2). - Global Instance AssociatedFunction_is_approved_for_all : - Notations.DoubleColon Self "is_approved_for_all" := { - Notations.double_colon := is_approved_for_all; - }. + Axiom is_approved_for_all_is_impl : + impl Self "is_approved_for_all" = is_approved_for_all. (* fn approve_for_all(&mut self, to: AccountId, approved: bool) -> Result<(), Error> { @@ -1015,10 +940,10 @@ Section Impl_erc721_Erc721_t. (let* caller : M.Val erc721.AccountId.t := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : erc721.Env.t := - M.call (erc721.Erc721.t::["env"] (borrow (deref α0))) in + M.call (impl erc721.Erc721.t "env" (borrow (deref α0))) in let* α2 : M.Val erc721.Env.t := M.alloc α1 in let* α3 : erc721.AccountId.t := - M.call (erc721.Env.t::["caller"] (borrow α2)) in + M.call (impl erc721.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : _ := @@ -1041,14 +966,14 @@ Section Impl_erc721_Erc721_t. let* _ : M.Val unit := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : erc721.Env.t := - M.call (erc721.Erc721.t::["env"] (borrow (deref α0))) in + M.call (impl erc721.Erc721.t "env" (borrow (deref α0))) in let* α2 : M.Val erc721.Env.t := M.alloc α1 in let* α3 : erc721.AccountId.t := M.read caller in let* α4 : erc721.AccountId.t := M.read to in let* α5 : bool.t := M.read approved in let* α6 : unit := M.call - (erc721.Env.t::["emit_event"] + (impl erc721.Env.t "emit_event" (borrow α2) (erc721.Event.ApprovalForAll {| @@ -1066,9 +991,11 @@ Section Impl_erc721_Erc721_t. let* α2 : erc721.AccountId.t := M.read to in let* α3 : core.option.Option.t u32.t := M.call - ((erc721.Mapping.t + (impl + (erc721.Mapping.t (erc721.AccountId.t * erc721.AccountId.t) - unit)::["insert"] + unit) + "insert" (borrow_mut (erc721.Erc721.Get_operator_approvals (deref α0))) (α1, α2) tt) in @@ -1081,9 +1008,11 @@ Section Impl_erc721_Erc721_t. let* α2 : erc721.AccountId.t := M.read to in let* α3 : unit := M.call - ((erc721.Mapping.t + (impl + (erc721.Mapping.t (erc721.AccountId.t * erc721.AccountId.t) - unit)::["remove"] + unit) + "remove" (borrow (erc721.Erc721.Get_operator_approvals (deref α0))) (α1, α2)) in M.alloc α3 in @@ -1092,10 +1021,7 @@ Section Impl_erc721_Erc721_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_approve_for_all : - Notations.DoubleColon Self "approve_for_all" := { - Notations.double_colon := approve_for_all; - }. + Axiom approve_for_all_is_impl : impl Self "approve_for_all" = approve_for_all. (* pub fn set_approval_for_all(&mut self, to: AccountId, approved: bool) -> Result<(), Error> { @@ -1123,7 +1049,7 @@ Section Impl_erc721_Erc721_t. let* α2 : erc721.AccountId.t := M.read to in let* α3 : bool.t := M.read approved in let* α4 : core.result.Result.t unit erc721.Error.t := - M.call (erc721.Erc721.t::["approve_for_all"] α1 α2 α3) in + M.call (impl erc721.Erc721.t "approve_for_all" α1 α2 α3) in let* α5 : core.ops.control_flow.ControlFlow.t (core.result.Result.t core.convert.Infallible.t erc721.Error.t) @@ -1183,10 +1109,8 @@ Section Impl_erc721_Erc721_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_set_approval_for_all : - Notations.DoubleColon Self "set_approval_for_all" := { - Notations.double_colon := set_approval_for_all; - }. + Axiom set_approval_for_all_is_impl : + impl Self "set_approval_for_all" = set_approval_for_all. (* fn approve_for(&mut self, to: &AccountId, id: TokenId) -> Result<(), Error> { @@ -1230,16 +1154,16 @@ Section Impl_erc721_Erc721_t. (let* caller : M.Val erc721.AccountId.t := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : erc721.Env.t := - M.call (erc721.Erc721.t::["env"] (borrow (deref α0))) in + M.call (impl erc721.Erc721.t "env" (borrow (deref α0))) in let* α2 : M.Val erc721.Env.t := M.alloc α1 in let* α3 : erc721.AccountId.t := - M.call (erc721.Env.t::["caller"] (borrow α2)) in + M.call (impl erc721.Env.t "caller" (borrow α2)) in M.alloc α3 in let* owner : M.Val (core.option.Option.t erc721.AccountId.t) := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : u32.t := M.read id in let* α2 : core.option.Option.t erc721.AccountId.t := - M.call (erc721.Erc721.t::["owner_of"] (borrow (deref α0)) α1) in + M.call (impl erc721.Erc721.t "owner_of" (borrow (deref α0)) α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : _ := @@ -1257,11 +1181,14 @@ Section Impl_erc721_Erc721_t. let* α6 : ref str.t := M.read (mk_str "Error with AccountId") in let* α7 : erc721.AccountId.t := M.call - ((core.option.Option.t erc721.AccountId.t)::["expect"] α5 α6) in + (impl (core.option.Option.t erc721.AccountId.t) "expect" α5 α6) in let* α8 : erc721.AccountId.t := M.read caller in let* α9 : bool.t := M.call - (erc721.Erc721.t::["approved_for_all"] (borrow (deref α4)) α7 α8) in + (impl erc721.Erc721.t "approved_for_all" + (borrow (deref α4)) + α7 + α8) in let* α10 : M.Val bool.t := M.alloc (UnOp.not (BinOp.Pure.or α3 α9)) in let* α11 : bool.t := M.read (use α10) in if α11 then @@ -1304,7 +1231,7 @@ Section Impl_erc721_Erc721_t. let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : bool.t := M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["contains"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "contains" (borrow (erc721.Erc721.Get_token_approvals (deref α0))) (borrow id)) in let* α2 : M.Val bool.t := M.alloc α1 in @@ -1323,7 +1250,7 @@ Section Impl_erc721_Erc721_t. let* α3 : erc721.AccountId.t := M.read (deref α2) in let* α4 : core.option.Option.t u32.t := M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["insert"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "insert" (borrow_mut (erc721.Erc721.Get_token_approvals (deref α0))) α1 α3) in @@ -1332,7 +1259,7 @@ Section Impl_erc721_Erc721_t. let* _ : M.Val unit := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : erc721.Env.t := - M.call (erc721.Erc721.t::["env"] (borrow (deref α0))) in + M.call (impl erc721.Erc721.t "env" (borrow (deref α0))) in let* α2 : M.Val erc721.Env.t := M.alloc α1 in let* α3 : erc721.AccountId.t := M.read caller in let* α4 : ref erc721.AccountId.t := M.read to in @@ -1340,7 +1267,7 @@ Section Impl_erc721_Erc721_t. let* α6 : u32.t := M.read id in let* α7 : unit := M.call - (erc721.Env.t::["emit_event"] + (impl erc721.Env.t "emit_event" (borrow α2) (erc721.Event.Approval {| @@ -1353,10 +1280,7 @@ Section Impl_erc721_Erc721_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_approve_for : - Notations.DoubleColon Self "approve_for" := { - Notations.double_colon := approve_for; - }. + Axiom approve_for_is_impl : impl Self "approve_for" = approve_for. (* pub fn approve(&mut self, to: AccountId, id: TokenId) -> Result<(), Error> { @@ -1383,7 +1307,7 @@ Section Impl_erc721_Erc721_t. let* α1 : mut_ref erc721.Erc721.t := M.read self in let* α2 : u32.t := M.read id in let* α3 : core.result.Result.t unit erc721.Error.t := - M.call (erc721.Erc721.t::["approve_for"] α1 (borrow to) α2) in + M.call (impl erc721.Erc721.t "approve_for" α1 (borrow to) α2) in let* α4 : core.ops.control_flow.ControlFlow.t (core.result.Result.t core.convert.Infallible.t erc721.Error.t) @@ -1443,10 +1367,7 @@ Section Impl_erc721_Erc721_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_approve : - Notations.DoubleColon Self "approve" := { - Notations.double_colon := approve; - }. + Axiom approve_is_impl : impl Self "approve" = approve. (* fn remove_token_from(&mut self, from: &AccountId, id: TokenId) -> Result<(), Error> { @@ -1506,7 +1427,9 @@ Section Impl_erc721_Erc721_t. M.read token_owner in let* α1 : bool.t := M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["contains"] + (impl + (erc721.Mapping.t u32.t erc721.AccountId.t) + "contains" (borrow (deref α0)) (borrow id)) in let* α2 : M.Val bool.t := M.alloc (UnOp.not α1) in @@ -1532,12 +1455,12 @@ Section Impl_erc721_Erc721_t. let* α2 : ref erc721.AccountId.t := M.read from in let* α3 : core.option.Option.t u32.t := M.call - ((erc721.Mapping.t erc721.AccountId.t u32.t)::["get"] + (impl (erc721.Mapping.t erc721.AccountId.t u32.t) "get" (borrow (deref α1)) α2) in let* α4 : core.option.Option.t u32.t := M.call - ((core.option.Option.t u32.t)::["map"] + (impl (core.option.Option.t u32.t) "map" α3 (fun (α0 : u32.t) => (let* α0 := M.alloc α0 in @@ -1556,7 +1479,7 @@ Section Impl_erc721_Erc721_t. M u32.t)) in let* α5 : core.result.Result.t u32.t erc721.Error.t := M.call - ((core.option.Option.t u32.t)::["ok_or"] + (impl (core.option.Option.t u32.t) "ok_or" α4 erc721.Error.CannotFetchValue) in let* α6 : @@ -1633,7 +1556,7 @@ Section Impl_erc721_Erc721_t. let* α3 : u32.t := M.read count in let* α4 : core.option.Option.t u32.t := M.call - ((erc721.Mapping.t erc721.AccountId.t u32.t)::["insert"] + (impl (erc721.Mapping.t erc721.AccountId.t u32.t) "insert" α0 α2 α3) in @@ -1645,7 +1568,7 @@ Section Impl_erc721_Erc721_t. let* α1 : u32.t := M.read id in let* α2 : unit := M.call - ((erc721.Mapping.t u32.t erc721.AccountId.t)::["remove"] + (impl (erc721.Mapping.t u32.t erc721.AccountId.t) "remove" (borrow (deref α0)) α1) in M.alloc α2 in @@ -1655,10 +1578,8 @@ Section Impl_erc721_Erc721_t. ] in M.read α0). - Global Instance AssociatedFunction_remove_token_from : - Notations.DoubleColon Self "remove_token_from" := { - Notations.double_colon := remove_token_from; - }. + Axiom remove_token_from_is_impl : + impl Self "remove_token_from" = remove_token_from. (* fn add_token_to(&mut self, to: &AccountId, id: TokenId) -> Result<(), Error> { @@ -1693,10 +1614,7 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_add_token_to : - Notations.DoubleColon Self "add_token_to" := { - Notations.double_colon := add_token_to; - }. + Axiom add_token_to_is_impl : impl Self "add_token_to" = add_token_to. (* fn transfer_token_from( @@ -1730,10 +1648,8 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_transfer_token_from : - Notations.DoubleColon Self "transfer_token_from" := { - Notations.double_colon := transfer_token_from; - }. + Axiom transfer_token_from_is_impl : + impl Self "transfer_token_from" = transfer_token_from. (* pub fn transfer(&mut self, destination: AccountId, id: TokenId) -> Result<(), Error> { @@ -1755,10 +1671,10 @@ Section Impl_erc721_Erc721_t. (let* caller : M.Val erc721.AccountId.t := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : erc721.Env.t := - M.call (erc721.Erc721.t::["env"] (borrow (deref α0))) in + M.call (impl erc721.Erc721.t "env" (borrow (deref α0))) in let* α2 : M.Val erc721.Env.t := M.alloc α1 in let* α3 : erc721.AccountId.t := - M.call (erc721.Env.t::["caller"] (borrow α2)) in + M.call (impl erc721.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : _ := @@ -1770,7 +1686,7 @@ Section Impl_erc721_Erc721_t. let* α2 : u32.t := M.read id in let* α3 : core.result.Result.t unit erc721.Error.t := M.call - (erc721.Erc721.t::["transfer_token_from"] + (impl erc721.Erc721.t "transfer_token_from" α1 (borrow caller) (borrow destination) @@ -1834,10 +1750,7 @@ Section Impl_erc721_Erc721_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* pub fn transfer_from( @@ -1872,7 +1785,7 @@ Section Impl_erc721_Erc721_t. let* α2 : u32.t := M.read id in let* α3 : core.result.Result.t unit erc721.Error.t := M.call - (erc721.Erc721.t::["transfer_token_from"] + (impl erc721.Erc721.t "transfer_token_from" α1 (borrow from) (borrow to) @@ -1936,10 +1849,7 @@ Section Impl_erc721_Erc721_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_transfer_from : - Notations.DoubleColon Self "transfer_from" := { - Notations.double_colon := transfer_from; - }. + Axiom transfer_from_is_impl : impl Self "transfer_from" = transfer_from. (* pub fn mint(&mut self, id: TokenId) -> Result<(), Error> { @@ -1964,10 +1874,10 @@ Section Impl_erc721_Erc721_t. (let* caller : M.Val erc721.AccountId.t := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : erc721.Env.t := - M.call (erc721.Erc721.t::["env"] (borrow (deref α0))) in + M.call (impl erc721.Erc721.t "env" (borrow (deref α0))) in let* α2 : M.Val erc721.Env.t := M.alloc α1 in let* α3 : erc721.AccountId.t := - M.call (erc721.Env.t::["caller"] (borrow α2)) in + M.call (impl erc721.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : _ := @@ -1978,7 +1888,7 @@ Section Impl_erc721_Erc721_t. let* α1 : mut_ref erc721.Erc721.t := M.read self in let* α2 : u32.t := M.read id in let* α3 : core.result.Result.t unit erc721.Error.t := - M.call (erc721.Erc721.t::["add_token_to"] α1 (borrow caller) α2) in + M.call (impl erc721.Erc721.t "add_token_to" α1 (borrow caller) α2) in let* α4 : core.ops.control_flow.ControlFlow.t (core.result.Result.t core.convert.Infallible.t erc721.Error.t) @@ -2037,7 +1947,7 @@ Section Impl_erc721_Erc721_t. let* _ : M.Val unit := let* α0 : mut_ref erc721.Erc721.t := M.read self in let* α1 : erc721.Env.t := - M.call (erc721.Erc721.t::["env"] (borrow (deref α0))) in + M.call (impl erc721.Erc721.t "env" (borrow (deref α0))) in let* α2 : M.Val erc721.Env.t := M.alloc α1 in let* α3 : _ := ltac:(M.get_method (fun ℐ => @@ -2051,7 +1961,7 @@ Section Impl_erc721_Erc721_t. let* α6 : u32.t := M.read id in let* α7 : unit := M.call - (erc721.Env.t::["emit_event"] + (impl erc721.Env.t "emit_event" (borrow α2) (erc721.Event.Transfer {| @@ -2064,10 +1974,7 @@ Section Impl_erc721_Erc721_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_mint : - Notations.DoubleColon Self "mint" := { - Notations.double_colon := mint; - }. + Axiom mint_is_impl : impl Self "mint" = mint. (* pub fn burn(&mut self, id: TokenId) -> Result<(), Error> { @@ -2104,9 +2011,6 @@ Section Impl_erc721_Erc721_t. ltac:(erc721.TokenId) -> M (core.result.Result.t unit erc721.Error.t). - Global Instance AssociatedFunction_burn : - Notations.DoubleColon Self "burn" := { - Notations.double_colon := burn; - }. + Axiom burn_is_impl : impl Self "burn" = burn. End Impl_erc721_Erc721_t. End Impl_erc721_Erc721_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/flipper.v b/CoqOfRust/examples/default/examples/ink_contracts/flipper.v index 45b71a057..2d72ae58a 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/flipper.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/flipper.v @@ -26,9 +26,7 @@ Section Impl_flipper_Flipper_t. let* α0 : bool.t := M.read init_value in M.pure {| flipper.Flipper.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -40,12 +38,9 @@ Section Impl_flipper_Flipper_t. ltac:(M.get_method (fun ℐ => core.default.Default.default (Self := bool.t) (Trait := ℐ))) in let* α1 : bool.t := M.call α0 in - M.call (flipper.Flipper.t::["new"] α1). + M.call (impl flipper.Flipper.t "new" α1). - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn flip(&mut self) { @@ -62,10 +57,7 @@ Section Impl_flipper_Flipper_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -77,8 +69,6 @@ Section Impl_flipper_Flipper_t. let* α0 : ref flipper.Flipper.t := M.read self in M.read (flipper.Flipper.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_flipper_Flipper_t. End Impl_flipper_Flipper_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v b/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v index 19d7dde15..0dac08bce 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v @@ -26,9 +26,7 @@ Section Impl_incrementer_Incrementer_t. let* α0 : i32.t := M.read init_value in M.pure {| incrementer.Incrementer.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -40,12 +38,9 @@ Section Impl_incrementer_Incrementer_t. ltac:(M.get_method (fun ℐ => core.default.Default.default (Self := i32.t) (Trait := ℐ))) in let* α1 : i32.t := M.call α0 in - M.call (incrementer.Incrementer.t::["new"] α1). + M.call (impl incrementer.Incrementer.t "new" α1). - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn inc(&mut self, by: i32) { @@ -66,9 +61,7 @@ Section Impl_incrementer_Incrementer_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* pub fn get(&self) -> i32 { @@ -80,8 +73,6 @@ Section Impl_incrementer_Incrementer_t. let* α0 : ref incrementer.Incrementer.t := M.read self in M.read (incrementer.Incrementer.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_incrementer_Incrementer_t. End Impl_incrementer_Incrementer_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder.v b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder.v index 619553d7c..f6e2cbd6e 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_call_builder_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (call_builder.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_call_builder_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -110,9 +104,7 @@ Section Impl_call_builder_Selector_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_call_builder_Selector_t. End Impl_call_builder_Selector_t. @@ -132,10 +124,7 @@ Section Impl_core_default_Default_for_call_builder_CallBuilderTest_t. Definition default : M call_builder.CallBuilderTest.t := M.pure call_builder.CallBuilderTest.Build. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -160,9 +149,7 @@ Section Impl_call_builder_CallBuilderTest_t. (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn call(&mut self, address: AccountId, selector: [u8; 4]) -> Option { @@ -241,14 +228,14 @@ Section Impl_call_builder_CallBuilderTest_t. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in let* α10 : core.option.Option.t call_builder.LangError.t := never_to_any α9 in @@ -259,10 +246,7 @@ Section Impl_call_builder_CallBuilderTest_t. ] in M.read α0. - Global Instance AssociatedFunction_call : - Notations.DoubleColon Self "call" := { - Notations.double_colon := call; - }. + Axiom call_is_impl : impl Self "call" = call. (* pub fn invoke(&mut self, address: AccountId, selector: [u8; 4]) { @@ -285,10 +269,7 @@ Section Impl_call_builder_CallBuilderTest_t. let* selector := M.alloc selector in M.pure tt. - Global Instance AssociatedFunction_invoke : - Notations.DoubleColon Self "invoke" := { - Notations.double_colon := invoke; - }. + Axiom invoke_is_impl : impl Self "invoke" = invoke. (* pub fn call_instantiate( @@ -332,10 +313,8 @@ Section Impl_call_builder_CallBuilderTest_t. let* init_value := M.alloc init_value in M.pure core.option.Option.None. - Global Instance AssociatedFunction_call_instantiate : - Notations.DoubleColon Self "call_instantiate" := { - Notations.double_colon := call_instantiate; - }. + Axiom call_instantiate_is_impl : + impl Self "call_instantiate" = call_instantiate. (* pub fn call_instantiate_fallible( @@ -376,9 +355,7 @@ Section Impl_call_builder_CallBuilderTest_t. let* init_value := M.alloc init_value in M.pure core.option.Option.None. - Global Instance AssociatedFunction_call_instantiate_fallible : - Notations.DoubleColon Self "call_instantiate_fallible" := { - Notations.double_colon := call_instantiate_fallible; - }. + Axiom call_instantiate_fallible_is_impl : + impl Self "call_instantiate_fallible" = call_instantiate_fallible. End Impl_call_builder_CallBuilderTest_t. End Impl_call_builder_CallBuilderTest_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v index 63918a0c6..3bb7e39de 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/call_builder_delegate.v @@ -33,10 +33,7 @@ Section Impl_core_default_Default_for_call_builder_delegate_CallBuilderDelegateT let* α1 : i32.t := M.call α0 in M.pure {| call_builder_delegate.CallBuilderDelegateTest.value := α1; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,9 +55,7 @@ Section Impl_call_builder_delegate_CallBuilderDelegateTest_t. let* α0 : i32.t := M.read value in M.pure {| call_builder_delegate.CallBuilderDelegateTest.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn delegate(&mut self, code_hash: Hash, selector: [u8; 4]) -> Option { @@ -91,10 +86,7 @@ Section Impl_call_builder_delegate_CallBuilderDelegateTest_t. let* selector := M.alloc selector in M.pure core.option.Option.None. - Global Instance AssociatedFunction_delegate : - Notations.DoubleColon Self "delegate" := { - Notations.double_colon := delegate; - }. + Axiom delegate_is_impl : impl Self "delegate" = delegate. (* pub fn invoke(&mut self, code_hash: Hash, selector: [u8; 4]) -> i32 { @@ -118,9 +110,6 @@ Section Impl_call_builder_delegate_CallBuilderDelegateTest_t. let* selector := M.alloc selector in M.pure ((Integer.of_Z 0) : i32.t). - Global Instance AssociatedFunction_invoke : - Notations.DoubleColon Self "invoke" := { - Notations.double_colon := invoke; - }. + Axiom invoke_is_impl : impl Self "invoke" = invoke. End Impl_call_builder_delegate_CallBuilderDelegateTest_t. End Impl_call_builder_delegate_CallBuilderDelegateTest_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v index 19b424d09..bbdd600dd 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/constructors_return_value.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_constructors_return_value_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (constructors_return_value.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -61,10 +58,7 @@ Section Impl_core_clone_Clone_for_constructors_return_value_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -97,10 +91,7 @@ Section Impl_core_convert_From_array_u8_t_for_constructors_return_value_AccountI let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -150,11 +141,9 @@ Section Impl_core_fmt_Debug_for_constructors_return_value_ConstructorError_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "ConstructorError") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -183,10 +172,8 @@ Section Impl_constructors_return_value_ReturnFlags_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_new_with_reverted : - Notations.DoubleColon Self "new_with_reverted" := { - Notations.double_colon := new_with_reverted; - }. + Axiom new_with_reverted_is_impl : + impl Self "new_with_reverted" = new_with_reverted. End Impl_constructors_return_value_ReturnFlags_t. End Impl_constructors_return_value_ReturnFlags_t. @@ -219,9 +206,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. let* α0 : bool.t := M.read init_value in M.pure {| constructors_return_value.ConstructorsReturnValue.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn try_new(succeed: bool) -> Result { @@ -249,7 +234,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. if α0 then let* α0 : constructors_return_value.ConstructorsReturnValue.t := M.call - (constructors_return_value.ConstructorsReturnValue.t::["new"] + (impl constructors_return_value.ConstructorsReturnValue.t "new" true) in M.alloc (core.result.Result.Ok α0) else @@ -258,10 +243,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. constructors_return_value.ConstructorError.Build) in M.read α1. - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn revert_new(_init_value: bool) -> Self { @@ -275,7 +257,8 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. let* _init_value := M.alloc _init_value in let* α0 : constructors_return_value.ReturnFlags.t := M.call - (constructors_return_value.ReturnFlags.t::["new_with_reverted"] true) in + (impl constructors_return_value.ReturnFlags.t "new_with_reverted" + true) in let* α1 : _ := ltac:(M.get_method (fun ℐ => core.convert.From.from @@ -294,10 +277,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. M.call (constructors_return_value.return_value α0 (borrow α3)) in never_to_any α4. - Global Instance AssociatedFunction_revert_new : - Notations.DoubleColon Self "revert_new" := { - Notations.double_colon := revert_new; - }. + Axiom revert_new_is_impl : impl Self "revert_new" = revert_new. (* pub fn try_revert_new(init_value: bool) -> Result { @@ -353,7 +333,8 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. M.copy α1 in let* α0 : constructors_return_value.ReturnFlags.t := M.call - (constructors_return_value.ReturnFlags.t::["new_with_reverted"] true) in + (impl constructors_return_value.ReturnFlags.t "new_with_reverted" + true) in let* α1 : never.t := M.call (constructors_return_value.return_value α0 (borrow value)) in let* α2 : @@ -369,10 +350,7 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. M.alloc α2 in M.read α0. - Global Instance AssociatedFunction_try_revert_new : - Notations.DoubleColon Self "try_revert_new" := { - Notations.double_colon := try_revert_new; - }. + Axiom try_revert_new_is_impl : impl Self "try_revert_new" = try_revert_new. (* pub fn get_value(&self) -> bool { @@ -386,9 +364,6 @@ Section Impl_constructors_return_value_ConstructorsReturnValue_t. M.read (constructors_return_value.ConstructorsReturnValue.Get_value (deref α0)). - Global Instance AssociatedFunction_get_value : - Notations.DoubleColon Self "get_value" := { - Notations.double_colon := get_value; - }. + Axiom get_value_is_impl : impl Self "get_value" = get_value. End Impl_constructors_return_value_ConstructorsReturnValue_t. End Impl_constructors_return_value_ConstructorsReturnValue_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/contract_ref.v b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/contract_ref.v index 44ee79d4b..628934d19 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/contract_ref.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/contract_ref.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_contract_ref_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (contract_ref.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_contract_ref_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -126,11 +120,9 @@ Section Impl_core_fmt_Debug_for_contract_ref_FlipperError_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "FlipperError") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -152,10 +144,7 @@ Section Impl_contract_ref_FlipperRef_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -164,11 +153,9 @@ Section Impl_contract_ref_FlipperRef_t. *) Definition env (self : ref Self) : M contract_ref.Env.t := let* self := M.alloc self in - M.call contract_ref.FlipperRef.t::["init_env"]. + M.call (impl contract_ref.FlipperRef.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(init_value: bool) -> Self { @@ -180,9 +167,7 @@ Section Impl_contract_ref_FlipperRef_t. let* α0 : bool.t := M.read init_value in M.pure {| contract_ref.FlipperRef.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -194,12 +179,9 @@ Section Impl_contract_ref_FlipperRef_t. ltac:(M.get_method (fun ℐ => core.default.Default.default (Self := bool.t) (Trait := ℐ))) in let* α1 : bool.t := M.call α0 in - M.call (contract_ref.FlipperRef.t::["new"] α1). + M.call (impl contract_ref.FlipperRef.t "new" α1). - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn try_new(succeed: bool) -> Result { @@ -222,16 +204,13 @@ Section Impl_contract_ref_FlipperRef_t. contract_ref.FlipperError.t) := if α0 then let* α0 : contract_ref.FlipperRef.t := - M.call (contract_ref.FlipperRef.t::["new"] true) in + M.call (impl contract_ref.FlipperRef.t "new" true) in M.alloc (core.result.Result.Ok α0) else M.alloc (core.result.Result.Err contract_ref.FlipperError.Build) in M.read α1. - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn flip(&mut self) { @@ -249,10 +228,7 @@ Section Impl_contract_ref_FlipperRef_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -264,9 +240,7 @@ Section Impl_contract_ref_FlipperRef_t. let* α0 : ref contract_ref.FlipperRef.t := M.read self in M.read (contract_ref.FlipperRef.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_contract_ref_FlipperRef_t. End Impl_contract_ref_FlipperRef_t. @@ -307,20 +281,18 @@ Section Impl_contract_ref_ContractRef_t. let* flipper_code_hash := M.alloc flipper_code_hash in let* salt : M.Val (array u8.t) := let* α0 : u32.t := M.read version in - let* α1 : array u8.t := M.call (u32.t::["to_le_bytes"] α0) in + let* α1 : array u8.t := M.call (impl u32.t "to_le_bytes" α0) in M.alloc α1 in let* flipper : M.Val contract_ref.FlipperRef.t := let* α0 : contract_ref.FlipperRef.t := - M.call contract_ref.FlipperRef.t::["new_default"] in + M.call (impl contract_ref.FlipperRef.t "new_default") in M.alloc α0 in let* α0 : contract_ref.FlipperRef.t := M.read flipper in let* α0 : M.Val contract_ref.ContractRef.t := M.alloc {| contract_ref.ContractRef.flipper := α0; |} in M.read α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn try_new(version: u32, flipper_code_hash: Hash, succeed: bool) -> Self { @@ -350,7 +322,7 @@ Section Impl_contract_ref_ContractRef_t. let* succeed := M.alloc succeed in let* salt : M.Val (array u8.t) := let* α0 : u32.t := M.read version in - let* α1 : array u8.t := M.call (u32.t::["to_le_bytes"] α0) in + let* α1 : array u8.t := M.call (impl u32.t "to_le_bytes" α0) in M.alloc α1 in let* flipper : M.Val contract_ref.FlipperRef.t := let* α0 : bool.t := M.read succeed in @@ -358,12 +330,14 @@ Section Impl_contract_ref_ContractRef_t. core.result.Result.t contract_ref.FlipperRef.t contract_ref.FlipperError.t := - M.call (contract_ref.FlipperRef.t::["try_new"] α0) in + M.call (impl contract_ref.FlipperRef.t "try_new" α0) in let* α2 : contract_ref.FlipperRef.t := M.call - ((core.result.Result.t + (impl + (core.result.Result.t contract_ref.FlipperRef.t - contract_ref.FlipperError.t)::["unwrap"] + contract_ref.FlipperError.t) + "unwrap" α1) in M.alloc α2 in let* α0 : contract_ref.FlipperRef.t := M.read flipper in @@ -371,10 +345,7 @@ Section Impl_contract_ref_ContractRef_t. M.alloc {| contract_ref.ContractRef.flipper := α0; |} in M.read α0. - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn flip(&mut self) { @@ -387,16 +358,13 @@ Section Impl_contract_ref_ContractRef_t. let* α0 : mut_ref contract_ref.ContractRef.t := M.read self in let* α1 : unit := M.call - (contract_ref.FlipperRef.t::["flip"] + (impl contract_ref.FlipperRef.t "flip" (borrow_mut (contract_ref.ContractRef.Get_flipper (deref α0)))) in M.alloc α1 in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&mut self) -> bool { @@ -407,11 +375,9 @@ Section Impl_contract_ref_ContractRef_t. let* self := M.alloc self in let* α0 : mut_ref contract_ref.ContractRef.t := M.read self in M.call - (contract_ref.FlipperRef.t::["get"] + (impl contract_ref.FlipperRef.t "get" (borrow (contract_ref.ContractRef.Get_flipper (deref α0)))). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. End Impl_contract_ref_ContractRef_t. End Impl_contract_ref_ContractRef_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v index 3cc142fc8..0db549175 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/lang_err_integration_tests/integration_flipper.v @@ -33,11 +33,9 @@ Section Impl_core_fmt_Debug_for_integration_flipper_FlipperError_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "FlipperError") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -59,9 +57,7 @@ Section Impl_integration_flipper_Flipper_t. let* α0 : bool.t := M.read init_value in M.pure {| integration_flipper.Flipper.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -73,12 +69,9 @@ Section Impl_integration_flipper_Flipper_t. ltac:(M.get_method (fun ℐ => core.default.Default.default (Self := bool.t) (Trait := ℐ))) in let* α1 : bool.t := M.call α0 in - M.call (integration_flipper.Flipper.t::["new"] α1). + M.call (impl integration_flipper.Flipper.t "new" α1). - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn try_new(succeed: bool) -> Result { @@ -101,17 +94,14 @@ Section Impl_integration_flipper_Flipper_t. integration_flipper.FlipperError.t) := if α0 then let* α0 : integration_flipper.Flipper.t := - M.call (integration_flipper.Flipper.t::["new"] true) in + M.call (impl integration_flipper.Flipper.t "new" true) in M.alloc (core.result.Result.Ok α0) else M.alloc (core.result.Result.Err integration_flipper.FlipperError.Build) in M.read α1. - Global Instance AssociatedFunction_try_new : - Notations.DoubleColon Self "try_new" := { - Notations.double_colon := try_new; - }. + Axiom try_new_is_impl : impl Self "try_new" = try_new. (* pub fn flip(&mut self) { @@ -129,10 +119,7 @@ Section Impl_integration_flipper_Flipper_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* pub fn get(&self) -> bool { @@ -144,9 +131,7 @@ Section Impl_integration_flipper_Flipper_t. let* α0 : ref integration_flipper.Flipper.t := M.read self in M.read (integration_flipper.Flipper.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* pub fn err_flip(&mut self) -> Result<(), ()> { @@ -160,15 +145,12 @@ Section Impl_integration_flipper_Flipper_t. let* self := M.alloc self in let* _ : M.Val unit := let* α0 : mut_ref integration_flipper.Flipper.t := M.read self in - let* α1 : unit := M.call (integration_flipper.Flipper.t::["flip"] α0) in + let* α1 : unit := M.call (impl integration_flipper.Flipper.t "flip" α0) in M.alloc α1 in let* α0 : M.Val (core.result.Result.t unit unit) := M.alloc (core.result.Result.Err tt) in M.read α0. - Global Instance AssociatedFunction_err_flip : - Notations.DoubleColon Self "err_flip" := { - Notations.double_colon := err_flip; - }. + Axiom err_flip_is_impl : impl Self "err_flip" = err_flip. End Impl_integration_flipper_Flipper_t. End Impl_integration_flipper_Flipper_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/mapping_integration_tests.v b/CoqOfRust/examples/default/examples/ink_contracts/mapping_integration_tests.v index d5032c6a6..a8fc7ca7d 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/mapping_integration_tests.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/mapping_integration_tests.v @@ -49,10 +49,7 @@ Section Impl_core_default_Default_for_mapping_integration_tests_Mapping_t_K_V. mapping_integration_tests.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -78,10 +75,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -98,9 +92,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -119,10 +111,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn new() -> Mapping { @@ -134,9 +123,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn remove(&self, _key: K) { @@ -150,10 +137,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -170,10 +154,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -187,10 +168,7 @@ Section Impl_mapping_integration_tests_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_mapping_integration_tests_Mapping_t_K_V. End Impl_mapping_integration_tests_Mapping_t_K_V. @@ -219,10 +197,7 @@ Section Impl_core_default_Default_for_mapping_integration_tests_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (mapping_integration_tests.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -254,10 +229,7 @@ Section Impl_core_clone_Clone_for_mapping_integration_tests_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -304,10 +276,7 @@ Section Impl_mapping_integration_tests_Env_t. let* α0 : ref mapping_integration_tests.Env.t := M.read self in M.read (mapping_integration_tests.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. End Impl_mapping_integration_tests_Env_t. End Impl_mapping_integration_tests_Env_t. @@ -350,10 +319,7 @@ Section Impl_core_default_Default_for_mapping_integration_tests_Mappings_t. M.call α0 in M.pure {| mapping_integration_tests.Mappings.balances := α1; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -375,10 +341,7 @@ Section Impl_mapping_integration_tests_Mappings_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env() -> Env { @@ -390,9 +353,7 @@ Section Impl_mapping_integration_tests_Mappings_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -429,9 +390,7 @@ Section Impl_mapping_integration_tests_Mappings_t. M.alloc {| mapping_integration_tests.Mappings.balances := α0; |} in M.read α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn get_balance(&self) -> Option { @@ -445,26 +404,25 @@ Section Impl_mapping_integration_tests_Mappings_t. let* self := M.alloc self in let* caller : M.Val mapping_integration_tests.AccountId.t := let* α0 : mapping_integration_tests.Env.t := - M.call mapping_integration_tests.Mappings.t::["env"] in + M.call (impl mapping_integration_tests.Mappings.t "env") in let* α1 : M.Val mapping_integration_tests.Env.t := M.alloc α0 in let* α2 : mapping_integration_tests.AccountId.t := - M.call (mapping_integration_tests.Env.t::["caller"] (borrow α1)) in + M.call (impl mapping_integration_tests.Env.t "caller" (borrow α1)) in M.alloc α2 in let* α0 : ref mapping_integration_tests.Mappings.t := M.read self in let* α1 : core.option.Option.t u128.t := M.call - ((mapping_integration_tests.Mapping.t + (impl + (mapping_integration_tests.Mapping.t mapping_integration_tests.AccountId.t - u128.t)::["get"] + u128.t) + "get" (borrow (mapping_integration_tests.Mappings.Get_balances (deref α0))) (borrow caller)) in let* α0 : M.Val (core.option.Option.t u128.t) := M.alloc α1 in M.read α0. - Global Instance AssociatedFunction_get_balance : - Notations.DoubleColon Self "get_balance" := { - Notations.double_colon := get_balance; - }. + Axiom get_balance_is_impl : impl Self "get_balance" = get_balance. (* pub fn insert_balance(&mut self, value: Balance) -> Option { @@ -480,19 +438,21 @@ Section Impl_mapping_integration_tests_Mappings_t. let* value := M.alloc value in let* caller : M.Val mapping_integration_tests.AccountId.t := let* α0 : mapping_integration_tests.Env.t := - M.call mapping_integration_tests.Mappings.t::["env"] in + M.call (impl mapping_integration_tests.Mappings.t "env") in let* α1 : M.Val mapping_integration_tests.Env.t := M.alloc α0 in let* α2 : mapping_integration_tests.AccountId.t := - M.call (mapping_integration_tests.Env.t::["caller"] (borrow α1)) in + M.call (impl mapping_integration_tests.Env.t "caller" (borrow α1)) in M.alloc α2 in let* α0 : mut_ref mapping_integration_tests.Mappings.t := M.read self in let* α1 : mapping_integration_tests.AccountId.t := M.read caller in let* α2 : u128.t := M.read value in let* α3 : core.option.Option.t u32.t := M.call - ((mapping_integration_tests.Mapping.t + (impl + (mapping_integration_tests.Mapping.t mapping_integration_tests.AccountId.t - u128.t)::["insert"] + u128.t) + "insert" (borrow_mut (mapping_integration_tests.Mappings.Get_balances (deref α0))) α1 @@ -500,10 +460,7 @@ Section Impl_mapping_integration_tests_Mappings_t. let* α0 : M.Val (core.option.Option.t u32.t) := M.alloc α3 in M.read α0. - Global Instance AssociatedFunction_insert_balance : - Notations.DoubleColon Self "insert_balance" := { - Notations.double_colon := insert_balance; - }. + Axiom insert_balance_is_impl : impl Self "insert_balance" = insert_balance. (* pub fn size_balance(&mut self) -> Option { @@ -517,27 +474,26 @@ Section Impl_mapping_integration_tests_Mappings_t. let* self := M.alloc self in let* caller : M.Val mapping_integration_tests.AccountId.t := let* α0 : mapping_integration_tests.Env.t := - M.call mapping_integration_tests.Mappings.t::["env"] in + M.call (impl mapping_integration_tests.Mappings.t "env") in let* α1 : M.Val mapping_integration_tests.Env.t := M.alloc α0 in let* α2 : mapping_integration_tests.AccountId.t := - M.call (mapping_integration_tests.Env.t::["caller"] (borrow α1)) in + M.call (impl mapping_integration_tests.Env.t "caller" (borrow α1)) in M.alloc α2 in let* α0 : mut_ref mapping_integration_tests.Mappings.t := M.read self in let* α1 : mapping_integration_tests.AccountId.t := M.read caller in let* α2 : core.option.Option.t u32.t := M.call - ((mapping_integration_tests.Mapping.t + (impl + (mapping_integration_tests.Mapping.t mapping_integration_tests.AccountId.t - u128.t)::["size"] + u128.t) + "size" (borrow (mapping_integration_tests.Mappings.Get_balances (deref α0))) α1) in let* α0 : M.Val (core.option.Option.t u32.t) := M.alloc α2 in M.read α0. - Global Instance AssociatedFunction_size_balance : - Notations.DoubleColon Self "size_balance" := { - Notations.double_colon := size_balance; - }. + Axiom size_balance_is_impl : impl Self "size_balance" = size_balance. (* pub fn contains_balance(&self) -> bool { @@ -549,26 +505,26 @@ Section Impl_mapping_integration_tests_Mappings_t. let* self := M.alloc self in let* caller : M.Val mapping_integration_tests.AccountId.t := let* α0 : mapping_integration_tests.Env.t := - M.call mapping_integration_tests.Mappings.t::["env"] in + M.call (impl mapping_integration_tests.Mappings.t "env") in let* α1 : M.Val mapping_integration_tests.Env.t := M.alloc α0 in let* α2 : mapping_integration_tests.AccountId.t := - M.call (mapping_integration_tests.Env.t::["caller"] (borrow α1)) in + M.call (impl mapping_integration_tests.Env.t "caller" (borrow α1)) in M.alloc α2 in let* α0 : ref mapping_integration_tests.Mappings.t := M.read self in let* α1 : bool.t := M.call - ((mapping_integration_tests.Mapping.t + (impl + (mapping_integration_tests.Mapping.t mapping_integration_tests.AccountId.t - u128.t)::["contains"] + u128.t) + "contains" (borrow (mapping_integration_tests.Mappings.Get_balances (deref α0))) (borrow caller)) in let* α0 : M.Val bool.t := M.alloc α1 in M.read α0. - Global Instance AssociatedFunction_contains_balance : - Notations.DoubleColon Self "contains_balance" := { - Notations.double_colon := contains_balance; - }. + Axiom contains_balance_is_impl : + impl Self "contains_balance" = contains_balance. (* pub fn remove_balance(&mut self) { @@ -580,19 +536,21 @@ Section Impl_mapping_integration_tests_Mappings_t. let* self := M.alloc self in let* caller : M.Val mapping_integration_tests.AccountId.t := let* α0 : mapping_integration_tests.Env.t := - M.call mapping_integration_tests.Mappings.t::["env"] in + M.call (impl mapping_integration_tests.Mappings.t "env") in let* α1 : M.Val mapping_integration_tests.Env.t := M.alloc α0 in let* α2 : mapping_integration_tests.AccountId.t := - M.call (mapping_integration_tests.Env.t::["caller"] (borrow α1)) in + M.call (impl mapping_integration_tests.Env.t "caller" (borrow α1)) in M.alloc α2 in let* _ : M.Val unit := let* α0 : mut_ref mapping_integration_tests.Mappings.t := M.read self in let* α1 : mapping_integration_tests.AccountId.t := M.read caller in let* α2 : unit := M.call - ((mapping_integration_tests.Mapping.t + (impl + (mapping_integration_tests.Mapping.t mapping_integration_tests.AccountId.t - u128.t)::["remove"] + u128.t) + "remove" (borrow (mapping_integration_tests.Mappings.Get_balances (deref α0))) α1) in @@ -600,10 +558,7 @@ Section Impl_mapping_integration_tests_Mappings_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_remove_balance : - Notations.DoubleColon Self "remove_balance" := { - Notations.double_colon := remove_balance; - }. + Axiom remove_balance_is_impl : impl Self "remove_balance" = remove_balance. (* pub fn take_balance(&mut self) -> Option { @@ -617,26 +572,25 @@ Section Impl_mapping_integration_tests_Mappings_t. let* self := M.alloc self in let* caller : M.Val mapping_integration_tests.AccountId.t := let* α0 : mapping_integration_tests.Env.t := - M.call mapping_integration_tests.Mappings.t::["env"] in + M.call (impl mapping_integration_tests.Mappings.t "env") in let* α1 : M.Val mapping_integration_tests.Env.t := M.alloc α0 in let* α2 : mapping_integration_tests.AccountId.t := - M.call (mapping_integration_tests.Env.t::["caller"] (borrow α1)) in + M.call (impl mapping_integration_tests.Env.t "caller" (borrow α1)) in M.alloc α2 in let* α0 : mut_ref mapping_integration_tests.Mappings.t := M.read self in let* α1 : mapping_integration_tests.AccountId.t := M.read caller in let* α2 : core.option.Option.t u128.t := M.call - ((mapping_integration_tests.Mapping.t + (impl + (mapping_integration_tests.Mapping.t mapping_integration_tests.AccountId.t - u128.t)::["take"] + u128.t) + "take" (borrow (mapping_integration_tests.Mappings.Get_balances (deref α0))) α1) in let* α0 : M.Val (core.option.Option.t u128.t) := M.alloc α2 in M.read α0. - Global Instance AssociatedFunction_take_balance : - Notations.DoubleColon Self "take_balance" := { - Notations.double_colon := take_balance; - }. + Axiom take_balance_is_impl : impl Self "take_balance" = take_balance. End Impl_mapping_integration_tests_Mappings_t. End Impl_mapping_integration_tests_Mappings_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/mother.v b/CoqOfRust/examples/default/examples/ink_contracts/mother.v index 3366c2272..91ebd24e8 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/mother.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/mother.v @@ -45,10 +45,7 @@ Section Impl_core_default_Default_for_mother_Mapping_t_K_V. let* α3 : core.marker.PhantomData.t V := M.call α2 in M.pure {| mother.Mapping._key := α1; mother.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -77,9 +74,7 @@ Section Impl_mother_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) { @@ -94,10 +89,7 @@ Section Impl_mother_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. End Impl_mother_Mapping_t_K_V. End Impl_mother_Mapping_t_K_V. @@ -126,10 +118,7 @@ Section Impl_core_default_Default_for_mother_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (mother.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -158,10 +147,7 @@ Section Impl_core_clone_Clone_for_mother_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -204,9 +190,7 @@ Section Impl_core_cmp_PartialEq_for_mother_AccountId_t. let* α3 : u128.t := M.read (mother.AccountId.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -241,10 +225,8 @@ Section Impl_core_cmp_Eq_for_mother_AccountId_t. [ fun γ => (M.alloc tt) : M (M.Val unit) ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -313,10 +295,7 @@ Section Impl_core_default_Default_for_mother_Bids_t. M.call α0 in M.pure (mother.Bids.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -366,9 +345,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Bids_t. (borrow (mother.Bids.Get_0 (deref α1))) (borrow (mother.Bids.Get_0 (deref α2)))). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -410,10 +387,8 @@ Section Impl_core_cmp_Eq_for_mother_Bids_t. [ fun γ => (M.alloc tt) : M (M.Val unit) ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -451,10 +426,7 @@ Section Impl_core_clone_Clone_for_mother_Bids_t. M.call (α0 (borrow (mother.Bids.Get_0 (deref α1)))) in M.pure (mother.Bids.Build_t α2). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -502,9 +474,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Outline_t. let* α0 : M.Val bool.t := M.alloc (BinOp.Pure.eq α0 α1) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -535,10 +505,8 @@ Section Impl_core_cmp_Eq_for_mother_Outline_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -595,10 +563,7 @@ Section Impl_core_clone_Clone_for_mother_Outline_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -780,9 +745,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Status_t. M.alloc (BinOp.Pure.and (BinOp.Pure.eq α0 α1) α6) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -824,10 +787,8 @@ Section Impl_core_cmp_Eq_for_mother_Status_t. ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -928,10 +889,7 @@ Section Impl_core_clone_Clone_for_mother_Status_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -1083,9 +1041,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Auction_t. (Bool.eqb α21 α23)) α27). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -1172,10 +1128,8 @@ Section Impl_core_cmp_Eq_for_mother_Auction_t. ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -1248,10 +1202,7 @@ Section Impl_core_clone_Clone_for_mother_Auction_t. mother.Auction.vector := α20; |}. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -1313,10 +1264,7 @@ Section Impl_core_default_Default_for_mother_Auction_t. mother.Auction.vector := α9; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -1417,9 +1365,7 @@ Section Impl_core_cmp_PartialEq_for_mother_Failure_t. M.alloc (BinOp.Pure.and (BinOp.Pure.eq α0 α1) α6) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -1455,10 +1401,8 @@ Section Impl_core_cmp_Eq_for_mother_Failure_t. [ fun γ => (M.alloc tt) : M (M.Val unit) ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -1504,10 +1448,7 @@ Section Impl_mother_Env_t. let* α0 : ref mother.Env.t := M.read self in M.read (mother.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -1521,10 +1462,7 @@ Section Impl_mother_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_mother_Env_t. End Impl_mother_Env_t. @@ -1568,10 +1506,7 @@ Section Impl_core_default_Default_for_mother_Mother_t. let* α3 : mother.Mapping.t mother.AccountId.t u128.t := M.call α2 in M.pure {| mother.Mother.auction := α1; mother.Mother.balances := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -1593,10 +1528,7 @@ Section Impl_mother_Mother_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -1605,11 +1537,9 @@ Section Impl_mother_Mother_t. *) Definition env (self : ref Self) : M mother.Env.t := let* self := M.alloc self in - M.call mother.Mother.t::["init_env"]. + M.call (impl mother.Mother.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(auction: Auction) -> Self { @@ -1630,9 +1560,7 @@ Section Impl_mother_Mother_t. let* α2 : mother.Auction.t := M.read auction in M.pure {| mother.Mother.balances := α1; mother.Mother.auction := α2; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn new_default() -> Self { @@ -1645,10 +1573,7 @@ Section Impl_mother_Mother_t. core.default.Default.default (Self := mother.Mother.t) (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new_default : - Notations.DoubleColon Self "new_default" := { - Notations.double_colon := new_default; - }. + Axiom new_default_is_impl : impl Self "new_default" = new_default. (* pub fn failed_new(fail: bool) -> Result { @@ -1682,10 +1607,7 @@ Section Impl_mother_Mother_t. M.alloc (core.result.Result.Ok α1) in M.read α1. - Global Instance AssociatedFunction_failed_new : - Notations.DoubleColon Self "failed_new" := { - Notations.double_colon := failed_new; - }. + Axiom failed_new_is_impl : impl Self "failed_new" = failed_new. (* pub fn echo_auction(&mut self, auction: Auction) -> Auction { @@ -1704,7 +1626,7 @@ Section Impl_mother_Mother_t. let* _ : M.Val unit := let* α0 : mut_ref mother.Mother.t := M.read self in let* α1 : mother.Env.t := - M.call (mother.Mother.t::["env"] (borrow (deref α0))) in + M.call (impl mother.Mother.t "env" (borrow (deref α0))) in let* α2 : M.Val mother.Env.t := M.alloc α1 in let* α3 : _ := ltac:(M.get_method (fun ℐ => @@ -1712,17 +1634,14 @@ Section Impl_mother_Mother_t. let* α4 : mother.Auction.t := M.call (α3 (borrow auction)) in let* α5 : unit := M.call - (mother.Env.t::["emit_event"] + (impl mother.Env.t "emit_event" (borrow α2) (mother.Event.AuctionEchoed {| mother.AuctionEchoed.auction := α4; |})) in M.alloc α5 in M.read auction. - Global Instance AssociatedFunction_echo_auction : - Notations.DoubleColon Self "echo_auction" := { - Notations.double_colon := echo_auction; - }. + Axiom echo_auction_is_impl : impl Self "echo_auction" = echo_auction. (* pub fn revert_or_trap(&mut self, fail: Option) -> Result<(), Failure> { @@ -1799,10 +1718,7 @@ Section Impl_mother_Mother_t. ] in M.read α0. - Global Instance AssociatedFunction_revert_or_trap : - Notations.DoubleColon Self "revert_or_trap" := { - Notations.double_colon := revert_or_trap; - }. + Axiom revert_or_trap_is_impl : impl Self "revert_or_trap" = revert_or_trap. (* pub fn debug_log(&mut self, _message: String) { @@ -1825,23 +1741,21 @@ Section Impl_mother_Mother_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow _message)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow _message)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_debug_log : - Notations.DoubleColon Self "debug_log" := { - Notations.double_colon := debug_log; - }. + Axiom debug_log_is_impl : impl Self "debug_log" = debug_log. End Impl_mother_Mother_t. End Impl_mother_Mother_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/multisig.v b/CoqOfRust/examples/default/examples/ink_contracts/multisig.v index bf12c7132..ed9a5c8f8 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/multisig.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/multisig.v @@ -45,10 +45,7 @@ Section Impl_core_default_Default_for_multisig_Mapping_t_K_V. let* α3 : core.marker.PhantomData.t V := M.call α2 in M.pure {| multisig.Mapping._key := α1; multisig.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -74,10 +71,7 @@ Section Impl_multisig_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_contains : - Notations.DoubleColon Self "contains" := { - Notations.double_colon := contains; - }. + Axiom contains_is_impl : impl Self "contains" = contains. (* fn get(&self, _key: &K) -> Option { @@ -94,9 +88,7 @@ Section Impl_multisig_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) -> Option { @@ -115,10 +107,7 @@ Section Impl_multisig_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. (* fn remove(&self, _key: K) { @@ -132,10 +121,7 @@ Section Impl_multisig_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_remove : - Notations.DoubleColon Self "remove" := { - Notations.double_colon := remove; - }. + Axiom remove_is_impl : impl Self "remove" = remove. (* fn size(&self, _key: K) -> Option { @@ -152,10 +138,7 @@ Section Impl_multisig_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_size : - Notations.DoubleColon Self "size" := { - Notations.double_colon := size; - }. + Axiom size_is_impl : impl Self "size" = size. (* fn take(&self, _key: K) -> Option { @@ -169,10 +152,7 @@ Section Impl_multisig_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_take : - Notations.DoubleColon Self "take" := { - Notations.double_colon := take; - }. + Axiom take_is_impl : impl Self "take" = take. End Impl_multisig_Mapping_t_K_V. End Impl_multisig_Mapping_t_K_V. @@ -201,10 +181,7 @@ Section Impl_core_default_Default_for_multisig_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (multisig.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -232,11 +209,9 @@ Section Impl_core_fmt_Debug_for_multisig_AccountId_t. M.alloc (borrow (multisig.AccountId.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref u128.t)) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -265,10 +240,7 @@ Section Impl_core_clone_Clone_for_multisig_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -314,9 +286,7 @@ Section Impl_core_cmp_PartialEq_for_multisig_AccountId_t. let* α3 : u128.t := M.read (multisig.AccountId.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -351,10 +321,8 @@ Section Impl_core_cmp_Eq_for_multisig_AccountId_t. [ fun γ => (M.alloc tt) : M (M.Val unit) ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -389,10 +357,7 @@ Section Impl_core_cmp_PartialOrd_for_multisig_AccountId_t. (borrow (multisig.AccountId.Get_0 (deref α1))) (borrow (multisig.AccountId.Get_0 (deref α2)))). - Global Instance AssociatedFunction_partial_cmp : - Notations.DoubleColon Self "partial_cmp" := { - Notations.double_colon := partial_cmp; - }. + Axiom partial_cmp_is_impl : impl Self "partial_cmp" = partial_cmp. Global Instance ℐ : core.cmp.PartialOrd.Required.Trait Self @@ -429,9 +394,7 @@ Section Impl_core_cmp_Ord_for_multisig_AccountId_t. (borrow (multisig.AccountId.Get_0 (deref α1))) (borrow (multisig.AccountId.Get_0 (deref α2)))). - Global Instance AssociatedFunction_cmp : Notations.DoubleColon Self "cmp" := { - Notations.double_colon := cmp; - }. + Axiom cmp_is_impl : impl Self "cmp" = cmp. Global Instance ℐ : core.cmp.Ord.Required.Trait Self := { core.cmp.Ord.cmp := cmp; @@ -512,10 +475,7 @@ Section Impl_core_clone_Clone_for_multisig_ConfirmationStatus_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -613,10 +573,7 @@ Section Impl_core_default_Default_for_multisig_Transaction_t. multisig.Transaction.allow_reentry := α11; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -641,10 +598,7 @@ Section Impl_core_clone_Clone_for_multisig_Error_t. let* α0 : ref multisig.Error.t := M.read self in M.read (deref α0). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -683,9 +637,7 @@ Section Impl_core_cmp_PartialEq_for_multisig_Error_t. let* other := M.alloc other in M.pure true. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -716,10 +668,8 @@ Section Impl_core_cmp_Eq_for_multisig_Error_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -771,10 +721,7 @@ Section Impl_core_default_Default_for_multisig_Transactions_t. multisig.Transactions.next_id := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -977,10 +924,7 @@ Section Impl_multisig_Env_t. let* α0 : ref multisig.Env.t := M.read self in M.read (multisig.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -997,10 +941,7 @@ Section Impl_multisig_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. (* fn transferred_value(&self) -> Balance { @@ -1013,10 +954,8 @@ Section Impl_multisig_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_transferred_value : - Notations.DoubleColon Self "transferred_value" := { - Notations.double_colon := transferred_value; - }. + Axiom transferred_value_is_impl : + impl Self "transferred_value" = transferred_value. (* fn account_id(&self) -> AccountId { @@ -1029,10 +968,7 @@ Section Impl_multisig_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_account_id : - Notations.DoubleColon Self "account_id" := { - Notations.double_colon := account_id; - }. + Axiom account_id_is_impl : impl Self "account_id" = account_id. End Impl_multisig_Env_t. End Impl_multisig_Env_t. @@ -1142,10 +1078,7 @@ Section Impl_core_default_Default_for_multisig_Multisig_t. multisig.Multisig.requirement := α13; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -1206,10 +1139,7 @@ Section Impl_multisig_Multisig_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -1218,11 +1148,9 @@ Section Impl_multisig_Multisig_t. *) Definition env (self : ref Self) : M multisig.Env.t := let* self := M.alloc self in - M.call multisig.Multisig.t::["init_env"]. + M.call (impl multisig.Multisig.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(requirement: u32, mut owners: Vec) -> Self { @@ -1264,20 +1192,22 @@ Section Impl_multisig_Multisig_t. let* α1 : mut_ref (slice multisig.AccountId.t) := M.call (α0 (borrow_mut owners)) in let* α2 : unit := - M.call ((slice multisig.AccountId.t)::["sort_unstable"] α1) in + M.call (impl (slice multisig.AccountId.t) "sort_unstable" α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : unit := M.call - ((alloc.vec.Vec.t - multisig.AccountId.t - alloc.alloc.Global.t)::["dedup"] + (impl + (alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t) + "dedup" (borrow_mut owners)) in M.alloc α0 in let* _ : M.Val unit := let* α0 : usize.t := M.call - ((alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t)::["len"] + (impl + (alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t) + "len" (borrow owners)) in let* α1 : u32.t := M.cast α0 in let* α2 : u32.t := M.read requirement in @@ -1339,9 +1269,11 @@ Section Impl_multisig_Multisig_t. M.read (deref α0) in let* α2 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t + (impl + (multisig.Mapping.t multisig.AccountId.t - unit)::["insert"] + unit) + "insert" (borrow_mut (multisig.Multisig.Get_is_owner contract)) α1 @@ -1373,9 +1305,7 @@ Section Impl_multisig_Multisig_t. assign (multisig.Multisig.Get_requirement contract) α0 in M.read contract. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn ensure_confirmed(&self, trans_id: TransactionId) { @@ -1397,12 +1327,12 @@ Section Impl_multisig_Multisig_t. let* α0 : ref multisig.Multisig.t := M.read self in let* α1 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t u32.t)::["get"] + (impl (multisig.Mapping.t u32.t u32.t) "get" (borrow (multisig.Multisig.Get_confirmation_count (deref α0))) (borrow trans_id)) in let* α2 : ref str.t := M.read multisig.WRONG_TRANSACTION_ID in let* α3 : u32.t := - M.call ((core.option.Option.t u32.t)::["expect"] α1 α2) in + M.call (impl (core.option.Option.t u32.t) "expect" α1 α2) in let* α4 : ref multisig.Multisig.t := M.read self in let* α5 : u32.t := M.read (multisig.Multisig.Get_requirement (deref α4)) in @@ -1422,10 +1352,8 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_ensure_confirmed : - Notations.DoubleColon Self "ensure_confirmed" := { - Notations.double_colon := ensure_confirmed; - }. + Axiom ensure_confirmed_is_impl : + impl Self "ensure_confirmed" = ensure_confirmed. (* fn ensure_transaction_exists(&self, trans_id: TransactionId) { @@ -1444,21 +1372,19 @@ Section Impl_multisig_Multisig_t. let* α0 : ref multisig.Multisig.t := M.read self in let* α1 : core.option.Option.t multisig.Transaction.t := M.call - ((multisig.Mapping.t u32.t multisig.Transaction.t)::["get"] + (impl (multisig.Mapping.t u32.t multisig.Transaction.t) "get" (borrow (multisig.Multisig.Get_transactions (deref α0))) (borrow trans_id)) in let* α2 : ref str.t := M.read multisig.WRONG_TRANSACTION_ID in let* α3 : multisig.Transaction.t := M.call - ((core.option.Option.t multisig.Transaction.t)::["expect"] α1 α2) in + (impl (core.option.Option.t multisig.Transaction.t) "expect" α1 α2) in M.alloc α3 in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_ensure_transaction_exists : - Notations.DoubleColon Self "ensure_transaction_exists" := { - Notations.double_colon := ensure_transaction_exists; - }. + Axiom ensure_transaction_exists_is_impl : + impl Self "ensure_transaction_exists" = ensure_transaction_exists. (* fn ensure_owner(&self, owner: &AccountId) { @@ -1476,7 +1402,7 @@ Section Impl_multisig_Multisig_t. let* α1 : ref multisig.AccountId.t := M.read owner in let* α2 : bool.t := M.call - ((multisig.Mapping.t multisig.AccountId.t unit)::["contains"] + (impl (multisig.Mapping.t multisig.AccountId.t unit) "contains" (borrow (multisig.Multisig.Get_is_owner (deref α0))) α1) in let* α3 : M.Val bool.t := M.alloc (UnOp.not α2) in @@ -1492,10 +1418,7 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_ensure_owner : - Notations.DoubleColon Self "ensure_owner" := { - Notations.double_colon := ensure_owner; - }. + Axiom ensure_owner_is_impl : impl Self "ensure_owner" = ensure_owner. (* fn ensure_caller_is_owner(&self) { @@ -1507,21 +1430,19 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : ref multisig.Multisig.t := M.read self in let* α1 : ref multisig.Multisig.t := M.read self in - let* α2 : multisig.Env.t := M.call (multisig.Multisig.t::["env"] α1) in + let* α2 : multisig.Env.t := M.call (impl multisig.Multisig.t "env" α1) in let* α3 : M.Val multisig.Env.t := M.alloc α2 in let* α4 : multisig.AccountId.t := - M.call (multisig.Env.t::["caller"] (borrow α3)) in + M.call (impl multisig.Env.t "caller" (borrow α3)) in let* α5 : M.Val multisig.AccountId.t := M.alloc α4 in let* α6 : unit := - M.call (multisig.Multisig.t::["ensure_owner"] α0 (borrow α5)) in + M.call (impl multisig.Multisig.t "ensure_owner" α0 (borrow α5)) in M.alloc α6 in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_ensure_caller_is_owner : - Notations.DoubleColon Self "ensure_caller_is_owner" := { - Notations.double_colon := ensure_caller_is_owner; - }. + Axiom ensure_caller_is_owner_is_impl : + impl Self "ensure_caller_is_owner" = ensure_caller_is_owner. (* fn ensure_from_wallet(&self) { @@ -1532,16 +1453,16 @@ Section Impl_multisig_Multisig_t. let* self := M.alloc self in let* _ : M.Val unit := let* α0 : ref multisig.Multisig.t := M.read self in - let* α1 : multisig.Env.t := M.call (multisig.Multisig.t::["env"] α0) in + let* α1 : multisig.Env.t := M.call (impl multisig.Multisig.t "env" α0) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : multisig.AccountId.t := - M.call (multisig.Env.t::["caller"] (borrow α2)) in + M.call (impl multisig.Env.t "caller" (borrow α2)) in let* α4 : M.Val multisig.AccountId.t := M.alloc α3 in let* α5 : ref multisig.Multisig.t := M.read self in - let* α6 : multisig.Env.t := M.call (multisig.Multisig.t::["env"] α5) in + let* α6 : multisig.Env.t := M.call (impl multisig.Multisig.t "env" α5) in let* α7 : M.Val multisig.Env.t := M.alloc α6 in let* α8 : multisig.AccountId.t := - M.call (multisig.Env.t::["account_id"] (borrow α7)) in + M.call (impl multisig.Env.t "account_id" (borrow α7)) in let* α9 : M.Val multisig.AccountId.t := M.alloc α8 in let* α10 : M.Val ((ref multisig.AccountId.t) * (ref multisig.AccountId.t)) := @@ -1593,10 +1514,8 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_ensure_from_wallet : - Notations.DoubleColon Self "ensure_from_wallet" := { - Notations.double_colon := ensure_from_wallet; - }. + Axiom ensure_from_wallet_is_impl : + impl Self "ensure_from_wallet" = ensure_from_wallet. (* fn ensure_no_owner(&self, owner: &AccountId) { @@ -1614,7 +1533,7 @@ Section Impl_multisig_Multisig_t. let* α1 : ref multisig.AccountId.t := M.read owner in let* α2 : bool.t := M.call - ((multisig.Mapping.t multisig.AccountId.t unit)::["contains"] + (impl (multisig.Mapping.t multisig.AccountId.t unit) "contains" (borrow (multisig.Multisig.Get_is_owner (deref α0))) α1) in let* α3 : M.Val bool.t := M.alloc (UnOp.not (UnOp.not α2)) in @@ -1630,10 +1549,7 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_ensure_no_owner : - Notations.DoubleColon Self "ensure_no_owner" := { - Notations.double_colon := ensure_no_owner; - }. + Axiom ensure_no_owner_is_impl : impl Self "ensure_no_owner" = ensure_no_owner. (* pub fn add_owner(&mut self, new_owner: AccountId) { @@ -1656,13 +1572,13 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_from_wallet"] (borrow (deref α0))) in + (impl multisig.Multisig.t "ensure_from_wallet" (borrow (deref α0))) in M.alloc α1 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_no_owner"] + (impl multisig.Multisig.t "ensure_no_owner" (borrow (deref α0)) (borrow new_owner)) in M.alloc α1 in @@ -1670,7 +1586,9 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : usize.t := M.call - ((alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t)::["len"] + (impl + (alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t) + "len" (borrow (multisig.Multisig.Get_owners (deref α0)))) in let* α2 : u32.t := M.cast α1 in let* α3 : u32.t := BinOp.Panic.add α2 ((Integer.of_Z 1) : u32.t) in @@ -1684,7 +1602,7 @@ Section Impl_multisig_Multisig_t. let* α1 : multisig.AccountId.t := M.read new_owner in let* α2 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t multisig.AccountId.t unit)::["insert"] + (impl (multisig.Mapping.t multisig.AccountId.t unit) "insert" (borrow_mut (multisig.Multisig.Get_is_owner (deref α0))) α1 tt) in @@ -1694,19 +1612,21 @@ Section Impl_multisig_Multisig_t. let* α1 : multisig.AccountId.t := M.read new_owner in let* α2 : unit := M.call - ((alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t)::["push"] + (impl + (alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t) + "push" (borrow_mut (multisig.Multisig.Get_owners (deref α0))) α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : multisig.AccountId.t := M.read new_owner in let* α4 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.OwnerAddition {| multisig.OwnerAddition.owner := α3; |})) in @@ -1714,10 +1634,7 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_add_owner : - Notations.DoubleColon Self "add_owner" := { - Notations.double_colon := add_owner; - }. + Axiom add_owner_is_impl : impl Self "add_owner" = add_owner. (* fn owner_index(&self, owner: &AccountId) -> u32 { @@ -1748,7 +1665,7 @@ Section Impl_multisig_Multisig_t. let* α3 : ref (slice multisig.AccountId.t) := M.call (α1 (borrow (multisig.Multisig.Get_owners (deref α2)))) in let* α4 : core.slice.iter.Iter.t multisig.AccountId.t := - M.call ((slice multisig.AccountId.t)::["iter"] α3) in + M.call (impl (slice multisig.AccountId.t) "iter" α3) in let* α5 : M.Val (core.slice.iter.Iter.t multisig.AccountId.t) := M.alloc α4 in let* α6 : core.option.Option.t usize.t := @@ -1780,13 +1697,10 @@ Section Impl_multisig_Multisig_t. "This is only called after it was already verified that the id is actually an owner.") in let* α8 : usize.t := - M.call ((core.option.Option.t usize.t)::["expect"] α6 α7) in + M.call (impl (core.option.Option.t usize.t) "expect" α6 α7) in M.cast α8. - Global Instance AssociatedFunction_owner_index : - Notations.DoubleColon Self "owner_index" := { - Notations.double_colon := owner_index; - }. + Axiom owner_index_is_impl : impl Self "owner_index" = owner_index. (* fn clean_owner_confirmations(&mut self, owner: &AccountId) { @@ -1866,9 +1780,11 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : bool.t := M.call - ((multisig.Mapping.t + (impl + (multisig.Mapping.t (u32.t * multisig.AccountId.t) - unit)::["contains"] + unit) + "contains" (borrow (multisig.Multisig.Get_confirmations (deref α0))) @@ -1883,9 +1799,11 @@ Section Impl_multisig_Multisig_t. M.read key in let* α2 : unit := M.call - ((multisig.Mapping.t + (impl + (multisig.Mapping.t (u32.t * multisig.AccountId.t) - unit)::["remove"] + unit) + "remove" (borrow (multisig.Multisig.Get_confirmations (deref α0))) @@ -1897,7 +1815,7 @@ Section Impl_multisig_Multisig_t. let* α1 : ref u32.t := M.read trans_id in let* α2 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t u32.t)::["get"] + (impl (multisig.Mapping.t u32.t u32.t) "get" (borrow (multisig.Multisig.Get_confirmation_count (deref α0))) @@ -1907,7 +1825,7 @@ Section Impl_multisig_Multisig_t. let* α4 : u32.t := M.read (use α3) in let* α5 : u32.t := M.call - ((core.option.Option.t u32.t)::["unwrap_or"] + (impl (core.option.Option.t u32.t) "unwrap_or" α2 α4) in M.alloc α5 in @@ -1925,7 +1843,7 @@ Section Impl_multisig_Multisig_t. let* α3 : u32.t := M.read count in let* α4 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t u32.t)::["insert"] + (impl (multisig.Mapping.t u32.t u32.t) "insert" (borrow_mut (multisig.Multisig.Get_confirmation_count (deref α0))) @@ -1944,10 +1862,8 @@ Section Impl_multisig_Multisig_t. ] in M.read (use α4). - Global Instance AssociatedFunction_clean_owner_confirmations : - Notations.DoubleColon Self "clean_owner_confirmations" := { - Notations.double_colon := clean_owner_confirmations; - }. + Axiom clean_owner_confirmations_is_impl : + impl Self "clean_owner_confirmations" = clean_owner_confirmations. (* pub fn remove_owner(&mut self, owner: AccountId) { @@ -1975,13 +1891,13 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_from_wallet"] (borrow (deref α0))) in + (impl multisig.Multisig.t "ensure_from_wallet" (borrow (deref α0))) in M.alloc α1 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_owner"] + (impl multisig.Multisig.t "ensure_owner" (borrow (deref α0)) (borrow owner)) in M.alloc α1 in @@ -1989,7 +1905,9 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : usize.t := M.call - ((alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t)::["len"] + (impl + (alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t) + "len" (borrow (multisig.Multisig.Get_owners (deref α0)))) in let* α2 : u32.t := M.cast α1 in let* α3 : u32.t := BinOp.Panic.sub α2 ((Integer.of_Z 1) : u32.t) in @@ -2013,7 +1931,7 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : u32.t := M.call - (multisig.Multisig.t::["owner_index"] + (impl multisig.Multisig.t "owner_index" (borrow (deref α0)) (borrow owner)) in let* α2 : usize.t := M.cast α1 in @@ -2023,9 +1941,9 @@ Section Impl_multisig_Multisig_t. let* α1 : usize.t := M.read owner_index in let* α2 : multisig.AccountId.t := M.call - ((alloc.vec.Vec.t - multisig.AccountId.t - alloc.alloc.Global.t)::["swap_remove"] + (impl + (alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t) + "swap_remove" (borrow_mut (multisig.Multisig.Get_owners (deref α0))) α1) in M.alloc α2 in @@ -2034,7 +1952,7 @@ Section Impl_multisig_Multisig_t. let* α1 : multisig.AccountId.t := M.read owner in let* α2 : unit := M.call - ((multisig.Mapping.t multisig.AccountId.t unit)::["remove"] + (impl (multisig.Mapping.t multisig.AccountId.t unit) "remove" (borrow (multisig.Multisig.Get_is_owner (deref α0))) α1) in M.alloc α2 in @@ -2046,19 +1964,19 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["clean_owner_confirmations"] + (impl multisig.Multisig.t "clean_owner_confirmations" α0 (borrow owner)) in M.alloc α1 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : multisig.AccountId.t := M.read owner in let* α4 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.OwnerRemoval {| multisig.OwnerRemoval.owner := α3; |})) in @@ -2066,10 +1984,7 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_remove_owner : - Notations.DoubleColon Self "remove_owner" := { - Notations.double_colon := remove_owner; - }. + Axiom remove_owner_is_impl : impl Self "remove_owner" = remove_owner. (* pub fn replace_owner(&mut self, old_owner: AccountId, new_owner: AccountId) { @@ -2099,13 +2014,13 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_from_wallet"] (borrow (deref α0))) in + (impl multisig.Multisig.t "ensure_from_wallet" (borrow (deref α0))) in M.alloc α1 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_owner"] + (impl multisig.Multisig.t "ensure_owner" (borrow (deref α0)) (borrow old_owner)) in M.alloc α1 in @@ -2113,7 +2028,7 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_no_owner"] + (impl multisig.Multisig.t "ensure_no_owner" (borrow (deref α0)) (borrow new_owner)) in M.alloc α1 in @@ -2121,7 +2036,7 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : u32.t := M.call - (multisig.Multisig.t::["owner_index"] + (impl multisig.Multisig.t "owner_index" (borrow (deref α0)) (borrow old_owner)) in M.alloc α1 in @@ -2144,7 +2059,7 @@ Section Impl_multisig_Multisig_t. let* α1 : multisig.AccountId.t := M.read old_owner in let* α2 : unit := M.call - ((multisig.Mapping.t multisig.AccountId.t unit)::["remove"] + (impl (multisig.Mapping.t multisig.AccountId.t unit) "remove" (borrow (multisig.Multisig.Get_is_owner (deref α0))) α1) in M.alloc α2 in @@ -2153,7 +2068,7 @@ Section Impl_multisig_Multisig_t. let* α1 : multisig.AccountId.t := M.read new_owner in let* α2 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t multisig.AccountId.t unit)::["insert"] + (impl (multisig.Mapping.t multisig.AccountId.t unit) "insert" (borrow_mut (multisig.Multisig.Get_is_owner (deref α0))) α1 tt) in @@ -2162,19 +2077,19 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["clean_owner_confirmations"] + (impl multisig.Multisig.t "clean_owner_confirmations" α0 (borrow old_owner)) in M.alloc α1 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : multisig.AccountId.t := M.read old_owner in let* α4 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.OwnerRemoval {| multisig.OwnerRemoval.owner := α3; |})) in @@ -2182,12 +2097,12 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : multisig.AccountId.t := M.read new_owner in let* α4 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.OwnerAddition {| multisig.OwnerAddition.owner := α3; |})) in @@ -2195,10 +2110,7 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_replace_owner : - Notations.DoubleColon Self "replace_owner" := { - Notations.double_colon := replace_owner; - }. + Axiom replace_owner_is_impl : impl Self "replace_owner" = replace_owner. (* pub fn change_requirement(&mut self, new_requirement: u32) { @@ -2221,13 +2133,15 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_from_wallet"] (borrow (deref α0))) in + (impl multisig.Multisig.t "ensure_from_wallet" (borrow (deref α0))) in M.alloc α1 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : usize.t := M.call - ((alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t)::["len"] + (impl + (alloc.vec.Vec.t multisig.AccountId.t alloc.alloc.Global.t) + "len" (borrow (multisig.Multisig.Get_owners (deref α0)))) in let* α2 : u32.t := M.cast α1 in let* α3 : u32.t := M.read new_requirement in @@ -2240,12 +2154,12 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : u32.t := M.read new_requirement in let* α4 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.RequirementChange {| multisig.RequirementChange.new_requirement := α3; |})) in @@ -2253,10 +2167,8 @@ Section Impl_multisig_Multisig_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_change_requirement : - Notations.DoubleColon Self "change_requirement" := { - Notations.double_colon := change_requirement; - }. + Axiom change_requirement_is_impl : + impl Self "change_requirement" = change_requirement. (* fn confirm_by_caller( @@ -2304,13 +2216,13 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t u32.t)::["get"] + (impl (multisig.Mapping.t u32.t u32.t) "get" (borrow (multisig.Multisig.Get_confirmation_count (deref α0))) (borrow transaction)) in let* α2 : M.Val u32.t := M.alloc ((Integer.of_Z 0) : u32.t) in let* α3 : u32.t := M.read (use α2) in let* α4 : u32.t := - M.call ((core.option.Option.t u32.t)::["unwrap_or"] α1 α3) in + M.call (impl (core.option.Option.t u32.t) "unwrap_or" α1 α3) in M.alloc α4 in let* key : M.Val (u32.t * multisig.AccountId.t) := let* α0 : u32.t := M.read transaction in @@ -2320,9 +2232,9 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : bool.t := M.call - ((multisig.Mapping.t - (u32.t * multisig.AccountId.t) - unit)::["contains"] + (impl + (multisig.Mapping.t (u32.t * multisig.AccountId.t) unit) + "contains" (borrow (multisig.Multisig.Get_confirmations (deref α0))) (borrow key)) in M.alloc (UnOp.not α1) in @@ -2339,9 +2251,9 @@ Section Impl_multisig_Multisig_t. let* α1 : u32.t * multisig.AccountId.t := M.read key in let* α2 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t - (u32.t * multisig.AccountId.t) - unit)::["insert"] + (impl + (multisig.Mapping.t (u32.t * multisig.AccountId.t) unit) + "insert" (borrow_mut (multisig.Multisig.Get_confirmations (deref α0))) α1 tt) in @@ -2352,7 +2264,7 @@ Section Impl_multisig_Multisig_t. let* α2 : u32.t := M.read count in let* α3 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t u32.t)::["insert"] + (impl (multisig.Mapping.t u32.t u32.t) "insert" (borrow_mut (multisig.Multisig.Get_confirmation_count (deref α0))) α1 @@ -2385,14 +2297,14 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : u32.t := M.read transaction in let* α4 : multisig.AccountId.t := M.read confirmer in let* α5 : multisig.ConfirmationStatus.t := M.read status in let* α6 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.Confirmation {| @@ -2406,10 +2318,8 @@ Section Impl_multisig_Multisig_t. M.alloc tt in M.read status. - Global Instance AssociatedFunction_confirm_by_caller : - Notations.DoubleColon Self "confirm_by_caller" := { - Notations.double_colon := confirm_by_caller; - }. + Axiom confirm_by_caller_is_impl : + impl Self "confirm_by_caller" = confirm_by_caller. (* pub fn submit_transaction( @@ -2442,7 +2352,7 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_caller_is_owner"] + (impl multisig.Multisig.t "ensure_caller_is_owner" (borrow (deref α0))) in M.alloc α1 in let* trans_id : M.Val u32.t := @@ -2456,10 +2366,10 @@ Section Impl_multisig_Multisig_t. let* α2 : M.Val u32.t := M.alloc ((Integer.of_Z 1) : u32.t) in let* α3 : u32.t := M.read (use α2) in let* α4 : core.option.Option.t u32.t := - M.call (u32.t::["checked_add"] α1 α3) in + M.call (impl u32.t "checked_add" α1 α3) in let* α5 : ref str.t := M.read (mk_str "Transaction ids exhausted.") in let* α6 : u32.t := - M.call ((core.option.Option.t u32.t)::["expect"] α4 α5) in + M.call (impl (core.option.Option.t u32.t) "expect" α4 α5) in assign (multisig.Transactions.Get_next_id (multisig.Multisig.Get_transaction_list (deref α0))) @@ -2470,7 +2380,7 @@ Section Impl_multisig_Multisig_t. let* α2 : multisig.Transaction.t := M.read transaction in let* α3 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t multisig.Transaction.t)::["insert"] + (impl (multisig.Mapping.t u32.t multisig.Transaction.t) "insert" (borrow_mut (multisig.Multisig.Get_transactions (deref α0))) α1 α2) in @@ -2480,7 +2390,7 @@ Section Impl_multisig_Multisig_t. let* α1 : u32.t := M.read trans_id in let* α2 : unit := M.call - ((alloc.vec.Vec.t u32.t alloc.alloc.Global.t)::["push"] + (impl (alloc.vec.Vec.t u32.t alloc.alloc.Global.t) "push" (borrow_mut (multisig.Transactions.Get_transactions (multisig.Multisig.Get_transaction_list (deref α0)))) @@ -2489,12 +2399,12 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : u32.t := M.read trans_id in let* α4 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.Submission {| multisig.Submission.transaction := α3; |})) in @@ -2503,21 +2413,19 @@ Section Impl_multisig_Multisig_t. let* α1 : mut_ref multisig.Multisig.t := M.read self in let* α2 : mut_ref multisig.Multisig.t := M.read self in let* α3 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α2))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α2))) in let* α4 : M.Val multisig.Env.t := M.alloc α3 in let* α5 : multisig.AccountId.t := - M.call (multisig.Env.t::["caller"] (borrow α4)) in + M.call (impl multisig.Env.t "caller" (borrow α4)) in let* α6 : u32.t := M.read trans_id in let* α7 : multisig.ConfirmationStatus.t := - M.call (multisig.Multisig.t::["confirm_by_caller"] α1 α5 α6) in + M.call (impl multisig.Multisig.t "confirm_by_caller" α1 α5 α6) in let* α0 : M.Val (u32.t * multisig.ConfirmationStatus.t) := M.alloc (α0, α7) in M.read α0. - Global Instance AssociatedFunction_submit_transaction : - Notations.DoubleColon Self "submit_transaction" := { - Notations.double_colon := submit_transaction; - }. + Axiom submit_transaction_is_impl : + impl Self "submit_transaction" = submit_transaction. (* fn take_transaction(&mut self, trans_id: TransactionId) -> Option { @@ -2549,14 +2457,14 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : core.option.Option.t multisig.Transaction.t := M.call - ((multisig.Mapping.t u32.t multisig.Transaction.t)::["get"] + (impl (multisig.Mapping.t u32.t multisig.Transaction.t) "get" (borrow (multisig.Multisig.Get_transactions (deref α0))) (borrow trans_id)) in M.alloc α1 in let* _ : M.Val unit := let* α0 : bool.t := M.call - ((core.option.Option.t multisig.Transaction.t)::["is_some"] + (impl (core.option.Option.t multisig.Transaction.t) "is_some" (borrow transaction)) in let* α1 : M.Val bool.t := M.alloc α0 in let* α2 : bool.t := M.read (use α1) in @@ -2566,7 +2474,7 @@ Section Impl_multisig_Multisig_t. let* α1 : u32.t := M.read trans_id in let* α2 : unit := M.call - ((multisig.Mapping.t u32.t multisig.Transaction.t)::["remove"] + (impl (multisig.Mapping.t u32.t multisig.Transaction.t) "remove" (borrow (multisig.Multisig.Get_transactions (deref α0))) α1) in M.alloc α2 in @@ -2590,7 +2498,7 @@ Section Impl_multisig_Multisig_t. (multisig.Transactions.Get_transactions (multisig.Multisig.Get_transaction_list (deref α2))))) in let* α4 : core.slice.iter.Iter.t u32.t := - M.call ((slice u32.t)::["iter"] α3) in + M.call (impl (slice u32.t) "iter" α3) in let* α5 : M.Val (core.slice.iter.Iter.t u32.t) := M.alloc α4 in let* α6 : core.option.Option.t usize.t := M.call @@ -2620,14 +2528,14 @@ Section Impl_multisig_Multisig_t. (mk_str "The transaction exists hence it must also be in the list.") in let* α8 : usize.t := - M.call ((core.option.Option.t usize.t)::["expect"] α6 α7) in + M.call (impl (core.option.Option.t usize.t) "expect" α6 α7) in M.alloc α8 in let* _ : M.Val u32.t := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : usize.t := M.read pos in let* α2 : u32.t := M.call - ((alloc.vec.Vec.t u32.t alloc.alloc.Global.t)::["swap_remove"] + (impl (alloc.vec.Vec.t u32.t alloc.alloc.Global.t) "swap_remove" (borrow_mut (multisig.Transactions.Get_transactions (multisig.Multisig.Get_transaction_list (deref α0)))) @@ -2649,7 +2557,7 @@ Section Impl_multisig_Multisig_t. let* α3 : ref (slice multisig.AccountId.t) := M.call (α1 (borrow (multisig.Multisig.Get_owners (deref α2)))) in let* α4 : core.slice.iter.Iter.t multisig.AccountId.t := - M.call ((slice multisig.AccountId.t)::["iter"] α3) in + M.call (impl (slice multisig.AccountId.t) "iter" α3) in let* α5 : core.slice.iter.Iter.t multisig.AccountId.t := M.call (α0 α4) in let* α6 : M.Val (core.slice.iter.Iter.t multisig.AccountId.t) := @@ -2705,9 +2613,11 @@ Section Impl_multisig_Multisig_t. M.read (deref α2) in let* α4 : unit := M.call - ((multisig.Mapping.t + (impl + (multisig.Mapping.t (u32.t * multisig.AccountId.t) - unit)::["remove"] + unit) + "remove" (borrow (multisig.Multisig.Get_confirmations (deref α0))) @@ -2727,7 +2637,7 @@ Section Impl_multisig_Multisig_t. let* α1 : u32.t := M.read trans_id in let* α2 : unit := M.call - ((multisig.Mapping.t u32.t u32.t)::["remove"] + (impl (multisig.Mapping.t u32.t u32.t) "remove" (borrow (multisig.Multisig.Get_confirmation_count (deref α0))) α1) in M.alloc α2 in @@ -2736,10 +2646,8 @@ Section Impl_multisig_Multisig_t. M.alloc tt in M.read transaction. - Global Instance AssociatedFunction_take_transaction : - Notations.DoubleColon Self "take_transaction" := { - Notations.double_colon := take_transaction; - }. + Axiom take_transaction_is_impl : + impl Self "take_transaction" = take_transaction. (* pub fn cancel_transaction(&mut self, trans_id: TransactionId) { @@ -2761,17 +2669,17 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_from_wallet"] (borrow (deref α0))) in + (impl multisig.Multisig.t "ensure_from_wallet" (borrow (deref α0))) in M.alloc α1 in let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : u32.t := M.read trans_id in let* α2 : core.option.Option.t multisig.Transaction.t := - M.call (multisig.Multisig.t::["take_transaction"] α0 α1) in + M.call (impl multisig.Multisig.t "take_transaction" α0 α1) in let* α3 : M.Val (core.option.Option.t multisig.Transaction.t) := M.alloc α2 in let* α4 : bool.t := M.call - ((core.option.Option.t multisig.Transaction.t)::["is_some"] + (impl (core.option.Option.t multisig.Transaction.t) "is_some" (borrow α3)) in let* α5 : M.Val bool.t := M.alloc α4 in let* α6 : bool.t := M.read (use α5) in @@ -2780,12 +2688,12 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : u32.t := M.read trans_id in let* α4 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.Cancellation {| multisig.Cancellation.transaction := α3; |})) in @@ -2795,10 +2703,8 @@ Section Impl_multisig_Multisig_t. M.alloc tt in M.read α0. - Global Instance AssociatedFunction_cancel_transaction : - Notations.DoubleColon Self "cancel_transaction" := { - Notations.double_colon := cancel_transaction; - }. + Axiom cancel_transaction_is_impl : + impl Self "cancel_transaction" = cancel_transaction. (* pub fn confirm_transaction(&mut self, trans_id: TransactionId) -> ConfirmationStatus { @@ -2817,7 +2723,7 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_caller_is_owner"] + (impl multisig.Multisig.t "ensure_caller_is_owner" (borrow (deref α0))) in M.alloc α1 in let* _ : M.Val unit := @@ -2825,27 +2731,25 @@ Section Impl_multisig_Multisig_t. let* α1 : u32.t := M.read trans_id in let* α2 : unit := M.call - (multisig.Multisig.t::["ensure_transaction_exists"] + (impl multisig.Multisig.t "ensure_transaction_exists" (borrow (deref α0)) α1) in M.alloc α2 in let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : mut_ref multisig.Multisig.t := M.read self in let* α2 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α1))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α1))) in let* α3 : M.Val multisig.Env.t := M.alloc α2 in let* α4 : multisig.AccountId.t := - M.call (multisig.Env.t::["caller"] (borrow α3)) in + M.call (impl multisig.Env.t "caller" (borrow α3)) in let* α5 : u32.t := M.read trans_id in let* α6 : multisig.ConfirmationStatus.t := - M.call (multisig.Multisig.t::["confirm_by_caller"] α0 α4 α5) in + M.call (impl multisig.Multisig.t "confirm_by_caller" α0 α4 α5) in let* α0 : M.Val multisig.ConfirmationStatus.t := M.alloc α6 in M.read α0. - Global Instance AssociatedFunction_confirm_transaction : - Notations.DoubleColon Self "confirm_transaction" := { - Notations.double_colon := confirm_transaction; - }. + Axiom confirm_transaction_is_impl : + impl Self "confirm_transaction" = confirm_transaction. (* pub fn revoke_confirmation(&mut self, trans_id: TransactionId) { @@ -2877,16 +2781,16 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : unit := M.call - (multisig.Multisig.t::["ensure_caller_is_owner"] + (impl multisig.Multisig.t "ensure_caller_is_owner" (borrow (deref α0))) in M.alloc α1 in let* caller : M.Val multisig.AccountId.t := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : multisig.AccountId.t := - M.call (multisig.Env.t::["caller"] (borrow α2)) in + M.call (impl multisig.Env.t "caller" (borrow α2)) in M.alloc α3 in let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : u32.t := M.read trans_id in @@ -2894,7 +2798,9 @@ Section Impl_multisig_Multisig_t. let* α3 : M.Val (u32.t * multisig.AccountId.t) := M.alloc (α1, α2) in let* α4 : bool.t := M.call - ((multisig.Mapping.t (u32.t * multisig.AccountId.t) unit)::["contains"] + (impl + (multisig.Mapping.t (u32.t * multisig.AccountId.t) unit) + "contains" (borrow (multisig.Multisig.Get_confirmations (deref α0))) (borrow α3)) in let* α5 : M.Val bool.t := M.alloc α4 in @@ -2907,9 +2813,9 @@ Section Impl_multisig_Multisig_t. let* α2 : multisig.AccountId.t := M.read caller in let* α3 : unit := M.call - ((multisig.Mapping.t - (u32.t * multisig.AccountId.t) - unit)::["remove"] + (impl + (multisig.Mapping.t (u32.t * multisig.AccountId.t) unit) + "remove" (borrow (multisig.Multisig.Get_confirmations (deref α0))) (α1, α2)) in M.alloc α3 in @@ -2917,7 +2823,7 @@ Section Impl_multisig_Multisig_t. let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t u32.t)::["get"] + (impl (multisig.Mapping.t u32.t u32.t) "get" (borrow (multisig.Multisig.Get_confirmation_count (deref α0))) (borrow trans_id)) in let* α2 : ref str.t := @@ -2925,7 +2831,7 @@ Section Impl_multisig_Multisig_t. (mk_str "There is a entry in `self.confirmations`. Hence a count must exit.") in let* α3 : u32.t := - M.call ((core.option.Option.t u32.t)::["expect"] α1 α2) in + M.call (impl (core.option.Option.t u32.t) "expect" α1 α2) in M.alloc α3 in let* _ : M.Val unit := let β : M.Val u32.t := confirmation_count in @@ -2938,7 +2844,7 @@ Section Impl_multisig_Multisig_t. let* α2 : u32.t := M.read confirmation_count in let* α3 : core.option.Option.t u32.t := M.call - ((multisig.Mapping.t u32.t u32.t)::["insert"] + (impl (multisig.Mapping.t u32.t u32.t) "insert" (borrow_mut (multisig.Multisig.Get_confirmation_count (deref α0))) α1 @@ -2947,13 +2853,13 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : u32.t := M.read trans_id in let* α4 : multisig.AccountId.t := M.read caller in let* α5 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.Revocation {| @@ -2966,10 +2872,8 @@ Section Impl_multisig_Multisig_t. M.alloc tt in M.read α0. - Global Instance AssociatedFunction_revoke_confirmation : - Notations.DoubleColon Self "revoke_confirmation" := { - Notations.double_colon := revoke_confirmation; - }. + Axiom revoke_confirmation_is_impl : + impl Self "revoke_confirmation" = revoke_confirmation. (* pub fn invoke_transaction(&mut self, trans_id: TransactionId) -> Result<(), Error> { @@ -3009,25 +2913,27 @@ Section Impl_multisig_Multisig_t. let* α1 : u32.t := M.read trans_id in let* α2 : unit := M.call - (multisig.Multisig.t::["ensure_confirmed"] (borrow (deref α0)) α1) in + (impl multisig.Multisig.t "ensure_confirmed" + (borrow (deref α0)) + α1) in M.alloc α2 in let* t : M.Val multisig.Transaction.t := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : u32.t := M.read trans_id in let* α2 : core.option.Option.t multisig.Transaction.t := - M.call (multisig.Multisig.t::["take_transaction"] α0 α1) in + M.call (impl multisig.Multisig.t "take_transaction" α0 α1) in let* α3 : ref str.t := M.read multisig.WRONG_TRANSACTION_ID in let* α4 : multisig.Transaction.t := M.call - ((core.option.Option.t multisig.Transaction.t)::["expect"] α2 α3) in + (impl (core.option.Option.t multisig.Transaction.t) "expect" α2 α3) in M.alloc α4 in let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : u128.t := - M.call (multisig.Env.t::["transferred_value"] (borrow α2)) in + M.call (impl multisig.Env.t "transferred_value" (borrow α2)) in let* α4 : u128.t := M.read (multisig.Transaction.Get_transferred_value t) in let* α5 : M.Val bool.t := M.alloc (UnOp.not (BinOp.Pure.eq α3 α4)) in @@ -3088,7 +2994,7 @@ Section Impl_multisig_Multisig_t. let* _ : M.Val unit := let* α0 : mut_ref multisig.Multisig.t := M.read self in let* α1 : multisig.Env.t := - M.call (multisig.Multisig.t::["env"] (borrow (deref α0))) in + M.call (impl multisig.Multisig.t "env" (borrow (deref α0))) in let* α2 : M.Val multisig.Env.t := M.alloc α1 in let* α3 : u32.t := M.read trans_id in let* α4 : core.result.Result.t unit multisig.Error.t := M.read result in @@ -3097,7 +3003,7 @@ Section Impl_multisig_Multisig_t. (core.option.Option.t (alloc.vec.Vec.t u8.t alloc.alloc.Global.t)) multisig.Error.t := M.call - ((core.result.Result.t unit multisig.Error.t)::["map"] + (impl (core.result.Result.t unit multisig.Error.t) "map" α4 (fun (α0 : unit) => (let* α0 := M.alloc α0 in @@ -3115,7 +3021,7 @@ Section Impl_multisig_Multisig_t. (alloc.vec.Vec.t u8.t alloc.alloc.Global.t)))) in let* α6 : unit := M.call - (multisig.Env.t::["emit_event"] + (impl multisig.Env.t "emit_event" (borrow α2) (multisig.Event.Execution {| @@ -3125,10 +3031,8 @@ Section Impl_multisig_Multisig_t. M.alloc α6 in M.read result. - Global Instance AssociatedFunction_invoke_transaction : - Notations.DoubleColon Self "invoke_transaction" := { - Notations.double_colon := invoke_transaction; - }. + Axiom invoke_transaction_is_impl : + impl Self "invoke_transaction" = invoke_transaction. (* pub fn eval_transaction(&mut self, trans_id: TransactionId) -> Result, Error> { @@ -3164,9 +3068,7 @@ Section Impl_multisig_Multisig_t. (alloc.vec.Vec.t u8.t alloc.vec.Vec.Default.A) multisig.Error.t). - Global Instance AssociatedFunction_eval_transaction : - Notations.DoubleColon Self "eval_transaction" := { - Notations.double_colon := eval_transaction; - }. + Axiom eval_transaction_is_impl : + impl Self "eval_transaction" = eval_transaction. End Impl_multisig_Multisig_t. End Impl_multisig_Multisig_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v b/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v index 8e803d897..c4d562a42 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_payment_channel_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (payment_channel.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_payment_channel_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -107,9 +101,7 @@ Section Impl_core_cmp_PartialEq_for_payment_channel_AccountId_t. let* α3 : u128.t := M.read (payment_channel.AccountId.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -144,10 +136,8 @@ Section Impl_core_cmp_Eq_for_payment_channel_AccountId_t. [ fun γ => (M.alloc tt) : M (M.Val unit) ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -171,10 +161,7 @@ Section Impl_core_convert_From_array_u8_t_for_payment_channel_AccountId_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := array u8.t) := { core.convert.From.from := from; @@ -273,9 +260,7 @@ Section Impl_core_cmp_PartialEq_for_payment_channel_Error_t. let* α0 : M.Val bool.t := M.alloc (BinOp.Pure.eq α0 α1) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -306,10 +291,8 @@ Section Impl_core_cmp_Eq_for_payment_channel_Error_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -363,10 +346,7 @@ Section Impl_payment_channel_Env_t. let* α0 : ref payment_channel.Env.t := M.read self in M.read (payment_channel.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -383,10 +363,7 @@ Section Impl_payment_channel_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. (* fn terminate_contract(&self, sender: AccountId) { @@ -403,10 +380,8 @@ Section Impl_payment_channel_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_terminate_contract : - Notations.DoubleColon Self "terminate_contract" := { - Notations.double_colon := terminate_contract; - }. + Axiom terminate_contract_is_impl : + impl Self "terminate_contract" = terminate_contract. (* fn transfer(&self, recipient: AccountId, amount: Balance) -> Result<()> { @@ -425,10 +400,7 @@ Section Impl_payment_channel_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn block_timestamp(&self) -> Timestamp { @@ -443,10 +415,7 @@ Section Impl_payment_channel_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_block_timestamp : - Notations.DoubleColon Self "block_timestamp" := { - Notations.double_colon := block_timestamp; - }. + Axiom block_timestamp_is_impl : impl Self "block_timestamp" = block_timestamp. (* fn balance(&self) -> Balance { @@ -459,10 +428,7 @@ Section Impl_payment_channel_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_balance : - Notations.DoubleColon Self "balance" := { - Notations.double_colon := balance; - }. + Axiom balance_is_impl : impl Self "balance" = balance. (* fn account_id(&self) -> AccountId { @@ -475,10 +441,7 @@ Section Impl_payment_channel_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_account_id : - Notations.DoubleColon Self "account_id" := { - Notations.double_colon := account_id; - }. + Axiom account_id_is_impl : impl Self "account_id" = account_id. End Impl_payment_channel_Env_t. End Impl_payment_channel_Env_t. @@ -663,10 +626,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Sha2x256_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -698,10 +658,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Keccak256_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -733,10 +690,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Blake2x256_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -768,10 +722,7 @@ Section Impl_payment_channel_CryptoHash_for_payment_channel_Blake2x128_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_hash : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash; - }. + Axiom hash_is_impl : impl Self "hash" = hash. Global Instance ℐ : payment_channel.CryptoHash.Trait Self := { payment_channel.CryptoHash.hash := hash; @@ -793,10 +744,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -805,11 +753,9 @@ Section Impl_payment_channel_PaymentChannel_t. *) Definition env (self : ref Self) : M payment_channel.Env.t := let* self := M.alloc self in - M.call payment_channel.PaymentChannel.t::["init_env"]. + M.call (impl payment_channel.PaymentChannel.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* fn is_signature_valid(&self, amount: Balance, signature: [u8; 65]) -> bool { @@ -837,10 +783,10 @@ Section Impl_payment_channel_PaymentChannel_t. let* encodable : M.Val (payment_channel.AccountId.t * u128.t) := let* α0 : ref payment_channel.PaymentChannel.t := M.read self in let* α1 : payment_channel.Env.t := - M.call (payment_channel.PaymentChannel.t::["env"] α0) in + M.call (impl payment_channel.PaymentChannel.t "env" α0) in let* α2 : M.Val payment_channel.Env.t := M.alloc α1 in let* α3 : payment_channel.AccountId.t := - M.call (payment_channel.Env.t::["account_id"] (borrow α2)) in + M.call (impl payment_channel.Env.t "account_id" (borrow α2)) in let* α4 : u128.t := M.read amount in M.alloc (α3, α4) in let* message : M.Val (array u8.t) := @@ -867,9 +813,9 @@ Section Impl_payment_channel_PaymentChannel_t. (borrow_mut pub_key)) in let* α1 : unit := M.call - ((core.result.Result.t - unit - payment_channel.Error.t)::["unwrap_or_else"] + (impl + (core.result.Result.t unit payment_channel.Error.t) + "unwrap_or_else" α0 (fun (α0 : payment_channel.Error.t) => (let* α0 := M.alloc α0 in @@ -923,10 +869,8 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : M.Val bool.t := M.alloc α6 in M.read α0. - Global Instance AssociatedFunction_is_signature_valid : - Notations.DoubleColon Self "is_signature_valid" := { - Notations.double_colon := is_signature_valid; - }. + Axiom is_signature_valid_is_impl : + impl Self "is_signature_valid" = is_signature_valid. (* pub fn new(recipient: AccountId, close_duration: Timestamp) -> Self { @@ -946,10 +890,10 @@ Section Impl_payment_channel_PaymentChannel_t. let* recipient := M.alloc recipient in let* close_duration := M.alloc close_duration in let* α0 : payment_channel.Env.t := - M.call payment_channel.PaymentChannel.t::["init_env"] in + M.call (impl payment_channel.PaymentChannel.t "init_env") in let* α1 : M.Val payment_channel.Env.t := M.alloc α0 in let* α2 : payment_channel.AccountId.t := - M.call (payment_channel.Env.t::["caller"] (borrow α1)) in + M.call (impl payment_channel.Env.t "caller" (borrow α1)) in let* α3 : payment_channel.AccountId.t := M.read recipient in let* α4 : u64.t := M.read close_duration in M.pure @@ -961,9 +905,7 @@ Section Impl_payment_channel_PaymentChannel_t. payment_channel.PaymentChannel.close_duration := α4; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn close_inner(&mut self, amount: Balance, signature: [u8; 65]) -> Result<()> { @@ -1007,10 +949,10 @@ Section Impl_payment_channel_PaymentChannel_t. let* α1 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α2 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α1))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α1))) in let* α3 : M.Val payment_channel.Env.t := M.alloc α2 in let* α4 : payment_channel.AccountId.t := - M.call (payment_channel.Env.t::["caller"] (borrow α3)) in + M.call (impl payment_channel.Env.t "caller" (borrow α3)) in let* α5 : M.Val payment_channel.AccountId.t := M.alloc α4 in let* α6 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α7 : bool.t := @@ -1054,7 +996,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α2 : array u8.t := M.read signature in let* α3 : bool.t := M.call - (payment_channel.PaymentChannel.t::["is_signature_valid"] + (impl payment_channel.PaymentChannel.t "is_signature_valid" (borrow (deref α0)) α1 α2) in @@ -1078,7 +1020,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α1 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α2 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α1))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α1))) in let* α3 : M.Val payment_channel.Env.t := M.alloc α2 in let* α4 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α5 : payment_channel.AccountId.t := @@ -1089,10 +1031,10 @@ Section Impl_payment_channel_PaymentChannel_t. M.read (payment_channel.PaymentChannel.Get_withdrawn (deref α7)) in let* α9 : u128.t := BinOp.Panic.sub α6 α8 in let* α10 : core.result.Result.t unit payment_channel.Error.t := - M.call (payment_channel.Env.t::["transfer"] (borrow α3) α5 α9) in + M.call (impl payment_channel.Env.t "transfer" (borrow α3) α5 α9) in let* α11 : core.result.Result.t unit payment_channel.Error.t := M.call - ((core.result.Result.t unit payment_channel.Error.t)::["map_err"] + (impl (core.result.Result.t unit payment_channel.Error.t) "map_err" α10 (fun (α0 : payment_channel.Error.t) => (let* α0 := M.alloc α0 in @@ -1168,10 +1110,7 @@ Section Impl_payment_channel_PaymentChannel_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_close_inner : - Notations.DoubleColon Self "close_inner" := { - Notations.double_colon := close_inner; - }. + Axiom close_inner_is_impl : impl Self "close_inner" = close_inner. (* pub fn close(&mut self, amount: Balance, signature: [u8; 65]) -> Result<()> { @@ -1201,7 +1140,8 @@ Section Impl_payment_channel_PaymentChannel_t. let* α2 : u128.t := M.read amount in let* α3 : array u8.t := M.read signature in let* α4 : core.result.Result.t unit payment_channel.Error.t := - M.call (payment_channel.PaymentChannel.t::["close_inner"] α1 α2 α3) in + M.call + (impl payment_channel.PaymentChannel.t "close_inner" α1 α2 α3) in let* α5 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -1266,23 +1206,20 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α1 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α0))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α0))) in let* α2 : M.Val payment_channel.Env.t := M.alloc α1 in let* α3 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α4 : payment_channel.AccountId.t := M.read (payment_channel.PaymentChannel.Get_sender (deref α3)) in let* α5 : unit := M.call - (payment_channel.Env.t::["terminate_contract"] (borrow α2) α4) in + (impl payment_channel.Env.t "terminate_contract" (borrow α2) α4) in M.alloc α5 in let* α0 : M.Val (core.result.Result.t unit payment_channel.Error.t) := M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_close : - Notations.DoubleColon Self "close" := { - Notations.double_colon := close; - }. + Axiom close_is_impl : impl Self "close" = close. (* pub fn start_sender_close(&mut self) -> Result<()> { @@ -1320,10 +1257,10 @@ Section Impl_payment_channel_PaymentChannel_t. let* α1 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α2 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α1))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α1))) in let* α3 : M.Val payment_channel.Env.t := M.alloc α2 in let* α4 : payment_channel.AccountId.t := - M.call (payment_channel.Env.t::["caller"] (borrow α3)) in + M.call (impl payment_channel.Env.t "caller" (borrow α3)) in let* α5 : M.Val payment_channel.AccountId.t := M.alloc α4 in let* α6 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α7 : bool.t := @@ -1348,10 +1285,10 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α1 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α0))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α0))) in let* α2 : M.Val payment_channel.Env.t := M.alloc α1 in let* α3 : u64.t := - M.call (payment_channel.Env.t::["block_timestamp"] (borrow α2)) in + M.call (impl payment_channel.Env.t "block_timestamp" (borrow α2)) in M.alloc α3 in let* expiration : M.Val u64.t := let* α0 : u64.t := M.read now in @@ -1365,7 +1302,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α1 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α0))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α0))) in let* α2 : M.Val payment_channel.Env.t := M.alloc α1 in let* α3 : u64.t := M.read expiration in let* α4 : mut_ref payment_channel.PaymentChannel.t := M.read self in @@ -1374,7 +1311,7 @@ Section Impl_payment_channel_PaymentChannel_t. (payment_channel.PaymentChannel.Get_close_duration (deref α4)) in let* α6 : unit := M.call - (payment_channel.Env.t::["emit_event"] + (impl payment_channel.Env.t "emit_event" (borrow α2) (payment_channel.Event.SenderCloseStarted {| @@ -1392,10 +1329,8 @@ Section Impl_payment_channel_PaymentChannel_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_start_sender_close : - Notations.DoubleColon Self "start_sender_close" := { - Notations.double_colon := start_sender_close; - }. + Axiom start_sender_close_is_impl : + impl Self "start_sender_close" = start_sender_close. (* pub fn claim_timeout(&mut self) -> Result<()> { @@ -1439,12 +1374,12 @@ Section Impl_payment_channel_PaymentChannel_t. M.read self in let* α1 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α0))) in let* α2 : M.Val payment_channel.Env.t := M.alloc α1 in let* α3 : u64.t := M.call - (payment_channel.Env.t::["block_timestamp"] + (impl payment_channel.Env.t "block_timestamp" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := @@ -1467,7 +1402,7 @@ Section Impl_payment_channel_PaymentChannel_t. M.read self in let* α1 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α0))) in let* α2 : M.Val payment_channel.Env.t := M.alloc α1 in let* α3 : mut_ref payment_channel.PaymentChannel.t := @@ -1477,7 +1412,7 @@ Section Impl_payment_channel_PaymentChannel_t. (payment_channel.PaymentChannel.Get_sender (deref α3)) in let* α5 : unit := M.call - (payment_channel.Env.t::["terminate_contract"] + (impl payment_channel.Env.t "terminate_contract" (borrow α2) α4) in M.alloc α5 in @@ -1497,10 +1432,7 @@ Section Impl_payment_channel_PaymentChannel_t. ] in M.read α1). - Global Instance AssociatedFunction_claim_timeout : - Notations.DoubleColon Self "claim_timeout" := { - Notations.double_colon := claim_timeout; - }. + Axiom claim_timeout_is_impl : impl Self "claim_timeout" = claim_timeout. (* pub fn withdraw(&mut self, amount: Balance, signature: [u8; 65]) -> Result<()> { @@ -1548,10 +1480,10 @@ Section Impl_payment_channel_PaymentChannel_t. let* α1 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α2 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α1))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α1))) in let* α3 : M.Val payment_channel.Env.t := M.alloc α2 in let* α4 : payment_channel.AccountId.t := - M.call (payment_channel.Env.t::["caller"] (borrow α3)) in + M.call (impl payment_channel.Env.t "caller" (borrow α3)) in let* α5 : M.Val payment_channel.AccountId.t := M.alloc α4 in let* α6 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α7 : bool.t := @@ -1578,7 +1510,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α2 : array u8.t := M.read signature in let* α3 : bool.t := M.call - (payment_channel.PaymentChannel.t::["is_signature_valid"] + (impl payment_channel.PaymentChannel.t "is_signature_valid" (borrow (deref α0)) α1 α2) in @@ -1634,17 +1566,17 @@ Section Impl_payment_channel_PaymentChannel_t. let* α1 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α2 : payment_channel.Env.t := M.call - (payment_channel.PaymentChannel.t::["env"] (borrow (deref α1))) in + (impl payment_channel.PaymentChannel.t "env" (borrow (deref α1))) in let* α3 : M.Val payment_channel.Env.t := M.alloc α2 in let* α4 : mut_ref payment_channel.PaymentChannel.t := M.read self in let* α5 : payment_channel.AccountId.t := M.read (payment_channel.PaymentChannel.Get_recipient (deref α4)) in let* α6 : u128.t := M.read amount_to_withdraw in let* α7 : core.result.Result.t unit payment_channel.Error.t := - M.call (payment_channel.Env.t::["transfer"] (borrow α3) α5 α6) in + M.call (impl payment_channel.Env.t "transfer" (borrow α3) α5 α6) in let* α8 : core.result.Result.t unit payment_channel.Error.t := M.call - ((core.result.Result.t unit payment_channel.Error.t)::["map_err"] + (impl (core.result.Result.t unit payment_channel.Error.t) "map_err" α7 (fun (α0 : payment_channel.Error.t) => (let* α0 := M.alloc α0 in @@ -1720,10 +1652,7 @@ Section Impl_payment_channel_PaymentChannel_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_withdraw : - Notations.DoubleColon Self "withdraw" := { - Notations.double_colon := withdraw; - }. + Axiom withdraw_is_impl : impl Self "withdraw" = withdraw. (* pub fn get_sender(&self) -> AccountId { @@ -1735,10 +1664,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : ref payment_channel.PaymentChannel.t := M.read self in M.read (payment_channel.PaymentChannel.Get_sender (deref α0)). - Global Instance AssociatedFunction_get_sender : - Notations.DoubleColon Self "get_sender" := { - Notations.double_colon := get_sender; - }. + Axiom get_sender_is_impl : impl Self "get_sender" = get_sender. (* pub fn get_recipient(&self) -> AccountId { @@ -1750,10 +1676,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : ref payment_channel.PaymentChannel.t := M.read self in M.read (payment_channel.PaymentChannel.Get_recipient (deref α0)). - Global Instance AssociatedFunction_get_recipient : - Notations.DoubleColon Self "get_recipient" := { - Notations.double_colon := get_recipient; - }. + Axiom get_recipient_is_impl : impl Self "get_recipient" = get_recipient. (* pub fn get_expiration(&self) -> Option { @@ -1767,10 +1690,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : ref payment_channel.PaymentChannel.t := M.read self in M.read (payment_channel.PaymentChannel.Get_expiration (deref α0)). - Global Instance AssociatedFunction_get_expiration : - Notations.DoubleColon Self "get_expiration" := { - Notations.double_colon := get_expiration; - }. + Axiom get_expiration_is_impl : impl Self "get_expiration" = get_expiration. (* pub fn get_withdrawn(&self) -> Balance { @@ -1784,10 +1704,7 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : ref payment_channel.PaymentChannel.t := M.read self in M.read (payment_channel.PaymentChannel.Get_withdrawn (deref α0)). - Global Instance AssociatedFunction_get_withdrawn : - Notations.DoubleColon Self "get_withdrawn" := { - Notations.double_colon := get_withdrawn; - }. + Axiom get_withdrawn_is_impl : impl Self "get_withdrawn" = get_withdrawn. (* pub fn get_close_duration(&self) -> Timestamp { @@ -1801,10 +1718,8 @@ Section Impl_payment_channel_PaymentChannel_t. let* α0 : ref payment_channel.PaymentChannel.t := M.read self in M.read (payment_channel.PaymentChannel.Get_close_duration (deref α0)). - Global Instance AssociatedFunction_get_close_duration : - Notations.DoubleColon Self "get_close_duration" := { - Notations.double_colon := get_close_duration; - }. + Axiom get_close_duration_is_impl : + impl Self "get_close_duration" = get_close_duration. (* pub fn get_balance(&self) -> Balance { @@ -1815,13 +1730,10 @@ Section Impl_payment_channel_PaymentChannel_t. let* self := M.alloc self in let* α0 : ref payment_channel.PaymentChannel.t := M.read self in let* α1 : payment_channel.Env.t := - M.call (payment_channel.PaymentChannel.t::["env"] α0) in + M.call (impl payment_channel.PaymentChannel.t "env" α0) in let* α2 : M.Val payment_channel.Env.t := M.alloc α1 in - M.call (payment_channel.Env.t::["balance"] (borrow α2)). + M.call (impl payment_channel.Env.t "balance" (borrow α2)). - Global Instance AssociatedFunction_get_balance : - Notations.DoubleColon Self "get_balance" := { - Notations.double_colon := get_balance; - }. + Axiom get_balance_is_impl : impl Self "get_balance" = get_balance. End Impl_payment_channel_PaymentChannel_t. End Impl_payment_channel_PaymentChannel_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash.v b/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash.v index 04df8fd0b..d03941c42 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash.v @@ -45,10 +45,7 @@ Section Impl_core_default_Default_for_set_code_hash_Incrementer_t. let* α1 : u32.t := M.call α0 in M.pure {| set_code_hash.Incrementer.count := α1; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -73,9 +70,7 @@ Section Impl_set_code_hash_Incrementer_t. (Trait := ℐ))) in M.call α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn inc(&mut self) { @@ -109,7 +104,7 @@ Section Impl_set_code_hash_Incrementer_t. let* α5 : mut_ref set_code_hash.Incrementer.t := M.read self in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (set_code_hash.Incrementer.Get_count (deref α5)))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -117,16 +112,14 @@ Section Impl_set_code_hash_Incrementer_t. let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* pub fn get(&self) -> u32 { @@ -138,9 +131,7 @@ Section Impl_set_code_hash_Incrementer_t. let* α0 : ref set_code_hash.Incrementer.t := M.read self in M.read (set_code_hash.Incrementer.Get_count (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* pub fn set_code(&mut self, code_hash: [u8; 32]) { @@ -158,7 +149,9 @@ Section Impl_set_code_hash_Incrementer_t. M.call (set_code_hash.set_code_hash (borrow code_hash)) in let* α1 : unit := M.call - ((core.result.Result.t unit set_code_hash.Error.t)::["unwrap_or_else"] + (impl + (core.result.Result.t unit set_code_hash.Error.t) + "unwrap_or_else" α0 (fun (α0 : set_code_hash.Error.t) => (let* α0 := M.alloc α0 in @@ -188,23 +181,20 @@ Section Impl_set_code_hash_Incrementer_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow code_hash)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow code_hash)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_set_code : - Notations.DoubleColon Self "set_code" := { - Notations.double_colon := set_code; - }. + Axiom set_code_is_impl : impl Self "set_code" = set_code. End Impl_set_code_hash_Incrementer_t. End Impl_set_code_hash_Incrementer_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash/updated_incrementer.v b/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash/updated_incrementer.v index 65ed0d4a4..84314d3da 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash/updated_incrementer.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash/updated_incrementer.v @@ -26,10 +26,7 @@ Section Impl_core_default_Default_for_updated_incrementer_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (updated_incrementer.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -58,10 +55,7 @@ Section Impl_core_clone_Clone_for_updated_incrementer_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -117,10 +111,9 @@ Section Impl_updated_incrementer_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_set_code_hash {E : Set} : - Notations.DoubleColon Self "set_code_hash" := { - Notations.double_colon := set_code_hash (E := E); - }. + Axiom set_code_hash_is_impl : + forall {E : Set}, + impl Self "set_code_hash" = set_code_hash (E := E). End Impl_updated_incrementer_Env_t. End Impl_updated_incrementer_Env_t. @@ -149,10 +142,7 @@ Section Impl_updated_incrementer_Incrementer_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -161,11 +151,9 @@ Section Impl_updated_incrementer_Incrementer_t. *) Definition env (self : ref Self) : M updated_incrementer.Env.t := let* self := M.alloc self in - M.call updated_incrementer.Incrementer.t::["init_env"]. + M.call (impl updated_incrementer.Incrementer.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new() -> Self { @@ -181,9 +169,7 @@ Section Impl_updated_incrementer_Incrementer_t. "Constructors are not called when upgrading using `set_code_hash`."))) in never_to_any α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn inc(&mut self) { @@ -218,7 +204,7 @@ Section Impl_updated_incrementer_Incrementer_t. let* α5 : mut_ref updated_incrementer.Incrementer.t := M.read self in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (updated_incrementer.Incrementer.Get_count (deref α5)))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in @@ -227,16 +213,14 @@ Section Impl_updated_incrementer_Incrementer_t. let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* pub fn get(&self) -> u32 { @@ -248,9 +232,7 @@ Section Impl_updated_incrementer_Incrementer_t. let* α0 : ref updated_incrementer.Incrementer.t := M.read self in M.read (updated_incrementer.Incrementer.Get_count (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* pub fn set_code(&mut self, code_hash: Hash) { @@ -270,18 +252,18 @@ Section Impl_updated_incrementer_Incrementer_t. let* α0 : mut_ref updated_incrementer.Incrementer.t := M.read self in let* α1 : updated_incrementer.Env.t := M.call - (updated_incrementer.Incrementer.t::["env"] (borrow (deref α0))) in + (impl updated_incrementer.Incrementer.t "env" (borrow (deref α0))) in let* α2 : M.Val updated_incrementer.Env.t := M.alloc α1 in let* α3 : core.result.Result.t unit updated_incrementer.Error.t := M.call - (updated_incrementer.Env.t::["set_code_hash"] + (impl updated_incrementer.Env.t "set_code_hash" (borrow α2) (borrow code_hash)) in let* α4 : unit := M.call - ((core.result.Result.t - unit - updated_incrementer.Error.t)::["unwrap_or_else"] + (impl + (core.result.Result.t unit updated_incrementer.Error.t) + "unwrap_or_else" α3 (fun (α0 : updated_incrementer.Error.t) => (let* α0 := M.alloc α0 in @@ -311,23 +293,20 @@ Section Impl_updated_incrementer_Incrementer_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow code_hash)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow code_hash)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_set_code : - Notations.DoubleColon Self "set_code" := { - Notations.double_colon := set_code; - }. + Axiom set_code_is_impl : impl Self "set_code" = set_code. End Impl_updated_incrementer_Incrementer_t. End Impl_updated_incrementer_Incrementer_t. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v b/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v index f3d2f1208..f4a0aa6f4 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v @@ -46,10 +46,7 @@ Section Impl_core_default_Default_for_trait_erc20_Mapping_t_K_V. M.pure {| trait_erc20.Mapping._key := α1; trait_erc20.Mapping._value := α3; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -78,9 +75,7 @@ Section Impl_trait_erc20_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. (* fn insert(&mut self, _key: K, _value: V) { @@ -95,10 +90,7 @@ Section Impl_trait_erc20_Mapping_t_K_V. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_insert : - Notations.DoubleColon Self "insert" := { - Notations.double_colon := insert; - }. + Axiom insert_is_impl : impl Self "insert" = insert. End Impl_trait_erc20_Mapping_t_K_V. End Impl_trait_erc20_Mapping_t_K_V. @@ -127,10 +119,7 @@ Section Impl_core_default_Default_for_trait_erc20_AccountId_t. let* α1 : u128.t := M.call α0 in M.pure (trait_erc20.AccountId.Build_t α1). - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -159,10 +148,7 @@ Section Impl_core_clone_Clone_for_trait_erc20_AccountId_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -243,11 +229,9 @@ Section Impl_core_fmt_Debug_for_trait_erc20_Error_t. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -290,9 +274,7 @@ Section Impl_core_cmp_PartialEq_for_trait_erc20_Error_t. let* α0 : M.Val bool.t := M.alloc (BinOp.Pure.eq α0 α1) in M.read α0. - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -323,10 +305,8 @@ Section Impl_core_cmp_Eq_for_trait_erc20_Error_t. let* self := M.alloc self in M.pure tt. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -435,10 +415,7 @@ Section Impl_core_default_Default_for_trait_erc20_Erc20_t. trait_erc20.Erc20.allowances := α5; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -514,10 +491,7 @@ Section Impl_trait_erc20_Env_t. let* α0 : ref trait_erc20.Env.t := M.read self in M.read (trait_erc20.Env.Get_caller (deref α0)). - Global Instance AssociatedFunction_caller : - Notations.DoubleColon Self "caller" := { - Notations.double_colon := caller; - }. + Axiom caller_is_impl : impl Self "caller" = caller. (* fn emit_event(&self, _event: Event) { @@ -534,10 +508,7 @@ Section Impl_trait_erc20_Env_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_emit_event : - Notations.DoubleColon Self "emit_event" := { - Notations.double_colon := emit_event; - }. + Axiom emit_event_is_impl : impl Self "emit_event" = emit_event. End Impl_trait_erc20_Env_t. End Impl_trait_erc20_Env_t. @@ -555,10 +526,7 @@ Section Impl_trait_erc20_Erc20_t. let* α1 : never.t := M.call (core.panicking.panic α0) in never_to_any α1. - Global Instance AssociatedFunction_init_env : - Notations.DoubleColon Self "init_env" := { - Notations.double_colon := init_env; - }. + Axiom init_env_is_impl : impl Self "init_env" = init_env. (* fn env(&self) -> Env { @@ -567,11 +535,9 @@ Section Impl_trait_erc20_Erc20_t. *) Definition env (self : ref Self) : M trait_erc20.Env.t := let* self := M.alloc self in - M.call trait_erc20.Erc20.t::["init_env"]. + M.call (impl trait_erc20.Erc20.t "init_env"). - Global Instance AssociatedFunction_env : Notations.DoubleColon Self "env" := { - Notations.double_colon := env; - }. + Axiom env_is_impl : impl Self "env" = env. (* pub fn new(total_supply: Balance) -> Self { @@ -603,29 +569,31 @@ Section Impl_trait_erc20_Erc20_t. M.call α0 in M.alloc α1 in let* caller : M.Val trait_erc20.AccountId.t := - let* α0 : trait_erc20.Env.t := M.call trait_erc20.Erc20.t::["init_env"] in + let* α0 : trait_erc20.Env.t := + M.call (impl trait_erc20.Erc20.t "init_env") in let* α1 : M.Val trait_erc20.Env.t := M.alloc α0 in let* α2 : trait_erc20.AccountId.t := - M.call (trait_erc20.Env.t::["caller"] (borrow α1)) in + M.call (impl trait_erc20.Env.t "caller" (borrow α1)) in M.alloc α2 in let* _ : M.Val unit := let* α0 : trait_erc20.AccountId.t := M.read caller in let* α1 : u128.t := M.read total_supply in let* α2 : unit := M.call - ((trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t)::["insert"] + (impl (trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t) "insert" (borrow_mut balances) α0 α1) in M.alloc α2 in let* _ : M.Val unit := - let* α0 : trait_erc20.Env.t := M.call trait_erc20.Erc20.t::["init_env"] in + let* α0 : trait_erc20.Env.t := + M.call (impl trait_erc20.Erc20.t "init_env") in let* α1 : M.Val trait_erc20.Env.t := M.alloc α0 in let* α2 : trait_erc20.AccountId.t := M.read caller in let* α3 : u128.t := M.read total_supply in let* α4 : unit := M.call - (trait_erc20.Env.t::["emit_event"] + (impl trait_erc20.Env.t "emit_event" (borrow α1) (trait_erc20.Event.Transfer {| @@ -659,9 +627,7 @@ Section Impl_trait_erc20_Erc20_t. |} in M.read α0. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn balance_of_impl(&self, owner: &AccountId) -> Balance { @@ -678,15 +644,12 @@ Section Impl_trait_erc20_Erc20_t. let* α1 : ref trait_erc20.AccountId.t := M.read owner in let* α2 : core.option.Option.t u128.t := M.call - ((trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t)::["get"] + (impl (trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t) "get" (borrow (trait_erc20.Erc20.Get_balances (deref α0))) α1) in - M.call ((core.option.Option.t u128.t)::["unwrap_or_default"] α2). + M.call (impl (core.option.Option.t u128.t) "unwrap_or_default" α2). - Global Instance AssociatedFunction_balance_of_impl : - Notations.DoubleColon Self "balance_of_impl" := { - Notations.double_colon := balance_of_impl; - }. + Axiom balance_of_impl_is_impl : impl Self "balance_of_impl" = balance_of_impl. (* fn allowance_impl(&self, owner: &AccountId, spender: &AccountId) -> Balance { @@ -710,17 +673,16 @@ Section Impl_trait_erc20_Erc20_t. M.alloc (α2, α4) in let* α6 : core.option.Option.t u128.t := M.call - ((trait_erc20.Mapping.t + (impl + (trait_erc20.Mapping.t (trait_erc20.AccountId.t * trait_erc20.AccountId.t) - u128.t)::["get"] + u128.t) + "get" (borrow (trait_erc20.Erc20.Get_allowances (deref α0))) (borrow α5)) in - M.call ((core.option.Option.t u128.t)::["unwrap_or_default"] α6). + M.call (impl (core.option.Option.t u128.t) "unwrap_or_default" α6). - Global Instance AssociatedFunction_allowance_impl : - Notations.DoubleColon Self "allowance_impl" := { - Notations.double_colon := allowance_impl; - }. + Axiom allowance_impl_is_impl : impl Self "allowance_impl" = allowance_impl. (* fn transfer_from_to(&mut self, from: &AccountId, to: &AccountId, value: Balance) -> Result<()> { @@ -757,7 +719,9 @@ Section Impl_trait_erc20_Erc20_t. let* α1 : ref trait_erc20.AccountId.t := M.read from in let* α2 : u128.t := M.call - (trait_erc20.Erc20.t::["balance_of_impl"] (borrow (deref α0)) α1) in + (impl trait_erc20.Erc20.t "balance_of_impl" + (borrow (deref α0)) + α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : u128.t := M.read from_balance in @@ -782,7 +746,9 @@ Section Impl_trait_erc20_Erc20_t. let* α5 : u128.t := BinOp.Panic.sub α3 α4 in let* α6 : unit := M.call - ((trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t)::["insert"] + (impl + (trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t) + "insert" (borrow_mut (trait_erc20.Erc20.Get_balances (deref α0))) α2 α5) in @@ -792,7 +758,9 @@ Section Impl_trait_erc20_Erc20_t. let* α1 : ref trait_erc20.AccountId.t := M.read to in let* α2 : u128.t := M.call - (trait_erc20.Erc20.t::["balance_of_impl"] (borrow (deref α0)) α1) in + (impl trait_erc20.Erc20.t "balance_of_impl" + (borrow (deref α0)) + α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in @@ -803,7 +771,9 @@ Section Impl_trait_erc20_Erc20_t. let* α5 : u128.t := BinOp.Panic.add α3 α4 in let* α6 : unit := M.call - ((trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t)::["insert"] + (impl + (trait_erc20.Mapping.t trait_erc20.AccountId.t u128.t) + "insert" (borrow_mut (trait_erc20.Erc20.Get_balances (deref α0))) α2 α5) in @@ -811,7 +781,7 @@ Section Impl_trait_erc20_Erc20_t. let* _ : M.Val unit := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in let* α1 : trait_erc20.Env.t := - M.call (trait_erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl trait_erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val trait_erc20.Env.t := M.alloc α1 in let* α3 : ref trait_erc20.AccountId.t := M.read from in let* α4 : trait_erc20.AccountId.t := M.read (deref α3) in @@ -820,7 +790,7 @@ Section Impl_trait_erc20_Erc20_t. let* α7 : u128.t := M.read value in let* α8 : unit := M.call - (trait_erc20.Env.t::["emit_event"] + (impl trait_erc20.Env.t "emit_event" (borrow α2) (trait_erc20.Event.Transfer {| @@ -833,10 +803,8 @@ Section Impl_trait_erc20_Erc20_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_transfer_from_to : - Notations.DoubleColon Self "transfer_from_to" := { - Notations.double_colon := transfer_from_to; - }. + Axiom transfer_from_to_is_impl : + impl Self "transfer_from_to" = transfer_from_to. End Impl_trait_erc20_Erc20_t. End Impl_trait_erc20_Erc20_t. @@ -854,10 +822,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* α0 : ref trait_erc20.Erc20.t := M.read self in M.read (trait_erc20.Erc20.Get_total_supply (deref α0)). - Global Instance AssociatedFunction_total_supply : - Notations.DoubleColon Self "total_supply" := { - Notations.double_colon := total_supply; - }. + Axiom total_supply_is_impl : impl Self "total_supply" = total_supply. (* fn balance_of(&self, owner: AccountId) -> Balance { @@ -871,12 +836,9 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* self := M.alloc self in let* owner := M.alloc owner in let* α0 : ref trait_erc20.Erc20.t := M.read self in - M.call (trait_erc20.Erc20.t::["balance_of_impl"] α0 (borrow owner)). + M.call (impl trait_erc20.Erc20.t "balance_of_impl" α0 (borrow owner)). - Global Instance AssociatedFunction_balance_of : - Notations.DoubleColon Self "balance_of" := { - Notations.double_colon := balance_of; - }. + Axiom balance_of_is_impl : impl Self "balance_of" = balance_of. (* fn allowance(&self, owner: AccountId, spender: AccountId) -> Balance { @@ -893,15 +855,12 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* spender := M.alloc spender in let* α0 : ref trait_erc20.Erc20.t := M.read self in M.call - (trait_erc20.Erc20.t::["allowance_impl"] + (impl trait_erc20.Erc20.t "allowance_impl" α0 (borrow owner) (borrow spender)). - Global Instance AssociatedFunction_allowance : - Notations.DoubleColon Self "allowance" := { - Notations.double_colon := allowance; - }. + Axiom allowance_is_impl : impl Self "allowance" = allowance. (* fn transfer(&mut self, to: AccountId, value: Balance) -> Result<()> { @@ -920,16 +879,16 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* from : M.Val trait_erc20.AccountId.t := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in let* α1 : trait_erc20.Env.t := - M.call (trait_erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl trait_erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val trait_erc20.Env.t := M.alloc α1 in let* α3 : trait_erc20.AccountId.t := - M.call (trait_erc20.Env.t::["caller"] (borrow α2)) in + M.call (impl trait_erc20.Env.t "caller" (borrow α2)) in M.alloc α3 in let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in let* α1 : u128.t := M.read value in let* α2 : core.result.Result.t unit trait_erc20.Error.t := M.call - (trait_erc20.Erc20.t::["transfer_from_to"] + (impl trait_erc20.Erc20.t "transfer_from_to" α0 (borrow from) (borrow to) @@ -938,10 +897,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. M.alloc α2 in M.read α0. - Global Instance AssociatedFunction_transfer : - Notations.DoubleColon Self "transfer" := { - Notations.double_colon := transfer; - }. + Axiom transfer_is_impl : impl Self "transfer" = transfer. (* fn approve(&mut self, spender: AccountId, value: Balance) -> Result<()> { @@ -966,10 +922,10 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* owner : M.Val trait_erc20.AccountId.t := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in let* α1 : trait_erc20.Env.t := - M.call (trait_erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl trait_erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val trait_erc20.Env.t := M.alloc α1 in let* α3 : trait_erc20.AccountId.t := - M.call (trait_erc20.Env.t::["caller"] (borrow α2)) in + M.call (impl trait_erc20.Env.t "caller" (borrow α2)) in M.alloc α3 in let* _ : M.Val unit := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in @@ -978,9 +934,11 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* α3 : u128.t := M.read value in let* α4 : unit := M.call - ((trait_erc20.Mapping.t + (impl + (trait_erc20.Mapping.t (trait_erc20.AccountId.t * trait_erc20.AccountId.t) - u128.t)::["insert"] + u128.t) + "insert" (borrow_mut (trait_erc20.Erc20.Get_allowances (deref α0))) (α1, α2) α3) in @@ -988,14 +946,14 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* _ : M.Val unit := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in let* α1 : trait_erc20.Env.t := - M.call (trait_erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl trait_erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val trait_erc20.Env.t := M.alloc α1 in let* α3 : trait_erc20.AccountId.t := M.read owner in let* α4 : trait_erc20.AccountId.t := M.read spender in let* α5 : u128.t := M.read value in let* α6 : unit := M.call - (trait_erc20.Env.t::["emit_event"] + (impl trait_erc20.Env.t "emit_event" (borrow α2) (trait_erc20.Event.Approval {| @@ -1008,10 +966,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. M.alloc (core.result.Result.Ok tt) in M.read α0. - Global Instance AssociatedFunction_approve : - Notations.DoubleColon Self "approve" := { - Notations.double_colon := approve; - }. + Axiom approve_is_impl : impl Self "approve" = approve. (* fn transfer_from(&mut self, from: AccountId, to: AccountId, value: Balance) -> Result<()> { @@ -1040,16 +995,16 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. (let* caller : M.Val trait_erc20.AccountId.t := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in let* α1 : trait_erc20.Env.t := - M.call (trait_erc20.Erc20.t::["env"] (borrow (deref α0))) in + M.call (impl trait_erc20.Erc20.t "env" (borrow (deref α0))) in let* α2 : M.Val trait_erc20.Env.t := M.alloc α1 in let* α3 : trait_erc20.AccountId.t := - M.call (trait_erc20.Env.t::["caller"] (borrow α2)) in + M.call (impl trait_erc20.Env.t "caller" (borrow α2)) in M.alloc α3 in let* allowance : M.Val u128.t := let* α0 : mut_ref trait_erc20.Erc20.t := M.read self in let* α1 : u128.t := M.call - (trait_erc20.Erc20.t::["allowance_impl"] + (impl trait_erc20.Erc20.t "allowance_impl" (borrow (deref α0)) (borrow from) (borrow caller)) in @@ -1079,7 +1034,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* α2 : u128.t := M.read value in let* α3 : core.result.Result.t unit trait_erc20.Error.t := M.call - (trait_erc20.Erc20.t::["transfer_from_to"] + (impl trait_erc20.Erc20.t "transfer_from_to" α1 (borrow from) (borrow to) @@ -1152,9 +1107,11 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. let* α5 : u128.t := BinOp.Panic.sub α3 α4 in let* α6 : unit := M.call - ((trait_erc20.Mapping.t + (impl + (trait_erc20.Mapping.t (trait_erc20.AccountId.t * trait_erc20.AccountId.t) - u128.t)::["insert"] + u128.t) + "insert" (borrow_mut (trait_erc20.Erc20.Get_allowances (deref α0))) (α1, α2) α5) in @@ -1163,10 +1120,7 @@ Section Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20_t. M.alloc (core.result.Result.Ok tt) in M.read α0). - Global Instance AssociatedFunction_transfer_from : - Notations.DoubleColon Self "transfer_from" := { - Notations.double_colon := transfer_from; - }. + Axiom transfer_from_is_impl : impl Self "transfer_from" = transfer_from. Global Instance ℐ : trait_erc20.BaseErc20.Trait Self := { trait_erc20.BaseErc20.total_supply := total_supply; diff --git a/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v b/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v index 7c1d5bfd3..899fbe491 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v @@ -40,9 +40,7 @@ Section Impl_trait_flipper_Flipper_t. let* α1 : bool.t := M.call α0 in M.pure {| trait_flipper.Flipper.value := α1; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_trait_flipper_Flipper_t. End Impl_trait_flipper_Flipper_t. @@ -65,10 +63,7 @@ Section Impl_trait_flipper_Flip_for_trait_flipper_Flipper_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_flip : - Notations.DoubleColon Self "flip" := { - Notations.double_colon := flip; - }. + Axiom flip_is_impl : impl Self "flip" = flip. (* fn get(&self) -> bool { @@ -80,9 +75,7 @@ Section Impl_trait_flipper_Flip_for_trait_flipper_Flipper_t. let* α0 : ref trait_flipper.Flipper.t := M.read self in M.read (trait_flipper.Flipper.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : trait_flipper.Flip.Trait Self := { trait_flipper.Flip.flip := flip; diff --git a/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v b/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v index d2bcfca66..47c304e25 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v @@ -45,9 +45,7 @@ Section Impl_trait_incrementer_Incrementer_t. let* α0 : u64.t := M.read init_value in M.pure {| trait_incrementer.Incrementer.value := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn inc_by(&mut self, delta: u64) { @@ -68,10 +66,7 @@ Section Impl_trait_incrementer_Incrementer_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_inc_by : - Notations.DoubleColon Self "inc_by" := { - Notations.double_colon := inc_by; - }. + Axiom inc_by_is_impl : impl Self "inc_by" = inc_by. End Impl_trait_incrementer_Incrementer_t. End Impl_trait_incrementer_Incrementer_t. @@ -88,13 +83,11 @@ Section Impl_trait_incrementer_Increment_for_trait_incrementer_Incrementer_t. let* self := M.alloc self in let* α0 : mut_ref trait_incrementer.Incrementer.t := M.read self in M.call - (trait_incrementer.Incrementer.t::["inc_by"] + (impl trait_incrementer.Incrementer.t "inc_by" α0 ((Integer.of_Z 1) : u64.t)). - Global Instance AssociatedFunction_inc : Notations.DoubleColon Self "inc" := { - Notations.double_colon := inc; - }. + Axiom inc_is_impl : impl Self "inc" = inc. (* fn get(&self) -> u64 { @@ -106,9 +99,7 @@ Section Impl_trait_incrementer_Increment_for_trait_incrementer_Incrementer_t. let* α0 : ref trait_incrementer.Incrementer.t := M.read self in M.read (trait_incrementer.Incrementer.Get_value (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : trait_incrementer.Increment.Trait Self := { trait_incrementer.Increment.inc := inc; @@ -136,10 +127,7 @@ Section Impl_trait_incrementer_Reset_for_trait_incrementer_Incrementer_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_reset : - Notations.DoubleColon Self "reset" := { - Notations.double_colon := reset; - }. + Axiom reset_is_impl : impl Self "reset" = reset. Global Instance ℐ : trait_incrementer.Reset.Trait Self := { trait_incrementer.Reset.reset := reset; diff --git a/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v b/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v index e77d4d1e2..c7b8cd395 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v @@ -28,9 +28,7 @@ Section Impl_wildcard_selector_WildcardSelector_t. *) Definition new : M Self := M.pure wildcard_selector.WildcardSelector.Build. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn wildcard(&mut self) { @@ -45,9 +43,9 @@ Section Impl_wildcard_selector_WildcardSelector_t. M.call wildcard_selector.decode_input in let* α1 : (array u8.t) * alloc.string.String.t := M.call - ((core.result.Result.t - ((array u8.t) * alloc.string.String.t) - unit)::["unwrap"] + (impl + (core.result.Result.t ((array u8.t) * alloc.string.String.t) unit) + "unwrap" α0) in let* α2 : M.Val ((array u8.t) * alloc.string.String.t) := M.alloc α1 in let* α3 : M.Val unit := @@ -77,11 +75,11 @@ Section Impl_wildcard_selector_WildcardSelector_t. M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow _selector)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow _message)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in @@ -90,7 +88,7 @@ Section Impl_wildcard_selector_WildcardSelector_t. let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -100,10 +98,7 @@ Section Impl_wildcard_selector_WildcardSelector_t. ] in M.read α3. - Global Instance AssociatedFunction_wildcard : - Notations.DoubleColon Self "wildcard" := { - Notations.double_colon := wildcard; - }. + Axiom wildcard_is_impl : impl Self "wildcard" = wildcard. (* pub fn wildcard_complement(&mut self, _message: String) { @@ -127,23 +122,22 @@ Section Impl_wildcard_selector_WildcardSelector_t. let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow _message)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow _message)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_wildcard_complement : - Notations.DoubleColon Self "wildcard_complement" := { - Notations.double_colon := wildcard_complement; - }. + Axiom wildcard_complement_is_impl : + impl Self "wildcard_complement" = wildcard_complement. End Impl_wildcard_selector_WildcardSelector_t. End Impl_wildcard_selector_WildcardSelector_t. diff --git a/CoqOfRust/examples/default/examples/macro_rules/macro_example.v b/CoqOfRust/examples/default/examples/macro_rules/macro_example.v index 1d78c9ad7..9e8715ce0 100644 --- a/CoqOfRust/examples/default/examples/macro_rules/macro_example.v +++ b/CoqOfRust/examples/default/examples/macro_rules/macro_example.v @@ -17,7 +17,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in let* α0 : M.Val unit := M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_designators.v b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_designators.v index 8669492dc..9a0c65208 100644 --- a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_designators.v +++ b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_designators.v @@ -19,14 +19,14 @@ Definition foo : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow (mk_str "foo"))) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "foo"))) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -51,14 +51,14 @@ Definition bar : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow (mk_str "bar"))) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "bar"))) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -100,20 +100,20 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "1u32 + 1"))) in let* α7 : u32.t := BinOp.Panic.add ((Integer.of_Z 1) : u32.t) ((Integer.of_Z 1) : u32.t) in let* α8 : M.Val u32.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -129,7 +129,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "{ let x = 1u32; x * x + 2 * x - 1 }"))) in let* x : M.Val u32.t := M.alloc ((Integer.of_Z 1) : u32.t) in let* α0 : u32.t := M.read x in @@ -141,14 +141,14 @@ Definition main : M unit := let* α6 : u32.t := BinOp.Panic.sub α5 ((Integer.of_Z 1) : u32.t) in let* α7 : M.Val u32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_dsl.v b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_dsl.v index 933557ad8..330f879db 100644 --- a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_dsl.v +++ b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_dsl.v @@ -31,14 +31,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow val)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow val)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -64,14 +64,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow val)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow val)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_overload.v b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_overload.v index be24b4174..0824faa22 100644 --- a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_overload.v +++ b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_overload.v @@ -22,11 +22,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "1i32 + 1 == 2i32"))) in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "2i32 * 2 == 4i32"))) in let* α9 : i32.t := BinOp.Panic.add ((Integer.of_Z 1) : i32.t) ((Integer.of_Z 1) : i32.t) in @@ -38,7 +38,7 @@ Definition main : M unit := (BinOp.Pure.eq α9 ((Integer.of_Z 2) : i32.t)) (BinOp.Pure.eq α10 ((Integer.of_Z 4) : i32.t))) in let* α12 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α11)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α11)) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α12 ] in let* α14 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -46,7 +46,7 @@ Definition main : M unit := let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in @@ -63,13 +63,13 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow (mk_str "true"))) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "true"))) in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow (mk_str "false"))) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow (mk_str "false"))) in let* α9 : M.Val bool.t := M.alloc (BinOp.Pure.or true false) in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -77,7 +77,7 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_repeat.v b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_repeat.v index 48d52c94f..50807298c 100644 --- a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_repeat.v +++ b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_repeat.v @@ -19,14 +19,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in @@ -44,14 +44,14 @@ Definition main : M unit := let* α6 : i32.t := M.call (core.cmp.min α5 ((Integer.of_Z 2) : i32.t)) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -70,14 +70,14 @@ Definition main : M unit := let* α7 : i32.t := M.call (core.cmp.min ((Integer.of_Z 5) : i32.t) α6) in let* α8 : M.Val i32.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_variadic_interfaces.v b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_variadic_interfaces.v index 8a723e2ce..5e132860e 100644 --- a/CoqOfRust/examples/default/examples/macro_rules/macro_rules_variadic_interfaces.v +++ b/CoqOfRust/examples/default/examples/macro_rules/macro_rules_variadic_interfaces.v @@ -29,14 +29,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow val)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow val)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -58,14 +58,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow val)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow val)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -87,14 +87,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow val)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow val)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/modules/struct_visibility.v b/CoqOfRust/examples/default/examples/modules/struct_visibility.v index 29940511d..1f44c09d4 100644 --- a/CoqOfRust/examples/default/examples/modules/struct_visibility.v +++ b/CoqOfRust/examples/default/examples/modules/struct_visibility.v @@ -48,10 +48,7 @@ Module my. let* α0 : T := M.read contents in M.pure {| struct_visibility.my.ClosedBox.contents := α0; |}. - Global Instance AssociatedFunction_new : - Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_struct_visibility_my_ClosedBox_t_T. End Impl_struct_visibility_my_ClosedBox_t_T. End my. @@ -102,9 +99,7 @@ Section Impl_struct_visibility_my_ClosedBox_t_T_2. let* α0 : T := M.read contents in M.pure {| struct_visibility.my.ClosedBox.contents := α0; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. End Impl_struct_visibility_my_ClosedBox_t_T_2. End Impl_struct_visibility_my_ClosedBox_t_T_2. @@ -149,7 +144,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (struct_visibility.my.OpenBox.Get_contents open_box))) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -157,14 +152,14 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in let* _closed_box : M.Val (struct_visibility.my.ClosedBox.t (ref str.t)) := let* α0 : ref str.t := M.read (mk_str "classified information") in let* α1 : struct_visibility.my.ClosedBox.t (ref str.t) := - M.call ((struct_visibility.my.ClosedBox.t (ref str.t))::["new"] α0) in + M.call (impl (struct_visibility.my.ClosedBox.t (ref str.t)) "new" α0) in M.alloc α1 in let* α0 : M.Val unit := M.alloc tt in M.read α0. diff --git a/CoqOfRust/examples/default/examples/modules/super_and_self.v b/CoqOfRust/examples/default/examples/modules/super_and_self.v index 4338e2329..9639504ef 100644 --- a/CoqOfRust/examples/default/examples/modules/super_and_self.v +++ b/CoqOfRust/examples/default/examples/modules/super_and_self.v @@ -16,7 +16,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -39,7 +39,7 @@ Module cool. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -62,7 +62,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -85,7 +85,7 @@ Module my. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -109,7 +109,7 @@ Module my. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -153,7 +153,7 @@ Module my. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -191,7 +191,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -216,7 +216,7 @@ Module cool. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -241,7 +241,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -284,7 +284,7 @@ Definition indirect_call : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/modules/the_use_as_declaration.v b/CoqOfRust/examples/default/examples/modules/the_use_as_declaration.v index c31f6a16f..e329b03fc 100644 --- a/CoqOfRust/examples/default/examples/modules/the_use_as_declaration.v +++ b/CoqOfRust/examples/default/examples/modules/the_use_as_declaration.v @@ -16,7 +16,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -41,7 +41,7 @@ Module deeply. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -67,7 +67,7 @@ Module nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -91,7 +91,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -133,7 +133,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -150,7 +150,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/modules/visibility.v b/CoqOfRust/examples/default/examples/modules/visibility.v index 1eb5c0696..c814e14c8 100644 --- a/CoqOfRust/examples/default/examples/modules/visibility.v +++ b/CoqOfRust/examples/default/examples/modules/visibility.v @@ -18,7 +18,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -40,7 +40,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -64,7 +64,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -91,7 +91,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -115,7 +115,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -141,7 +141,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -170,7 +170,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -195,7 +195,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -224,7 +224,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -240,7 +240,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -267,7 +267,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -292,7 +292,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -318,7 +318,7 @@ Module my_mod. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -343,7 +343,7 @@ Definition private_function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -365,7 +365,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -389,7 +389,7 @@ Definition indirect_access : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -416,7 +416,7 @@ Module nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -440,7 +440,7 @@ Module nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -466,7 +466,7 @@ Module nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -494,7 +494,7 @@ Module nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -519,7 +519,7 @@ Module nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -543,7 +543,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -567,7 +567,7 @@ Definition private_function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -593,7 +593,7 @@ Definition public_function_in_my_mod : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -621,7 +621,7 @@ Definition public_function_in_nested : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -645,7 +645,7 @@ Definition public_function_in_super_mod : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -673,7 +673,7 @@ Definition call_public_function_in_my_mod : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -689,7 +689,7 @@ Definition call_public_function_in_my_mod : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -716,7 +716,7 @@ Definition public_function_in_crate : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -741,7 +741,7 @@ Module private_nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -767,7 +767,7 @@ Module private_nested. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -792,7 +792,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -817,7 +817,7 @@ Definition restricted_function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -839,7 +839,7 @@ Definition function : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/monadic_transformation/example03.v b/CoqOfRust/examples/default/examples/monadic_transformation/example03.v index ce0cce065..c934f478f 100644 --- a/CoqOfRust/examples/default/examples/monadic_transformation/example03.v +++ b/CoqOfRust/examples/default/examples/monadic_transformation/example03.v @@ -29,7 +29,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* α0 : M.Val unit := M.alloc tt in M.read α0. diff --git a/CoqOfRust/examples/default/examples/monadic_transformation/example05.v b/CoqOfRust/examples/default/examples/monadic_transformation/example05.v index d03133a15..b6d6e810b 100644 --- a/CoqOfRust/examples/default/examples/monadic_transformation/example05.v +++ b/CoqOfRust/examples/default/examples/monadic_transformation/example05.v @@ -26,10 +26,7 @@ Section Impl_example05_Foo_t. let* α0 : u32.t := M.read (example05.Foo.Get_0 self) in BinOp.Panic.add α0 ((Integer.of_Z 1) : u32.t). - Global Instance AssociatedFunction_plus1 : - Notations.DoubleColon Self "plus1" := { - Notations.double_colon := plus1; - }. + Axiom plus1_is_impl : impl Self "plus1" = plus1. End Impl_example05_Foo_t. End Impl_example05_Foo_t. @@ -45,7 +42,7 @@ Definition main : M unit := M.alloc (example05.Foo.Build_t ((Integer.of_Z 0) : u32.t)) in let* _ : M.Val u32.t := let* α0 : example05.Foo.t := M.read foo in - let* α1 : u32.t := M.call (example05.Foo.t::["plus1"] α0) in + let* α1 : u32.t := M.call (impl example05.Foo.t "plus1" α0) in M.alloc α1 in let* α0 : M.Val unit := M.alloc tt in M.read α0. diff --git a/CoqOfRust/examples/default/examples/primitives/arrays_and_slices.v b/CoqOfRust/examples/default/examples/primitives/arrays_and_slices.v index fc28bcc5a..dd0e94444 100644 --- a/CoqOfRust/examples/default/examples/primitives/arrays_and_slices.v +++ b/CoqOfRust/examples/default/examples/primitives/arrays_and_slices.v @@ -21,7 +21,7 @@ Definition analyze_slice (slice : ref (slice i32.t)) : M unit := let* α5 : ref (slice i32.t) := M.read slice in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (deref α5)[M.alloc ((Integer.of_Z 0) : usize.t)])) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -29,7 +29,7 @@ Definition analyze_slice (slice : ref (slice i32.t)) : M unit := let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -43,17 +43,17 @@ Definition analyze_slice (slice : ref (slice i32.t)) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : ref (slice i32.t) := M.read slice in - let* α6 : usize.t := M.call ((slice i32.t)::["len"] α5) in + let* α6 : usize.t := M.call (impl (slice i32.t) "len" α5) in let* α7 : M.Val usize.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -133,7 +133,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow xs[M.alloc ((Integer.of_Z 0) : usize.t)])) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -141,7 +141,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -156,7 +156,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow xs[M.alloc ((Integer.of_Z 1) : usize.t)])) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -164,7 +164,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -179,17 +179,17 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val (ref (array i32.t)) := M.alloc (borrow xs) in let* α6 : ref (slice i32.t) := M.read (pointer_coercion "Unsize" α5) in - let* α7 : usize.t := M.call ((slice i32.t)::["len"] α6) in + let* α7 : usize.t := M.call (impl (slice i32.t) "len" α6) in let* α8 : M.Val usize.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -205,14 +205,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow xs)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -226,7 +226,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -245,7 +245,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -382,7 +382,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α1 : M.Val (ref (array i32.t)) := M.alloc (borrow xs) in let* α2 : ref (slice i32.t) := M.read (pointer_coercion "Unsize" α1) in - let* α3 : usize.t := M.call ((slice i32.t)::["len"] α2) in + let* α3 : usize.t := M.call (impl (slice i32.t) "len" α2) in let* α4 : usize.t := BinOp.Panic.add α3 ((Integer.of_Z 1) : usize.t) in let* α5 : core.ops.range.Range.t usize.t := M.call @@ -434,7 +434,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α0) in let* α2 : usize.t := M.read i in let* α3 : core.option.Option.t (ref i32.t) := - M.call ((slice i32.t)::["get"] α1 α2) in + M.call (impl (slice i32.t) "get" α1 α2) in let* α4 : M.Val (core.option.Option.t (ref i32.t)) := M.alloc α3 in match_operator @@ -459,11 +459,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow xval)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := @@ -476,7 +476,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α5 α10) in + (impl core.fmt.Arguments.t "new_v1" + α5 + α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in @@ -502,7 +504,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := @@ -515,7 +517,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α4 α8) in + (impl core.fmt.Arguments.t "new_v1" + α4 + α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in diff --git a/CoqOfRust/examples/default/examples/primitives/literals_operators.v b/CoqOfRust/examples/default/examples/primitives/literals_operators.v index 0c7ca92c9..a885715ef 100644 --- a/CoqOfRust/examples/default/examples/primitives/literals_operators.v +++ b/CoqOfRust/examples/default/examples/primitives/literals_operators.v @@ -41,14 +41,14 @@ Definition main : M unit := BinOp.Panic.add ((Integer.of_Z 1) : u32.t) ((Integer.of_Z 2) : u32.t) in let* α6 : M.Val u32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -65,14 +65,14 @@ Definition main : M unit := BinOp.Panic.sub ((Integer.of_Z 1) : i32.t) ((Integer.of_Z 2) : i32.t) in let* α6 : M.Val i32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -87,14 +87,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val bool.t := M.alloc (BinOp.Pure.and true false) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -109,14 +109,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val bool.t := M.alloc (BinOp.Pure.or true false) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -131,14 +131,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val bool.t := M.alloc (UnOp.not true) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -157,7 +157,7 @@ Definition main : M unit := ((Integer.of_Z 3) : u32.t) ((Integer.of_Z 5) : u32.t)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_binary"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_binary" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in @@ -165,7 +165,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) " "%char core.fmt.rt.Alignment.Unknown @@ -178,9 +178,9 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α9 α13 α14) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α9 α13 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -199,7 +199,7 @@ Definition main : M unit := ((Integer.of_Z 3) : u32.t) ((Integer.of_Z 5) : u32.t)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_binary"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_binary" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in @@ -207,7 +207,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) " "%char core.fmt.rt.Alignment.Unknown @@ -220,9 +220,9 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α9 α13 α14) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α9 α13 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -241,7 +241,7 @@ Definition main : M unit := ((Integer.of_Z 3) : u32.t) ((Integer.of_Z 5) : u32.t)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_binary"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_binary" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in @@ -249,7 +249,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.rt.Placeholder.t := M.call - (core.fmt.rt.Placeholder.t::["new"] + (impl core.fmt.rt.Placeholder.t "new" ((Integer.of_Z 0) : usize.t) " "%char core.fmt.rt.Alignment.Unknown @@ -262,9 +262,9 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Placeholder.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.rt.UnsafeArg.t := - M.call core.fmt.rt.UnsafeArg.t::["new"] in + M.call (impl core.fmt.rt.UnsafeArg.t "new") in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1_formatted"] α4 α9 α13 α14) in + M.call (impl core.fmt.Arguments.t "new_v1_formatted" α4 α9 α13 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -281,14 +281,14 @@ Definition main : M unit := BinOp.Panic.shl ((Integer.of_Z 1) : u32.t) ((Integer.of_Z 5) : i32.t) in let* α6 : M.Val u32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -307,14 +307,14 @@ Definition main : M unit := ((Integer.of_Z 2) : i32.t) in let* α6 : M.Val u32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_lower_hex"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_lower_hex" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -328,14 +328,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : array core.fmt.rt.Argument.t := - M.call core.fmt.rt.Argument.t::["none"] in + M.call (impl core.fmt.rt.Argument.t "none") in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc α4 in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/primitives/tuples.v b/CoqOfRust/examples/default/examples/primitives/tuples.v index 99d452977..ead71c2df 100644 --- a/CoqOfRust/examples/default/examples/primitives/tuples.v +++ b/CoqOfRust/examples/default/examples/primitives/tuples.v @@ -84,11 +84,15 @@ Section Impl_core_fmt_Debug_for_tuples_Matrix_t. let* α13 : M.Val (ref (ref f32.t)) := M.alloc (borrow α12) in let* α14 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α13) in M.call - (core.fmt.Formatter.t::["debug_tuple_field4_finish"] α0 α1 α4 α7 α10 α14). + (impl core.fmt.Formatter.t "debug_tuple_field4_finish" + α0 + α1 + α4 + α7 + α10 + α14). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -181,14 +185,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow "Unknown Field")) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow "Unknown Field")) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -203,14 +208,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow "Unknown Field")) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow "Unknown Field")) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -233,14 +239,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow tuple_of_tuples)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow tuple_of_tuples)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -256,14 +262,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow pair)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow pair)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -280,14 +286,14 @@ Definition main : M unit := let* α6 : bool.t * i32.t := M.call (tuples.reverse α5) in let* α7 : M.Val (bool.t * i32.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -302,14 +308,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val u32.t := M.alloc ((Integer.of_Z 5) : u32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -324,14 +330,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val u32.t := M.alloc ((Integer.of_Z 5) : u32.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -372,13 +378,13 @@ Definition main : M unit := let* α7 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow a)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow a)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow b)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow b)) in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow c)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow c)) in let* α11 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow d)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow d)) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α9; α10; α11 ] in let* α13 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -386,7 +392,7 @@ Definition main : M unit := let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α7 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α7 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -408,7 +414,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow matrix)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow matrix)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -416,7 +422,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing.v index 3f3c527fb..b93ceba6a 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing.v @@ -20,14 +20,14 @@ Definition eat_box_i32 let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow boxed_i32)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow boxed_i32)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -52,14 +52,14 @@ Definition borrow_i32 (borrowed_i32 : ref i32.t) : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow borrowed_i32)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow borrowed_i32)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -100,7 +100,7 @@ Definition main : M unit := let* boxed_i32 : M.Val (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 5) : i32.t)) in M.alloc α0 in let* stacked_i32 : M.Val i32.t := M.alloc ((Integer.of_Z 6) : i32.t) in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_aliasing.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_aliasing.v index 4f31354e8..26319610b 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_aliasing.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_aliasing.v @@ -103,19 +103,19 @@ Definition main : M unit := M.read borrowed_point in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_x (deref α7)))) in let* α9 : ref scoping_rules_borrowing_aliasing.Point.t := M.read another_borrow in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_y (deref α9)))) in let* α11 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_z point))) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α10; α11 ] in @@ -124,7 +124,7 @@ Definition main : M unit := let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -143,19 +143,19 @@ Definition main : M unit := M.read borrowed_point in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_x (deref α7)))) in let* α9 : ref scoping_rules_borrowing_aliasing.Point.t := M.read another_borrow in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_y (deref α9)))) in let* α11 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_z point))) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α10; α11 ] in @@ -164,7 +164,7 @@ Definition main : M unit := let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in @@ -204,21 +204,21 @@ Definition main : M unit := M.read mutable_borrow in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_x (deref α7)))) in let* α9 : mut_ref scoping_rules_borrowing_aliasing.Point.t := M.read mutable_borrow in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_y (deref α9)))) in let* α11 : mut_ref scoping_rules_borrowing_aliasing.Point.t := M.read mutable_borrow in let* α12 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_z (deref α11)))) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := @@ -228,7 +228,7 @@ Definition main : M unit := let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in @@ -250,21 +250,21 @@ Definition main : M unit := M.read new_borrowed_point in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_x (deref α7)))) in let* α9 : ref scoping_rules_borrowing_aliasing.Point.t := M.read new_borrowed_point in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_y (deref α9)))) in let* α11 : ref scoping_rules_borrowing_aliasing.Point.t := M.read new_borrowed_point in let* α12 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_aliasing.Point.Get_z (deref α11)))) in let* α13 : M.Val (array core.fmt.rt.Argument.t) := @@ -274,7 +274,7 @@ Definition main : M unit := let* α15 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α14) in let* α16 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α15) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α15) in let* α17 : unit := M.call (std.io.stdio._print α16) in M.alloc α17 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_mutablity.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_mutablity.v index 790f8f22e..85b9297e4 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_mutablity.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_mutablity.v @@ -59,10 +59,7 @@ Section Impl_core_clone_Clone_for_scoping_rules_borrowing_mutablity_Book_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -105,13 +102,13 @@ Definition borrow_book let* α6 : ref scoping_rules_borrowing_mutablity.Book.t := M.read book in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_mutablity.Book.Get_title (deref α6)))) in let* α8 : ref scoping_rules_borrowing_mutablity.Book.t := M.read book in let* α9 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_mutablity.Book.Get_year (deref α8)))) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α9 ] in @@ -120,7 +117,7 @@ Definition borrow_book let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -156,14 +153,14 @@ Definition new_edition M.read book in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_mutablity.Book.Get_title (deref α6)))) in let* α8 : mut_ref scoping_rules_borrowing_mutablity.Book.t := M.read book in let* α9 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_mutablity.Book.Get_year (deref α8)))) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α9 ] in @@ -172,7 +169,7 @@ Definition new_edition let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v index 81fa80b0b..e526cbf1c 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v @@ -39,10 +39,7 @@ Section Impl_core_clone_Clone_for_scoping_rules_borrowing_the_ref_pattern_Point_ ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -143,7 +140,8 @@ Definition main : M unit := let* α8 : char.t := M.read (deref α7) in let* α9 : M.Val bool.t := M.alloc (BinOp.Pure.eq α6 α8) in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α9)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -151,7 +149,7 @@ Definition main : M unit := let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in M.alloc tt in @@ -229,13 +227,13 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_the_ref_pattern.Point.Get_x point))) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_the_ref_pattern.Point.Get_y point))) in @@ -246,7 +244,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -263,13 +261,13 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_the_ref_pattern.Point.Get_x mutable_point))) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_borrowing_the_ref_pattern.Point.Get_y mutable_point))) in @@ -280,7 +278,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -288,7 +286,7 @@ Definition main : M unit := M.Val ((alloc.boxed.Box.t u32.t alloc.alloc.Global.t) * u32.t) := let* α0 : alloc.boxed.Box.t u32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t u32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t u32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 5) : u32.t)) in M.alloc (α0, (Integer.of_Z 3) : u32.t) in let* _ : M.Val unit := @@ -321,7 +319,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow mutable_tuple)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -330,7 +328,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes.v index e78d8f2d8..df748c7e5 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes.v @@ -37,14 +37,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow borrow1)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow borrow1)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -60,14 +60,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow borrow2)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow borrow2)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_bounds.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_bounds.v index 7b727f2ed..d4389f801 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_bounds.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_bounds.v @@ -38,11 +38,9 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_bounds_Ref_t_T. M.alloc (borrow (scoping_rules_lifetimes_bounds.Ref.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref (ref T))) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -70,14 +68,14 @@ Definition print {T : Set} {ℋ_0 : core.fmt.Debug.Trait T} (t : T) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -108,14 +106,14 @@ Definition print_ref let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow t)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow t)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_coercion.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_coercion.v index 70e3b42f6..c3ddbc99f 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_coercion.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_coercion.v @@ -62,14 +62,14 @@ Definition main : M unit := (borrow second)) in let* α6 : M.Val i32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -89,14 +89,14 @@ Definition main : M unit := (borrow second)) in let* α6 : M.Val (ref i32.t) := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_elision.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_elision.v index 080c54861..b633da07a 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_elision.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_elision.v @@ -18,14 +18,14 @@ Definition elided_input (x : ref i32.t) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow x)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -49,14 +49,14 @@ Definition annotated_input (x : ref i32.t) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow x)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -116,14 +116,14 @@ Definition main : M unit := M.call (scoping_rules_lifetimes_elision.elided_pass (borrow x)) in let* α6 : M.Val (ref i32.t) := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -140,14 +140,14 @@ Definition main : M unit := M.call (scoping_rules_lifetimes_elision.annotated_pass (borrow x)) in let* α6 : M.Val (ref i32.t) := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_functions.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_functions.v index 6748abee1..f732e85cc 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_functions.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_functions.v @@ -18,14 +18,14 @@ Definition print_one (x : ref i32.t) : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow x)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -68,16 +68,16 @@ Definition print_multi (x : ref i32.t) (y : ref i32.t) : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow x)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow y)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_methods.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_methods.v index 2be86688a..7adfaba3c 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_methods.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_methods.v @@ -34,10 +34,7 @@ Section Impl_scoping_rules_lifetimes_methods_Owner_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_add_one : - Notations.DoubleColon Self "add_one" := { - Notations.double_colon := add_one; - }. + Axiom add_one_is_impl : impl Self "add_one" = add_one. (* fn print<'a>(&'a self) { @@ -58,7 +55,7 @@ Section Impl_scoping_rules_lifetimes_methods_Owner_t. let* α5 : ref scoping_rules_lifetimes_methods.Owner.t := M.read self in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_lifetimes_methods.Owner.Get_0 (deref α5)))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in @@ -67,17 +64,14 @@ Section Impl_scoping_rules_lifetimes_methods_Owner_t. let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_print : - Notations.DoubleColon Self "print" := { - Notations.double_colon := print; - }. + Axiom print_is_impl : impl Self "print" = print. End Impl_scoping_rules_lifetimes_methods_Owner_t. End Impl_scoping_rules_lifetimes_methods_Owner_t. @@ -98,13 +92,13 @@ Definition main : M unit := let* _ : M.Val unit := let* α0 : unit := M.call - (scoping_rules_lifetimes_methods.Owner.t::["add_one"] + (impl scoping_rules_lifetimes_methods.Owner.t "add_one" (borrow_mut owner)) in M.alloc α0 in let* _ : M.Val unit := let* α0 : unit := M.call - (scoping_rules_lifetimes_methods.Owner.t::["print"] (borrow owner)) in + (impl scoping_rules_lifetimes_methods.Owner.t "print" (borrow owner)) in M.alloc α0 in let* α0 : M.Val unit := M.alloc tt in M.read α0. diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v index cac2b7432..f5da9cedc 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v @@ -55,14 +55,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow static_string)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow static_string)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -86,14 +87,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow coerced_static)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow coerced_static)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -110,14 +112,14 @@ Definition main : M unit := let* α5 : ref i32.t := M.read scoping_rules_lifetimes_reference_lifetime_static.NUM in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] α5) in + M.call (impl core.fmt.rt.Argument.t "new_display" α5) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_structs.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_structs.v index b0c138b41..86922cabc 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_structs.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_structs.v @@ -33,11 +33,9 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_Borrowed_t. (borrow (scoping_rules_lifetimes_structs.Borrowed.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref (ref i32.t))) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -92,11 +90,15 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_NamedBorrowed_t. let* α9 : M.Val (ref (ref (ref i32.t))) := M.alloc (borrow α8) in let* α10 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α9) in M.call - (core.fmt.Formatter.t::["debug_struct_field2_finish"] α0 α1 α2 α5 α6 α10). + (impl core.fmt.Formatter.t "debug_struct_field2_finish" + α0 + α1 + α2 + α5 + α6 + α10). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -153,7 +155,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_Either_t. M.read (pointer_coercion "Unsize" α2) in let* α4 : core.result.Result.t unit core.fmt.Error.t := M.call - (core.fmt.Formatter.t::["debug_tuple_field1_finish"] + (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α3) in @@ -178,7 +180,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_Either_t. M.read (pointer_coercion "Unsize" α2) in let* α4 : core.result.Result.t unit core.fmt.Error.t := M.call - (core.fmt.Formatter.t::["debug_tuple_field1_finish"] + (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α3) in @@ -189,9 +191,7 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_Either_t. ] in M.read α0. - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -242,14 +242,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow single)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow single)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -263,14 +263,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow double)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow double)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -284,14 +284,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow reference)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow reference)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -305,14 +305,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow number)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow number)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_traits.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_traits.v index 3cbf29f9d..b593d1b21 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_traits.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_lifetimes_traits.v @@ -34,11 +34,9 @@ Section Impl_core_fmt_Debug_for_scoping_rules_lifetimes_traits_Borrowed_t. (borrow (scoping_rules_lifetimes_traits.Borrowed.Get_x (deref α3))) in let* α5 : M.Val (ref (ref (ref i32.t))) := M.alloc (borrow α4) in let* α6 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α5) in - M.call (core.fmt.Formatter.t::["debug_struct_field1_finish"] α0 α1 α2 α6). + M.call (impl core.fmt.Formatter.t "debug_struct_field1_finish" α0 α1 α2 α6). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -59,10 +57,7 @@ Section Impl_core_default_Default_for_scoping_rules_lifetimes_traits_Borrowed_t. let* α0 : M.Val i32.t := M.alloc ((Integer.of_Z 10) : i32.t) in M.pure {| scoping_rules_lifetimes_traits.Borrowed.x := borrow α0; |}. - Global Instance AssociatedFunction_default : - Notations.DoubleColon Self "default" := { - Notations.double_colon := default; - }. + Axiom default_is_impl : impl Self "default" = default. Global Instance ℐ : core.default.Default.Trait Self := { core.default.Default.default := default; @@ -96,14 +91,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow b)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow b)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules.v index 94b5529f6..0fcf29896 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules.v @@ -23,14 +23,14 @@ Definition destroy_box let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow c)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow c)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -89,23 +89,23 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow x)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow y)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow y)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in let* a : M.Val (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 5) : i32.t)) in M.alloc α0 in let* _ : M.Val unit := @@ -118,14 +118,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow a)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow a)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v index a38dd9194..df528911c 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v @@ -26,7 +26,7 @@ Definition main : M unit := let* immutable_box : M.Val (alloc.boxed.Box.t u32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t u32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t u32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t u32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 5) : u32.t)) in M.alloc α0 in let* _ : M.Val unit := @@ -40,14 +40,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow immutable_box)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow immutable_box)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -63,14 +63,15 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow mutable_box)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow mutable_box)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -88,14 +89,15 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow mutable_box)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow mutable_box)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v index c87f44784..eb352998d 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v @@ -42,7 +42,7 @@ Definition main : M unit := let* α2 : alloc.string.String.t := M.call (α0 α1) in let* α3 : alloc.boxed.Box.t u8.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t u8.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t u8.t alloc.alloc.Global.t) "new" ((Integer.of_Z 20) : u8.t)) in M.alloc {| @@ -86,7 +86,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow age)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow age)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -94,7 +94,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -111,7 +111,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow name)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow name)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -119,7 +119,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -136,7 +136,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (scoping_rules_ownership_and_rules_partial_moves.main.Person.Get_age person))) in @@ -147,7 +147,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -210,11 +210,15 @@ Section Impl_core_fmt_Debug_for_scoping_rules_ownership_and_rules_partial_moves_ M.alloc (borrow α8) in let* α10 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α9) in M.call - (core.fmt.Formatter.t::["debug_struct_field2_finish"] α0 α1 α2 α5 α6 α10). + (impl core.fmt.Formatter.t "debug_struct_field2_finish" + α0 + α1 + α2 + α5 + α6 + α10). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii.v index 8b80b5af9..f3633da60 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii.v @@ -13,7 +13,7 @@ Definition create_box : M unit := let* _box1 : M.Val (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 3) : i32.t)) in M.alloc α0 in let* α0 : M.Val unit := M.alloc tt in @@ -46,14 +46,14 @@ Definition main : M unit := let* _box2 : M.Val (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 5) : i32.t)) in M.alloc α0 in let* _ : M.Val unit := let* _box3 : M.Val (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 4) : i32.t)) in M.alloc α0 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii_desctructor.v b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii_desctructor.v index e9f5b8b79..e0a67accd 100644 --- a/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii_desctructor.v +++ b/CoqOfRust/examples/default/examples/scoping_rules/scoping_rules_raii_desctructor.v @@ -27,17 +27,14 @@ Section Impl_core_ops_drop_Drop_for_scoping_rules_raii_desctructor_ToDrop_t. let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_drop : - Notations.DoubleColon Self "drop" := { - Notations.double_colon := drop; - }. + Axiom drop_is_impl : impl Self "drop" = drop. Global Instance ℐ : core.ops.drop.Drop.Trait Self := { core.ops.drop.Drop.drop := drop; @@ -64,7 +61,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/arc.v b/CoqOfRust/examples/default/examples/std_library_types/arc.v index 423a44ff1..49aa3ae7e 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/arc.v +++ b/CoqOfRust/examples/default/examples/std_library_types/arc.v @@ -28,7 +28,7 @@ Definition main : M unit := let* α0 : ref str.t := M.read (mk_str "the same apple") in let* α1 : alloc.sync.Arc.t (ref str.t) alloc.alloc.Global.t := M.call - ((alloc.sync.Arc.t (ref str.t) alloc.alloc.Global.t)::["new"] α0) in + (impl (alloc.sync.Arc.t (ref str.t) alloc.alloc.Global.t) "new" α0) in M.alloc α1 in let* _ : M.Val unit := let* α0 : _ := @@ -116,7 +116,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow apple)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := @@ -131,7 +131,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := @@ -153,7 +153,8 @@ Definition main : M unit := M.pure (use α3) in let* _ : M.Val unit := let* α0 : core.time.Duration.t := - M.call (core.time.Duration.t::["from_secs"] ((Integer.of_Z 1) : u64.t)) in + M.call + (impl core.time.Duration.t "from_secs" ((Integer.of_Z 1) : u64.t)) in let* α1 : unit := M.call (std.thread.sleep α0) in M.alloc α1 in let* α0 : M.Val unit := M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/box_stack_heap.v b/CoqOfRust/examples/default/examples/std_library_types/box_stack_heap.v index 8a5737c86..1eb2bce5d 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/box_stack_heap.v +++ b/CoqOfRust/examples/default/examples/std_library_types/box_stack_heap.v @@ -44,11 +44,15 @@ Section Impl_core_fmt_Debug_for_box_stack_heap_Point_t. let* α9 : M.Val (ref (ref f64.t)) := M.alloc (borrow α8) in let* α10 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α9) in M.call - (core.fmt.Formatter.t::["debug_struct_field2_finish"] α0 α1 α2 α5 α6 α10). + (impl core.fmt.Formatter.t "debug_struct_field2_finish" + α0 + α1 + α2 + α5 + α6 + α10). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -78,10 +82,7 @@ Section Impl_core_clone_Clone_for_box_stack_heap_Point_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -139,7 +140,7 @@ Definition boxed_origin let* α0 : f64.t := M.read (UnsupportedLiteral : M.Val f64.t) in let* α1 : f64.t := M.read (UnsupportedLiteral : M.Val f64.t) in M.call - ((alloc.boxed.Box.t box_stack_heap.Point.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t box_stack_heap.Point.t alloc.alloc.Global.t) "new" {| box_stack_heap.Point.x := α0; box_stack_heap.Point.y := α1; |}). (* @@ -219,9 +220,9 @@ Definition main : M unit := let* α3 : alloc.boxed.Box.t box_stack_heap.Rectangle.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t - box_stack_heap.Rectangle.t - alloc.alloc.Global.t)::["new"] + (impl + (alloc.boxed.Box.t box_stack_heap.Rectangle.t alloc.alloc.Global.t) + "new" {| box_stack_heap.Rectangle.top_left := α0; box_stack_heap.Rectangle.bottom_right := @@ -233,9 +234,9 @@ Definition main : M unit := let* α0 : box_stack_heap.Point.t := M.call box_stack_heap.origin in let* α1 : alloc.boxed.Box.t box_stack_heap.Point.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t - box_stack_heap.Point.t - alloc.alloc.Global.t)::["new"] + (impl + (alloc.boxed.Box.t box_stack_heap.Point.t alloc.alloc.Global.t) + "new" α0) in M.alloc α1 in let* box_in_a_box : @@ -250,9 +251,11 @@ Definition main : M unit := (alloc.boxed.Box.t box_stack_heap.Point.t alloc.alloc.Global.t) alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t + (impl + (alloc.boxed.Box.t (alloc.boxed.Box.t box_stack_heap.Point.t alloc.alloc.Global.t) - alloc.alloc.Global.t)::["new"] + alloc.alloc.Global.t) + "new" α0) in M.alloc α1 in let* _ : M.Val unit := @@ -267,14 +270,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow point)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -290,14 +293,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow rectangle)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -313,14 +316,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow boxed_point)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -337,14 +340,14 @@ Definition main : M unit := M.call (core.mem.size_of_val (borrow boxed_rectangle)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -361,14 +364,14 @@ Definition main : M unit := M.call (core.mem.size_of_val (borrow box_in_a_box)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -389,14 +392,14 @@ Definition main : M unit := M.call (core.mem.size_of_val (borrow unboxed_point)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/hash_map.v b/CoqOfRust/examples/default/examples/std_library_types/hash_map.v index 33a61071d..75bd513b4 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/hash_map.v +++ b/CoqOfRust/examples/default/examples/std_library_types/hash_map.v @@ -92,20 +92,24 @@ Definition main : M unit := (ref str.t) std.hash.random.RandomState.t := M.call - (std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["new"] in + std.hash.random.RandomState.t) + "new") in M.alloc α0 in let* _ : M.Val (core.option.Option.t (ref str.t)) := let* α0 : ref str.t := M.read (mk_str "Daniel") in let* α1 : ref str.t := M.read (mk_str "798-1364") in let* α2 : core.option.Option.t (ref str.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut contacts) α0 α1) in @@ -115,10 +119,12 @@ Definition main : M unit := let* α1 : ref str.t := M.read (mk_str "645-7689") in let* α2 : core.option.Option.t (ref str.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut contacts) α0 α1) in @@ -128,10 +134,12 @@ Definition main : M unit := let* α1 : ref str.t := M.read (mk_str "435-8291") in let* α2 : core.option.Option.t (ref str.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut contacts) α0 α1) in @@ -141,10 +149,12 @@ Definition main : M unit := let* α1 : ref str.t := M.read (mk_str "956-1745") in let* α2 : core.option.Option.t (ref str.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut contacts) α0 α1) in @@ -152,10 +162,12 @@ Definition main : M unit := let* _ : M.Val unit := let* α0 : core.option.Option.t (ref (ref str.t)) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["get"] + std.hash.random.RandomState.t) + "get" (borrow contacts) (borrow (mk_str "Daniel"))) in let* α1 : M.Val (core.option.Option.t (ref (ref str.t))) := M.alloc α0 in @@ -184,7 +196,8 @@ Definition main : M unit := let* α6 : ref str.t := M.call (hash_map.call α5) in let* α7 : M.Val (ref str.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -192,7 +205,7 @@ Definition main : M unit := let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt @@ -209,7 +222,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -220,10 +233,12 @@ Definition main : M unit := let* α1 : ref str.t := M.read (mk_str "164-6743") in let* α2 : core.option.Option.t (ref str.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut contacts) α0 α1) in @@ -231,10 +246,12 @@ Definition main : M unit := let* _ : M.Val unit := let* α0 : core.option.Option.t (ref (ref str.t)) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["get"] + std.hash.random.RandomState.t) + "get" (borrow contacts) (borrow (mk_str "Ashley"))) in let* α1 : M.Val (core.option.Option.t (ref (ref str.t))) := M.alloc α0 in @@ -263,7 +280,8 @@ Definition main : M unit := let* α6 : ref str.t := M.call (hash_map.call α5) in let* α7 : M.Val (ref str.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -271,7 +289,7 @@ Definition main : M unit := let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt @@ -288,7 +306,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -297,10 +315,12 @@ Definition main : M unit := let* _ : M.Val (core.option.Option.t (ref str.t)) := let* α0 : core.option.Option.t (ref str.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["remove"] + std.hash.random.RandomState.t) + "remove" (borrow_mut contacts) (borrow (mk_str "Ashley"))) in M.alloc α0 in @@ -311,10 +331,12 @@ Definition main : M unit := (Trait := ℐ))) in let* α1 : std.collections.hash.map.Iter.t (ref str.t) (ref str.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t (ref str.t) (ref str.t) - std.hash.random.RandomState.t)::["iter"] + std.hash.random.RandomState.t) + "iter" (borrow contacts)) in let* α2 : std.collections.hash.map.Iter.t (ref str.t) (ref str.t) := M.call (α0 α1) in @@ -386,14 +408,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow contact)) in let* α7 : ref str.t := M.read number in let* α8 : ref str.t := M.call (hash_map.call α7) in let* α9 : M.Val (ref str.t) := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α10 ] in @@ -404,7 +426,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α5 α13) in + (impl core.fmt.Arguments.t "new_v1" α5 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in diff --git a/CoqOfRust/examples/default/examples/std_library_types/hash_map_alternate_or_custom_key_types.v b/CoqOfRust/examples/default/examples/std_library_types/hash_map_alternate_or_custom_key_types.v index 9ef32ad90..85ecd0bab 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/hash_map_alternate_or_custom_key_types.v +++ b/CoqOfRust/examples/default/examples/std_library_types/hash_map_alternate_or_custom_key_types.v @@ -81,9 +81,7 @@ Section Impl_core_cmp_PartialEq_for_hash_map_alternate_or_custom_key_types_Accou (deref α6)))) in M.pure (BinOp.Pure.and α3 α7). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -126,10 +124,8 @@ Section Impl_core_cmp_Eq_for_hash_map_alternate_or_custom_key_types_Account_t. ] in M.read α0. - Global Instance AssociatedFunction_assert_receiver_is_total_eq : - Notations.DoubleColon Self "assert_receiver_is_total_eq" := { - Notations.double_colon := assert_receiver_is_total_eq; - }. + Axiom assert_receiver_is_total_eq_is_impl : + impl Self "assert_receiver_is_total_eq" = assert_receiver_is_total_eq. Global Instance ℐ : core.cmp.Eq.Required.Trait Self := { core.cmp.Eq.assert_receiver_is_total_eq := @@ -184,12 +180,7 @@ Section Impl_core_hash_Hash_for_hash_map_alternate_or_custom_key_types_Account_t let* α0 : M.Val unit := M.alloc α3 in M.read α0. - Global Instance AssociatedFunction_hash - {__H : Set} - {ℋ_0 : core.hash.Hasher.Trait __H} : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash (__H := __H); - }. + Axiom hash_is_impl : forall {__H : Set}, impl Self "hash" = hash (__H := __H). Global Instance ℐ : core.hash.Hash.Required.Trait Self := { core.hash.Hash.hash {__H : Set} {ℋ_0 : core.hash.Hasher.Trait __H} := @@ -256,14 +247,14 @@ Definition try_logon let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow username)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow username)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -277,14 +268,14 @@ Definition try_logon let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow password)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow password)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -297,7 +288,7 @@ Definition try_logon let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -320,10 +311,12 @@ Definition try_logon core.option.Option.t (ref hash_map_alternate_or_custom_key_types.AccountInfo.t) := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t hash_map_alternate_or_custom_key_types.Account.t hash_map_alternate_or_custom_key_types.AccountInfo.t - std.hash.random.RandomState.t)::["get"] + std.hash.random.RandomState.t) + "get" α0 (borrow logon)) in let* α2 : @@ -351,7 +344,7 @@ Definition try_logon let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -370,7 +363,7 @@ Definition try_logon M.read account_info in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (hash_map_alternate_or_custom_key_types.AccountInfo.Get_name (deref α5)))) in @@ -381,7 +374,7 @@ Definition try_logon let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -400,7 +393,7 @@ Definition try_logon M.read account_info in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (hash_map_alternate_or_custom_key_types.AccountInfo.Get_email (deref α5)))) in @@ -411,7 +404,7 @@ Definition try_logon let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -428,7 +421,7 @@ Definition try_logon let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -471,10 +464,12 @@ Definition main : M unit := hash_map_alternate_or_custom_key_types.AccountInfo.t std.hash.random.RandomState.t := M.call - (std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t hash_map_alternate_or_custom_key_types.Account.t hash_map_alternate_or_custom_key_types.AccountInfo.t - std.hash.random.RandomState.t)::["new"] in + std.hash.random.RandomState.t) + "new") in M.alloc α0 in let* account : M.Val hash_map_alternate_or_custom_key_types.Account.t := let* α0 : ref str.t := M.read (mk_str "j.everyman") in @@ -505,10 +500,12 @@ Definition main : M unit := core.option.Option.t hash_map_alternate_or_custom_key_types.AccountInfo.t := M.call - ((std.collections.hash.map.HashMap.t + (impl + (std.collections.hash.map.HashMap.t hash_map_alternate_or_custom_key_types.Account.t hash_map_alternate_or_custom_key_types.AccountInfo.t - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut accounts) α0 α1) in diff --git a/CoqOfRust/examples/default/examples/std_library_types/hash_map_hash_set.v b/CoqOfRust/examples/default/examples/std_library_types/hash_map_hash_set.v index d800dde5b..6ef924f61 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/hash_map_hash_set.v +++ b/CoqOfRust/examples/default/examples/std_library_types/hash_map_hash_set.v @@ -74,7 +74,7 @@ Definition main : M unit := let* α4 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α3) in let* α5 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α4) in + M.call (impl (slice i32.t) "into_vec" α4) in let* α6 : alloc.vec.into_iter.IntoIter.t i32.t alloc.alloc.Global.t := M.call (α1 α5) in let* α7 : @@ -114,7 +114,7 @@ Definition main : M unit := let* α4 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α3) in let* α5 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α4) in + M.call (impl (slice i32.t) "into_vec" α4) in let* α6 : alloc.vec.into_iter.IntoIter.t i32.t alloc.alloc.Global.t := M.call (α1 α5) in let* α7 : @@ -126,9 +126,11 @@ Definition main : M unit := let* _ : M.Val unit := let* α0 : bool.t := M.call - ((std.collections.hash.set.HashSet.t + (impl + (std.collections.hash.set.HashSet.t i32.t - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut a) ((Integer.of_Z 4) : i32.t)) in let* α1 : M.Val bool.t := M.alloc (UnOp.not α0) in @@ -144,9 +146,11 @@ Definition main : M unit := let* α0 : M.Val i32.t := M.alloc ((Integer.of_Z 4) : i32.t) in let* α1 : bool.t := M.call - ((std.collections.hash.set.HashSet.t + (impl + (std.collections.hash.set.HashSet.t i32.t - std.hash.random.RandomState.t)::["contains"] + std.hash.random.RandomState.t) + "contains" (borrow a) (borrow α0)) in let* α2 : M.Val bool.t := M.alloc (UnOp.not α1) in @@ -162,9 +166,11 @@ Definition main : M unit := let* _ : M.Val bool.t := let* α0 : bool.t := M.call - ((std.collections.hash.set.HashSet.t + (impl + (std.collections.hash.set.HashSet.t i32.t - std.hash.random.RandomState.t)::["insert"] + std.hash.random.RandomState.t) + "insert" (borrow_mut b) ((Integer.of_Z 5) : i32.t)) in M.alloc α0 in @@ -178,14 +184,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow a)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow a)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -199,14 +205,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow b)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow b)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -233,9 +239,11 @@ Definition main : M unit := i32.t std.hash.random.RandomState.t := M.call - ((std.collections.hash.set.HashSet.t + (impl + (std.collections.hash.set.HashSet.t i32.t - std.hash.random.RandomState.t)::["union"] + std.hash.random.RandomState.t) + "union" (borrow a) (borrow b)) in let* α7 : alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t := @@ -243,14 +251,14 @@ Definition main : M unit := let* α8 : M.Val (alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t) := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -277,9 +285,11 @@ Definition main : M unit := i32.t std.hash.random.RandomState.t := M.call - ((std.collections.hash.set.HashSet.t + (impl + (std.collections.hash.set.HashSet.t i32.t - std.hash.random.RandomState.t)::["difference"] + std.hash.random.RandomState.t) + "difference" (borrow a) (borrow b)) in let* α7 : alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t := @@ -287,14 +297,14 @@ Definition main : M unit := let* α8 : M.Val (alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t) := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -321,9 +331,11 @@ Definition main : M unit := i32.t std.hash.random.RandomState.t := M.call - ((std.collections.hash.set.HashSet.t + (impl + (std.collections.hash.set.HashSet.t i32.t - std.hash.random.RandomState.t)::["intersection"] + std.hash.random.RandomState.t) + "intersection" (borrow a) (borrow b)) in let* α7 : alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t := @@ -331,14 +343,14 @@ Definition main : M unit := let* α8 : M.Val (alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t) := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -365,9 +377,11 @@ Definition main : M unit := i32.t std.hash.random.RandomState.t := M.call - ((std.collections.hash.set.HashSet.t + (impl + (std.collections.hash.set.HashSet.t i32.t - std.hash.random.RandomState.t)::["symmetric_difference"] + std.hash.random.RandomState.t) + "symmetric_difference" (borrow a) (borrow b)) in let* α7 : alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t := @@ -375,14 +389,14 @@ Definition main : M unit := let* α8 : M.Val (alloc.vec.Vec.t (ref i32.t) alloc.alloc.Global.t) := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/option.v b/CoqOfRust/examples/default/examples/std_library_types/option.v index 0d41e3e1a..f5249d8aa 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/option.v +++ b/CoqOfRust/examples/default/examples/std_library_types/option.v @@ -71,10 +71,12 @@ Definition try_division (dividend : i32.t) (divisor : i32.t) : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow dividend)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow dividend)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow divisor)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow divisor)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -82,7 +84,7 @@ Definition try_division (dividend : i32.t) (divisor : i32.t) : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -109,13 +111,16 @@ Definition try_division (dividend : i32.t) (divisor : i32.t) : M unit := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow dividend)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow dividend)) in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow divisor)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow divisor)) in let* α9 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow quotient)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow quotient)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -123,7 +128,7 @@ Definition try_division (dividend : i32.t) (divisor : i32.t) : M unit := let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt @@ -190,19 +195,20 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow optional_float)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow optional_float)) in let* α7 : core.option.Option.t f32.t := M.read optional_float in - let* α8 : f32.t := M.call ((core.option.Option.t f32.t)::["unwrap"] α7) in + let* α8 : f32.t := + M.call (impl (core.option.Option.t f32.t) "unwrap" α7) in let* α9 : M.Val f32.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α11) in let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in M.alloc tt in @@ -217,19 +223,20 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow none)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow none)) in let* α7 : core.option.Option.t i32.t := M.read none in - let* α8 : i32.t := M.call ((core.option.Option.t i32.t)::["unwrap"] α7) in + let* α8 : i32.t := + M.call (impl (core.option.Option.t i32.t) "unwrap" α7) in let* α9 : M.Val i32.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α11) in let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/panic.v b/CoqOfRust/examples/default/examples/std_library_types/panic.v index 158d1279a..c5449e968 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/panic.v +++ b/CoqOfRust/examples/default/examples/std_library_types/panic.v @@ -49,7 +49,7 @@ Definition main : M unit := let* _x : M.Val (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 0) : i32.t)) in M.alloc α0 in let* _ : M.Val i32.t := @@ -68,7 +68,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/rc.v b/CoqOfRust/examples/default/examples/std_library_types/rc.v index 94ec05aa5..eaa8a2e7b 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/rc.v +++ b/CoqOfRust/examples/default/examples/std_library_types/rc.v @@ -56,7 +56,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -65,7 +65,7 @@ Definition main : M unit := let* α0 : alloc.string.String.t := M.read rc_examples in let* α1 : alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t := M.call - ((alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t)::["new"] + (impl (alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t) "new" α0) in M.alloc α1 in let* _ : M.Val unit := @@ -79,20 +79,20 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : usize.t := M.call - ((alloc.rc.Rc.t - alloc.string.String.t - alloc.alloc.Global.t)::["strong_count"] + (impl + (alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t) + "strong_count" (borrow rc_a)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -107,7 +107,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -132,20 +132,20 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : usize.t := M.call - ((alloc.rc.Rc.t - alloc.string.String.t - alloc.alloc.Global.t)::["strong_count"] + (impl + (alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t) + "strong_count" (borrow rc_b)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -160,20 +160,20 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : usize.t := M.call - ((alloc.rc.Rc.t - alloc.string.String.t - alloc.alloc.Global.t)::["strong_count"] + (impl + (alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t) + "strong_count" (borrow rc_a)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -195,14 +195,14 @@ Definition main : M unit := let* α6 : bool.t := M.call (α5 (borrow rc_a) (borrow rc_b)) in let* α7 : M.Val bool.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -222,17 +222,17 @@ Definition main : M unit := (Self := alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t) (Trait := ℐ))) in let* α6 : ref alloc.string.String.t := M.call (α5 (borrow rc_a)) in - let* α7 : usize.t := M.call (alloc.string.String.t::["len"] α6) in + let* α7 : usize.t := M.call (impl alloc.string.String.t "len" α6) in let* α8 : M.Val usize.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -246,14 +246,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow rc_b)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow rc_b)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -267,7 +267,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -283,20 +283,20 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : usize.t := M.call - ((alloc.rc.Rc.t - alloc.string.String.t - alloc.alloc.Global.t)::["strong_count"] + (impl + (alloc.rc.Rc.t alloc.string.String.t alloc.alloc.Global.t) + "strong_count" (borrow rc_a)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -310,7 +310,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/result.v b/CoqOfRust/examples/default/examples/std_library_types/result.v index c1d9b7aa9..aff249647 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/result.v +++ b/CoqOfRust/examples/default/examples/std_library_types/result.v @@ -65,12 +65,9 @@ Module checked. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : - Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -131,7 +128,7 @@ Module checked. (core.result.Result.Err result.checked.MathError.NegativeSquareRoot) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["sqrt"] α0) in + let* α1 : f64.t := M.call (impl f64.t "sqrt" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. @@ -156,7 +153,7 @@ Module checked. (core.result.Result.Err result.checked.MathError.NonPositiveLogarithm) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["ln"] α0) in + let* α1 : f64.t := M.call (impl f64.t "ln" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. End checked. @@ -224,11 +221,9 @@ Section Impl_core_fmt_Debug_for_result_checked_MathError_t. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -289,7 +284,7 @@ Definition sqrt (x : f64.t) : M ltac:(result.checked.MathResult) := (core.result.Result.Err result.checked.MathError.NegativeSquareRoot) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["sqrt"] α0) in + let* α1 : f64.t := M.call (impl f64.t "sqrt" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. @@ -314,7 +309,7 @@ Definition ln (x : f64.t) : M ltac:(result.checked.MathResult) := (core.result.Result.Err result.checked.MathError.NonPositiveLogarithm) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["ln"] α0) in + let* α1 : f64.t := M.call (impl f64.t "ln" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. @@ -358,14 +353,14 @@ Definition op (x : f64.t) (y : f64.t) : M f64.t := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow why)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow why)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in let* α10 : f64.t := never_to_any α9 in M.alloc α10 @@ -401,7 +396,8 @@ Definition op (x : f64.t) (y : f64.t) : M f64.t := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow why)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow why)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -409,7 +405,7 @@ Definition op (x : f64.t) (y : f64.t) : M f64.t := let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in let* α10 : f64.t := never_to_any α9 in M.alloc α10 @@ -450,7 +446,7 @@ Definition op (x : f64.t) (y : f64.t) : M f64.t := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow why)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in @@ -460,7 +456,8 @@ Definition op (x : f64.t) (y : f64.t) : M f64.t := let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call + (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in let* α10 : f64.t := never_to_any α9 in @@ -511,14 +508,14 @@ Definition main : M unit := let* α7 : f64.t := M.call (result.op α5 α6) in let* α8 : M.Val f64.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/result_chaining_with_question_mark.v b/CoqOfRust/examples/default/examples/std_library_types/result_chaining_with_question_mark.v index e2e446dcc..b5efe67f2 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/result_chaining_with_question_mark.v +++ b/CoqOfRust/examples/default/examples/std_library_types/result_chaining_with_question_mark.v @@ -72,12 +72,9 @@ Module checked. M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : - Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -154,7 +151,7 @@ Module checked. result_chaining_with_question_mark.checked.MathError.NegativeSquareRoot) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["sqrt"] α0) in + let* α1 : f64.t := M.call (impl f64.t "sqrt" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. @@ -186,7 +183,7 @@ Module checked. result_chaining_with_question_mark.checked.MathError.NonPositiveLogarithm) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["ln"] α0) in + let* α1 : f64.t := M.call (impl f64.t "ln" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. @@ -494,7 +491,8 @@ Module checked. M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow value)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow value)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -502,7 +500,7 @@ Module checked. let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -583,11 +581,9 @@ Section Impl_core_fmt_Debug_for_result_chaining_with_question_mark_checked_MathE M (M.Val (ref str.t)) ] in let* α2 : ref str.t := M.read α1 in - M.call (core.fmt.Formatter.t::["write_str"] α0 α2). + M.call (impl core.fmt.Formatter.t "write_str" α0 α2). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -664,7 +660,7 @@ Definition sqrt result_chaining_with_question_mark.checked.MathError.NegativeSquareRoot) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["sqrt"] α0) in + let* α1 : f64.t := M.call (impl f64.t "sqrt" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. @@ -696,7 +692,7 @@ Definition ln result_chaining_with_question_mark.checked.MathError.NonPositiveLogarithm) else let* α0 : f64.t := M.read x in - let* α1 : f64.t := M.call (f64.t::["ln"] α0) in + let* α1 : f64.t := M.call (impl f64.t "ln" α0) in M.alloc (core.result.Result.Ok α1) in M.read α4. @@ -1004,7 +1000,7 @@ Definition op (x : f64.t) (y : f64.t) : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow value)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow value)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -1012,7 +1008,7 @@ Definition op (x : f64.t) (y : f64.t) : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/std_library_types/strings.v b/CoqOfRust/examples/default/examples/std_library_types/strings.v index 65bf1e527..866c24344 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/strings.v +++ b/CoqOfRust/examples/default/examples/std_library_types/strings.v @@ -57,14 +57,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow pangram)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow pangram)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -77,7 +77,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -94,7 +94,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α2 : ref str.t := M.read pangram in let* α3 : core.str.iter.SplitWhitespace.t := - M.call (str.t::["split_whitespace"] α2) in + M.call (impl str.t "split_whitespace" α2) in let* α4 : core.iter.adapters.rev.Rev.t core.str.iter.SplitWhitespace.t := M.call (α1 α3) in let* α5 : core.iter.adapters.rev.Rev.t core.str.iter.SplitWhitespace.t := @@ -154,7 +154,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow word)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -164,7 +164,8 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in @@ -186,7 +187,7 @@ Definition main : M unit := (B := alloc.vec.Vec.t char.t alloc.alloc.Global.t) (Trait := ℐ))) in let* α1 : ref str.t := M.read pangram in - let* α2 : core.str.iter.Chars.t := M.call (str.t::["chars"] α1) in + let* α2 : core.str.iter.Chars.t := M.call (impl str.t "chars" α1) in let* α3 : alloc.vec.Vec.t char.t alloc.alloc.Global.t := M.call (α0 α2) in M.alloc α3 in let* _ : M.Val unit := @@ -196,16 +197,17 @@ Definition main : M unit := (Self := alloc.vec.Vec.t char.t alloc.alloc.Global.t) (Trait := ℐ))) in let* α1 : mut_ref (slice char.t) := M.call (α0 (borrow_mut chars)) in - let* α2 : unit := M.call ((slice char.t)::["sort"] α1) in + let* α2 : unit := M.call (impl (slice char.t) "sort" α1) in M.alloc α2 in let* _ : M.Val unit := let* α0 : unit := M.call - ((alloc.vec.Vec.t char.t alloc.alloc.Global.t)::["dedup"] + (impl (alloc.vec.Vec.t char.t alloc.alloc.Global.t) "dedup" (borrow_mut chars)) in M.alloc α0 in let* string : M.Val alloc.string.String.t := - let* α0 : alloc.string.String.t := M.call alloc.string.String.t::["new"] in + let* α0 : alloc.string.String.t := + M.call (impl alloc.string.String.t "new") in M.alloc α0 in let* _ : M.Val unit := let* α0 : _ := @@ -262,7 +264,7 @@ Definition main : M unit := let* α0 : char.t := M.read c in let* α1 : unit := M.call - (alloc.string.String.t::["push"] + (impl alloc.string.String.t "push" (borrow_mut string) α0) in M.alloc α1 in @@ -270,7 +272,7 @@ Definition main : M unit := let* α0 : ref str.t := M.read (mk_str ", ") in let* α1 : unit := M.call - (alloc.string.String.t::["push_str"] + (impl alloc.string.String.t "push_str" (borrow_mut string) α0) in M.alloc α1 in @@ -295,7 +297,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α1 : ref str.t := M.call (α0 (borrow string)) in let* α2 : ref (slice char.t) := M.read chars_to_trim in - let* α3 : ref str.t := M.call (str.t::["trim_matches"] α1 α2) in + let* α3 : ref str.t := M.call (impl str.t "trim_matches" α1 α2) in M.alloc α3 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -307,14 +309,15 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow trimmed_str)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow trimmed_str)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -337,7 +340,7 @@ Definition main : M unit := let* α1 : ref str.t := M.call (α0 (borrow alice)) in let* α2 : ref str.t := M.read (mk_str "dog") in let* α3 : ref str.t := M.read (mk_str "cat") in - let* α4 : alloc.string.String.t := M.call (str.t::["replace"] α1 α2 α3) in + let* α4 : alloc.string.String.t := M.call (impl str.t "replace" α1 α2 α3) in M.alloc α4 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -349,14 +352,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow alice)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow alice)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -370,14 +373,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow bob)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow bob)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/strings_byte_strings_as_non_utf8.v b/CoqOfRust/examples/default/examples/std_library_types/strings_byte_strings_as_non_utf8.v index 9de277c05..8fa094d4c 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/strings_byte_strings_as_non_utf8.v +++ b/CoqOfRust/examples/default/examples/std_library_types/strings_byte_strings_as_non_utf8.v @@ -53,14 +53,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow bytestring)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow bytestring)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -76,14 +76,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow escaped)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow escaped)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -100,14 +100,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow raw_bytestring)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow raw_bytestring)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -142,7 +142,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow my_str)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow my_str)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -150,7 +151,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -194,7 +195,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow my_str)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow my_str)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -202,7 +203,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -225,7 +226,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow e)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow e)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -233,7 +234,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/std_library_types/strings_literals_and_escapes.v b/CoqOfRust/examples/default/examples/std_library_types/strings_literals_and_escapes.v index 4188ddd84..a77b2d3df 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/strings_literals_and_escapes.v +++ b/CoqOfRust/examples/default/examples/std_library_types/strings_literals_and_escapes.v @@ -37,14 +37,15 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow byte_escape)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow byte_escape)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -64,18 +65,18 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow unicode_codepoint)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow character_name)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow character_name)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -95,14 +96,15 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow long_string)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow long_string)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/strings_raw_string_literals.v b/CoqOfRust/examples/default/examples/std_library_types/strings_raw_string_literals.v index 68f2afcfe..4c25b46e5 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/strings_raw_string_literals.v +++ b/CoqOfRust/examples/default/examples/std_library_types/strings_raw_string_literals.v @@ -30,14 +30,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow raw_str)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow raw_str)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -53,14 +53,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow quotes)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow quotes)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -77,14 +77,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow longer_delimiter)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow longer_delimiter)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_library_types/vectors.v b/CoqOfRust/examples/default/examples/std_library_types/vectors.v index 3ccbb7603..0101c6381 100644 --- a/CoqOfRust/examples/default/examples/std_library_types/vectors.v +++ b/CoqOfRust/examples/default/examples/std_library_types/vectors.v @@ -82,14 +82,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow collected_iterator)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow collected_iterator)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -106,7 +107,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -118,14 +119,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow xs)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow xs)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -138,14 +139,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in let* _ : M.Val unit := let* α0 : unit := M.call - ((alloc.vec.Vec.t i32.t alloc.alloc.Global.t)::["push"] + (impl (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) "push" (borrow_mut xs) ((Integer.of_Z 4) : i32.t)) in M.alloc α0 in @@ -159,14 +160,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow xs)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow xs)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -181,17 +182,18 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : usize.t := M.call - ((alloc.vec.Vec.t i32.t alloc.alloc.Global.t)::["len"] (borrow xs)) in + (impl (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) "len" + (borrow xs)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -213,14 +215,14 @@ Definition main : M unit := let* α6 : ref i32.t := M.call (α5 (borrow xs) ((Integer.of_Z 1) : usize.t)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] α6) in + M.call (impl core.fmt.rt.Argument.t "new_display" α6) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -235,18 +237,18 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.option.Option.t i32.t := M.call - ((alloc.vec.Vec.t i32.t alloc.alloc.Global.t)::["pop"] + (impl (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) "pop" (borrow_mut xs)) in let* α6 : M.Val (core.option.Option.t i32.t) := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -259,7 +261,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -276,7 +278,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α2 : ref (slice i32.t) := M.call (α1 (borrow xs)) in let* α3 : core.slice.iter.Iter.t i32.t := - M.call ((slice i32.t)::["iter"] α2) in + M.call (impl (slice i32.t) "iter" α2) in let* α4 : core.slice.iter.Iter.t i32.t := M.call (α0 α3) in let* α5 : M.Val (core.slice.iter.Iter.t i32.t) := M.alloc α4 in let* α6 : M.Val unit := @@ -329,7 +331,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -339,7 +341,8 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in @@ -373,7 +376,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α3 : ref (slice i32.t) := M.call (α2 (borrow xs)) in let* α4 : core.slice.iter.Iter.t i32.t := - M.call ((slice i32.t)::["iter"] α3) in + M.call (impl (slice i32.t) "iter" α3) in let* α5 : core.iter.adapters.enumerate.Enumerate.t (core.slice.iter.Iter.t i32.t) := @@ -449,11 +452,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow x)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in @@ -464,7 +467,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α5 α10) in + (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in @@ -492,7 +495,7 @@ Definition main : M unit := (Trait := ℐ))) in let* α2 : mut_ref (slice i32.t) := M.call (α1 (borrow_mut xs)) in let* α3 : core.slice.iter.IterMut.t i32.t := - M.call ((slice i32.t)::["iter_mut"] α2) in + M.call (impl (slice i32.t) "iter_mut" α2) in let* α4 : core.slice.iter.IterMut.t i32.t := M.call (α0 α3) in let* α5 : M.Val (core.slice.iter.IterMut.t i32.t) := M.alloc α4 in let* α6 : M.Val unit := @@ -559,14 +562,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow xs)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow xs)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/channels.v b/CoqOfRust/examples/default/examples/std_misc/channels.v index 3966dd18e..b985fb0ac 100644 --- a/CoqOfRust/examples/default/examples/std_misc/channels.v +++ b/CoqOfRust/examples/default/examples/std_misc/channels.v @@ -79,9 +79,11 @@ Definition main : M unit := (std.thread.JoinHandle.t unit) alloc.alloc.Global.t := M.call - (alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t (std.thread.JoinHandle.t unit) - alloc.alloc.Global.t)::["new"] in + alloc.alloc.Global.t) + "new") in M.alloc α0 in let* _ : M.Val unit := let* α0 : _ := @@ -159,16 +161,20 @@ Definition main : M unit := (std.sync.mpsc.SendError.t i32.t) := M.call - ((std.sync.mpsc.Sender.t - i32.t)::["send"] + (impl + (std.sync.mpsc.Sender.t + i32.t) + "send" (borrow thread_tx) α0) in let* α2 : unit := M.call - ((core.result.Result.t + (impl + (core.result.Result.t unit (std.sync.mpsc.SendError.t - i32.t))::["unwrap"] + i32.t)) + "unwrap" α1) in M.alloc α2 in let* _ : M.Val unit := @@ -194,7 +200,9 @@ Definition main : M unit := let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl + core.fmt.rt.Argument.t + "new_display" (borrow id)) in let* α6 : M.Val @@ -217,7 +225,9 @@ Definition main : M unit := α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] + (impl + core.fmt.Arguments.t + "new_v1" α4 α8) in let* α10 : unit := @@ -234,9 +244,11 @@ Definition main : M unit := M.read child in let* α1 : unit := M.call - ((alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t (std.thread.JoinHandle.t unit) - alloc.alloc.Global.t)::["push"] + alloc.alloc.Global.t) + "push" (borrow_mut children) α0) in M.alloc α1 in @@ -262,9 +274,11 @@ Definition main : M unit := (core.result.Result.t i32.t std.sync.mpsc.RecvError.t) alloc.alloc.Global.t := M.call - ((alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t (core.result.Result.t i32.t std.sync.mpsc.RecvError.t) - alloc.alloc.Global.t)::["with_capacity"] + alloc.alloc.Global.t) + "with_capacity" α2) in M.alloc α3 in let* _ : M.Val unit := @@ -325,16 +339,19 @@ Definition main : M unit := i32.t std.sync.mpsc.RecvError.t := M.call - ((std.sync.mpsc.Receiver.t - i32.t)::["recv"] + (impl + (std.sync.mpsc.Receiver.t i32.t) + "recv" (borrow rx)) in let* α1 : unit := M.call - ((alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t (core.result.Result.t i32.t std.sync.mpsc.RecvError.t) - alloc.alloc.Global.t)::["push"] + alloc.alloc.Global.t) + "push" (borrow_mut ids) α0) in M.alloc α1 in @@ -427,8 +444,9 @@ Definition main : M unit := _ (* dyn *) alloc.alloc.Global.t) := M.call - ((std.thread.JoinHandle.t - unit)::["join"] + (impl + (std.thread.JoinHandle.t unit) + "join" α0) in let* α2 : ref str.t := M.read @@ -436,11 +454,13 @@ Definition main : M unit := "oops! the child thread panicked") in let* α3 : unit := M.call - ((core.result.Result.t + (impl + (core.result.Result.t unit (alloc.boxed.Box.t _ (* dyn *) - alloc.alloc.Global.t))::["expect"] + alloc.alloc.Global.t)) + "expect" α1 α2) in M.alloc α3 in @@ -464,7 +484,8 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow ids)) in + M.call + (impl core.fmt.rt.Argument.t "new_debug" (borrow ids)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -472,7 +493,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/child_processes.v b/CoqOfRust/examples/default/examples/std_misc/child_processes.v index 60f39188a..4f251ba7a 100644 --- a/CoqOfRust/examples/default/examples/std_misc/child_processes.v +++ b/CoqOfRust/examples/default/examples/std_misc/child_processes.v @@ -24,18 +24,18 @@ Definition main : M unit := let* output : M.Val std.process.Output.t := let* α0 : ref str.t := M.read (mk_str "rustc") in let* α1 : std.process.Command.t := - M.call (std.process.Command.t::["new"] α0) in + M.call (impl std.process.Command.t "new" α0) in let* α2 : M.Val std.process.Command.t := M.alloc α1 in let* α3 : ref str.t := M.read (mk_str "--version") in let* α4 : mut_ref std.process.Command.t := - M.call (std.process.Command.t::["arg"] (borrow_mut α2) α3) in + M.call (impl std.process.Command.t "arg" (borrow_mut α2) α3) in let* α5 : core.result.Result.t std.process.Output.t std.io.error.Error.t := - M.call (std.process.Command.t::["output"] α4) in + M.call (impl std.process.Command.t "output" α4) in let* α6 : std.process.Output.t := M.call - ((core.result.Result.t - std.process.Output.t - std.io.error.Error.t)::["unwrap_or_else"] + (impl + (core.result.Result.t std.process.Output.t std.io.error.Error.t) + "unwrap_or_else" α5 (fun (α0 : std.io.error.Error.t) => (let* α0 := M.alloc α0 in @@ -53,7 +53,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow e)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow e)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -61,7 +61,7 @@ Definition main : M unit := let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in never_to_any α9) : M std.process.Output.t @@ -70,7 +70,7 @@ Definition main : M unit := M.alloc α6 in let* α0 : bool.t := M.call - (std.process.ExitStatus.t::["success"] + (impl std.process.ExitStatus.t "success" (borrow (std.process.Output.Get_status output))) in let* α1 : M.Val bool.t := M.alloc α0 in let* α2 : bool.t := M.read (use α1) in @@ -85,7 +85,7 @@ Definition main : M unit := let* α1 : ref (slice u8.t) := M.call (α0 (borrow (std.process.Output.Get_stdout output))) in let* α2 : alloc.borrow.Cow.t str.t := - M.call (alloc.string.String.t::["from_utf8_lossy"] α1) in + M.call (impl alloc.string.String.t "from_utf8_lossy" α1) in M.alloc α2 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -97,14 +97,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in @@ -119,7 +119,7 @@ Definition main : M unit := let* α1 : ref (slice u8.t) := M.call (α0 (borrow (std.process.Output.Get_stderr output))) in let* α2 : alloc.borrow.Cow.t str.t := - M.call (alloc.string.String.t::["from_utf8_lossy"] α1) in + M.call (impl alloc.string.String.t "from_utf8_lossy" α1) in M.alloc α2 in let* _ : M.Val unit := let* _ : M.Val unit := @@ -131,14 +131,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/child_processes_pipes.v b/CoqOfRust/examples/default/examples/std_misc/child_processes_pipes.v index 32076b28d..55f5d6bdc 100644 --- a/CoqOfRust/examples/default/examples/std_misc/child_processes_pipes.v +++ b/CoqOfRust/examples/default/examples/std_misc/child_processes_pipes.v @@ -45,16 +45,18 @@ Definition main : M unit := let* process : M.Val std.process.Child.t := let* α0 : ref str.t := M.read (mk_str "wc") in let* α1 : std.process.Command.t := - M.call (std.process.Command.t::["new"] α0) in + M.call (impl std.process.Command.t "new" α0) in let* α2 : M.Val std.process.Command.t := M.alloc α1 in - let* α3 : std.process.Stdio.t := M.call std.process.Stdio.t::["piped"] in + let* α3 : std.process.Stdio.t := + M.call (impl std.process.Stdio.t "piped") in let* α4 : mut_ref std.process.Command.t := - M.call (std.process.Command.t::["stdin"] (borrow_mut α2) α3) in - let* α5 : std.process.Stdio.t := M.call std.process.Stdio.t::["piped"] in + M.call (impl std.process.Command.t "stdin" (borrow_mut α2) α3) in + let* α5 : std.process.Stdio.t := + M.call (impl std.process.Stdio.t "piped") in let* α6 : mut_ref std.process.Command.t := - M.call (std.process.Command.t::["stdout"] α4 α5) in + M.call (impl std.process.Command.t "stdout" α4 α5) in let* α7 : core.result.Result.t std.process.Child.t std.io.error.Error.t := - M.call (std.process.Command.t::["spawn"] α6) in + M.call (impl std.process.Command.t "spawn" α6) in let* α8 : M.Val (core.result.Result.t std.process.Child.t std.io.error.Error.t) := M.alloc α7 in @@ -75,7 +77,8 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow why)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow why)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -83,7 +86,7 @@ Definition main : M unit := let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in let* α10 : std.process.Child.t := never_to_any α9 in M.alloc α10 @@ -111,11 +114,12 @@ Definition main : M unit := let* α1 : core.option.Option.t std.process.ChildStdin.t := M.read (std.process.Child.Get_stdin process) in let* α2 : std.process.ChildStdin.t := - M.call ((core.option.Option.t std.process.ChildStdin.t)::["unwrap"] α1) in + M.call + (impl (core.option.Option.t std.process.ChildStdin.t) "unwrap" α1) in let* α3 : M.Val std.process.ChildStdin.t := M.alloc α2 in let* α4 : ref (ref str.t) := M.read child_processes_pipes.PANGRAM in let* α5 : ref str.t := M.read (deref α4) in - let* α6 : ref (slice u8.t) := M.call (str.t::["as_bytes"] α5) in + let* α6 : ref (slice u8.t) := M.call (impl str.t "as_bytes" α5) in let* α7 : core.result.Result.t unit std.io.error.Error.t := M.call (α0 (borrow_mut α3) α6) in let* α8 : M.Val (core.result.Result.t unit std.io.error.Error.t) := @@ -136,14 +140,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow why)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow why)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in let* α10 : unit := never_to_any α9 in M.alloc α10 @@ -164,7 +168,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -173,7 +177,8 @@ Definition main : M unit := M (M.Val unit) ] in let* s : M.Val alloc.string.String.t := - let* α0 : alloc.string.String.t := M.call alloc.string.String.t::["new"] in + let* α0 : alloc.string.String.t := + M.call (impl alloc.string.String.t "new") in M.alloc α0 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -183,7 +188,8 @@ Definition main : M unit := let* α1 : core.option.Option.t std.process.ChildStdout.t := M.read (std.process.Child.Get_stdout process) in let* α2 : std.process.ChildStdout.t := - M.call ((core.option.Option.t std.process.ChildStdout.t)::["unwrap"] α1) in + M.call + (impl (core.option.Option.t std.process.ChildStdout.t) "unwrap" α1) in let* α3 : M.Val std.process.ChildStdout.t := M.alloc α2 in let* α4 : core.result.Result.t usize.t std.io.error.Error.t := M.call (α0 (borrow_mut α3) (borrow_mut s)) in @@ -206,14 +212,14 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow why)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow why)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α5) in let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : never.t := M.call (core.panicking.panic_fmt α8) in let* α10 : unit := never_to_any α9 in M.alloc α10 @@ -234,7 +240,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α5 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α4 ] in let* α6 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -242,7 +248,7 @@ Definition main : M unit := let* α7 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α6) in let* α8 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α3 α7) in + M.call (impl core.fmt.Arguments.t "new_v1" α3 α7) in let* α9 : unit := M.call (std.io.stdio._print α8) in M.alloc α9 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/std_misc/child_processes_wait.v b/CoqOfRust/examples/default/examples/std_misc/child_processes_wait.v index 8abfe2c3c..7d0101d89 100644 --- a/CoqOfRust/examples/default/examples/std_misc/child_processes_wait.v +++ b/CoqOfRust/examples/default/examples/std_misc/child_processes_wait.v @@ -14,29 +14,29 @@ Definition main : M unit := let* child : M.Val std.process.Child.t := let* α0 : ref str.t := M.read (mk_str "sleep") in let* α1 : std.process.Command.t := - M.call (std.process.Command.t::["new"] α0) in + M.call (impl std.process.Command.t "new" α0) in let* α2 : M.Val std.process.Command.t := M.alloc α1 in let* α3 : ref str.t := M.read (mk_str "5") in let* α4 : mut_ref std.process.Command.t := - M.call (std.process.Command.t::["arg"] (borrow_mut α2) α3) in + M.call (impl std.process.Command.t "arg" (borrow_mut α2) α3) in let* α5 : core.result.Result.t std.process.Child.t std.io.error.Error.t := - M.call (std.process.Command.t::["spawn"] α4) in + M.call (impl std.process.Command.t "spawn" α4) in let* α6 : std.process.Child.t := M.call - ((core.result.Result.t - std.process.Child.t - std.io.error.Error.t)::["unwrap"] + (impl + (core.result.Result.t std.process.Child.t std.io.error.Error.t) + "unwrap" α5) in M.alloc α6 in let* _result : M.Val std.process.ExitStatus.t := let* α0 : core.result.Result.t std.process.ExitStatus.t std.io.error.Error.t := - M.call (std.process.Child.t::["wait"] (borrow_mut child)) in + M.call (impl std.process.Child.t "wait" (borrow_mut child)) in let* α1 : std.process.ExitStatus.t := M.call - ((core.result.Result.t - std.process.ExitStatus.t - std.io.error.Error.t)::["unwrap"] + (impl + (core.result.Result.t std.process.ExitStatus.t std.io.error.Error.t) + "unwrap" α0) in M.alloc α1 in let* _ : M.Val unit := @@ -48,7 +48,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/file_io_create.v b/CoqOfRust/examples/default/examples/std_misc/file_io_create.v index e7a71cc56..49add665a 100644 --- a/CoqOfRust/examples/default/examples/std_misc/file_io_create.v +++ b/CoqOfRust/examples/default/examples/std_misc/file_io_create.v @@ -35,15 +35,16 @@ fn main() { Definition main : M unit := let* path : M.Val (ref std.path.Path.t) := let* α0 : ref str.t := M.read (mk_str "lorem_ipsum.txt") in - let* α1 : ref std.path.Path.t := M.call (std.path.Path.t::["new"] α0) in + let* α1 : ref std.path.Path.t := M.call (impl std.path.Path.t "new" α0) in M.alloc α1 in let* display : M.Val std.path.Display.t := let* α0 : ref std.path.Path.t := M.read path in - let* α1 : std.path.Display.t := M.call (std.path.Path.t::["display"] α0) in + let* α1 : std.path.Display.t := + M.call (impl std.path.Path.t "display" α0) in M.alloc α1 in let* file : M.Val std.fs.File.t := let* α0 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.File.t::["create"] (borrow path)) in + M.call (impl std.fs.File.t "create" (borrow path)) in let* α1 : M.Val (core.result.Result.t std.fs.File.t std.io.error.Error.t) := M.alloc α0 in let* α2 : M.Val std.fs.File.t := @@ -65,9 +66,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow display)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow display)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow why)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow why)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5; α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -75,7 +78,7 @@ Definition main : M unit := let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : never.t := M.call (core.panicking.panic_fmt α10) in let* α12 : std.fs.File.t := never_to_any α11 in M.alloc α12 @@ -99,7 +102,7 @@ Definition main : M unit := std.io.Write.write_all (Self := std.fs.File.t) (Trait := ℐ))) in let* α1 : ref (ref str.t) := M.read file_io_create.LOREM_IPSUM in let* α2 : ref str.t := M.read (deref α1) in - let* α3 : ref (slice u8.t) := M.call (str.t::["as_bytes"] α2) in + let* α3 : ref (slice u8.t) := M.call (impl str.t "as_bytes" α2) in let* α4 : core.result.Result.t unit std.io.error.Error.t := M.call (α0 (borrow_mut file) α3) in let* α5 : M.Val (core.result.Result.t unit std.io.error.Error.t) := @@ -122,9 +125,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow display)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow display)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow why)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow why)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5; α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -132,7 +135,7 @@ Definition main : M unit := let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : never.t := M.call (core.panicking.panic_fmt α10) in let* α12 : unit := never_to_any α11 in M.alloc α12 @@ -155,7 +158,8 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow display)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow display)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -163,7 +167,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/std_misc/file_io_open.v b/CoqOfRust/examples/default/examples/std_misc/file_io_open.v index c3750900f..76c30eff3 100644 --- a/CoqOfRust/examples/default/examples/std_misc/file_io_open.v +++ b/CoqOfRust/examples/default/examples/std_misc/file_io_open.v @@ -27,15 +27,16 @@ fn main() { Definition main : M unit := let* path : M.Val (ref std.path.Path.t) := let* α0 : ref str.t := M.read (mk_str "hello.txt") in - let* α1 : ref std.path.Path.t := M.call (std.path.Path.t::["new"] α0) in + let* α1 : ref std.path.Path.t := M.call (impl std.path.Path.t "new" α0) in M.alloc α1 in let* display : M.Val std.path.Display.t := let* α0 : ref std.path.Path.t := M.read path in - let* α1 : std.path.Display.t := M.call (std.path.Path.t::["display"] α0) in + let* α1 : std.path.Display.t := + M.call (impl std.path.Path.t "display" α0) in M.alloc α1 in let* file : M.Val std.fs.File.t := let* α0 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.File.t::["open"] (borrow path)) in + M.call (impl std.fs.File.t "open" (borrow path)) in let* α1 : M.Val (core.result.Result.t std.fs.File.t std.io.error.Error.t) := M.alloc α0 in let* α2 : M.Val std.fs.File.t := @@ -57,9 +58,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow display)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow display)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow why)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow why)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5; α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -67,7 +70,7 @@ Definition main : M unit := let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : never.t := M.call (core.panicking.panic_fmt α10) in let* α12 : std.fs.File.t := never_to_any α11 in M.alloc α12 @@ -87,7 +90,8 @@ Definition main : M unit := ] in M.copy α2 in let* s : M.Val alloc.string.String.t := - let* α0 : alloc.string.String.t := M.call alloc.string.String.t::["new"] in + let* α0 : alloc.string.String.t := + M.call (impl alloc.string.String.t "new") in M.alloc α0 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -114,9 +118,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow display)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow display)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow why)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow why)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5; α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -124,7 +128,7 @@ Definition main : M unit := let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : never.t := M.call (core.panicking.panic_fmt α10) in let* α12 : unit := never_to_any α11 in M.alloc α12 @@ -147,9 +151,10 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow display)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow display)) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5; α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -157,7 +162,7 @@ Definition main : M unit := let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines.v b/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines.v index 5c6f0a1db..66052d331 100644 --- a/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines.v +++ b/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines.v @@ -24,10 +24,12 @@ Definition read_lines (let* file : M.Val std.fs.File.t := let* α0 : alloc.string.String.t := M.read filename in let* α1 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.File.t::["open"] α0) in + M.call (impl std.fs.File.t "open" α0) in let* α2 : std.fs.File.t := M.call - ((core.result.Result.t std.fs.File.t std.io.error.Error.t)::["unwrap"] + (impl + (core.result.Result.t std.fs.File.t std.io.error.Error.t) + "unwrap" α1) in M.alloc α2 in let* α0 : _ := @@ -38,7 +40,7 @@ Definition read_lines let* α1 : std.fs.File.t := M.read file in let* α2 : std.io.buffered.bufreader.BufReader.t std.fs.File.t := M.call - ((std.io.buffered.bufreader.BufReader.t std.fs.File.t)::["new"] α1) in + (impl (std.io.buffered.bufreader.BufReader.t std.fs.File.t) "new" α1) in let* α3 : std.io.Lines.t (std.io.buffered.bufreader.BufReader.t std.fs.File.t) := M.call (α0 α2) in @@ -154,14 +156,16 @@ Definition main : M unit := M.read line in let* α6 : alloc.string.String.t := M.call - ((core.result.Result.t + (impl + (core.result.Result.t alloc.string.String.t - std.io.error.Error.t)::["unwrap"] + std.io.error.Error.t) + "unwrap" α5) in let* α7 : M.Val alloc.string.String.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in @@ -171,7 +175,8 @@ Definition main : M unit := let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call + (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines_efficient_method.v b/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines_efficient_method.v index a58ef060c..905ea12a6 100644 --- a/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines_efficient_method.v +++ b/CoqOfRust/examples/default/examples/std_misc/file_io_read_lines_efficient_method.v @@ -138,7 +138,9 @@ Definition main : M unit := α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl + core.fmt.rt.Argument.t + "new_display" (borrow ip)) in let* α6 : M.Val @@ -161,7 +163,9 @@ Definition main : M unit := α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] + (impl + core.fmt.Arguments.t + "new_v1" α4 α8) in let* α10 : unit := @@ -223,7 +227,7 @@ Definition read_lines (Trait := ℐ))) in let* α1 : P := M.read filename in let* α2 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.File.t::["open"] α1) in + M.call (impl std.fs.File.t "open" α1) in let* α3 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -302,7 +306,7 @@ Definition read_lines let* α1 : std.fs.File.t := M.read file in let* α2 : std.io.buffered.bufreader.BufReader.t std.fs.File.t := M.call - ((std.io.buffered.bufreader.BufReader.t std.fs.File.t)::["new"] α1) in + (impl (std.io.buffered.bufreader.BufReader.t std.fs.File.t) "new" α1) in let* α3 : std.io.Lines.t (std.io.buffered.bufreader.BufReader.t std.fs.File.t) := M.call (α0 α2) in diff --git a/CoqOfRust/examples/default/examples/std_misc/filesystem_operations.v b/CoqOfRust/examples/default/examples/std_misc/filesystem_operations.v index a94a51d23..d85bebef3 100644 --- a/CoqOfRust/examples/default/examples/std_misc/filesystem_operations.v +++ b/CoqOfRust/examples/default/examples/std_misc/filesystem_operations.v @@ -26,7 +26,7 @@ Definition cat (Trait := ℐ))) in let* α1 : ref std.path.Path.t := M.read path in let* α2 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.File.t::["open"] α1) in + M.call (impl std.fs.File.t "open" α1) in let* α3 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -96,7 +96,7 @@ Definition cat M.copy α5 in let* s : M.Val alloc.string.String.t := let* α0 : alloc.string.String.t := - M.call alloc.string.String.t::["new"] in + M.call (impl alloc.string.String.t "new") in M.alloc α0 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -166,7 +166,7 @@ Definition echo (Trait := ℐ))) in let* α1 : ref std.path.Path.t := M.read path in let* α2 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.File.t::["create"] α1) in + M.call (impl std.fs.File.t "create" α1) in let* α3 : core.ops.control_flow.ControlFlow.t (core.result.Result.t @@ -232,7 +232,7 @@ Definition echo ltac:(M.get_method (fun ℐ => std.io.Write.write_all (Self := std.fs.File.t) (Trait := ℐ))) in let* α1 : ref str.t := M.read s in - let* α2 : ref (slice u8.t) := M.call (str.t::["as_bytes"] α1) in + let* α2 : ref (slice u8.t) := M.call (impl str.t "as_bytes" α1) in let* α3 : core.result.Result.t unit std.io.error.Error.t := M.call (α0 (borrow_mut f) α2) in let* α0 : M.Val (core.result.Result.t unit std.io.error.Error.t) := @@ -251,15 +251,15 @@ Definition touch (path : ref std.path.Path.t) : M ltac:(std.io.error.Result unit) := let* path := M.alloc path in - let* α0 : std.fs.OpenOptions.t := M.call std.fs.OpenOptions.t::["new"] in + let* α0 : std.fs.OpenOptions.t := M.call (impl std.fs.OpenOptions.t "new") in let* α1 : M.Val std.fs.OpenOptions.t := M.alloc α0 in let* α2 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["create"] (borrow_mut α1) true) in + M.call (impl std.fs.OpenOptions.t "create" (borrow_mut α1) true) in let* α3 : mut_ref std.fs.OpenOptions.t := - M.call (std.fs.OpenOptions.t::["write"] α2 true) in + M.call (impl std.fs.OpenOptions.t "write" α2 true) in let* α4 : ref std.path.Path.t := M.read path in let* α5 : core.result.Result.t std.fs.File.t std.io.error.Error.t := - M.call (std.fs.OpenOptions.t::["open"] (borrow (deref α3)) α4) in + M.call (impl std.fs.OpenOptions.t "open" (borrow (deref α3)) α4) in let* α6 : M.Val (core.result.Result.t std.fs.File.t std.io.error.Error.t) := M.alloc α5 in let* α7 : M.Val (core.result.Result.t unit std.io.error.Error.t) := @@ -364,7 +364,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -393,10 +393,10 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -404,7 +404,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -430,19 +430,19 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in let* _ : M.Val unit := let* α0 : ref str.t := M.read (mk_str "hello") in let* α1 : ref str.t := M.read (mk_str "a/b.txt") in - let* α2 : ref std.path.Path.t := M.call (std.path.Path.t::["new"] α1) in + let* α2 : ref std.path.Path.t := M.call (impl std.path.Path.t "new" α1) in let* α3 : core.result.Result.t unit std.io.error.Error.t := M.call (filesystem_operations.echo α0 α2) in let* α4 : unit := M.call - ((core.result.Result.t unit std.io.error.Error.t)::["unwrap_or_else"] + (impl (core.result.Result.t unit std.io.error.Error.t) "unwrap_or_else" α3 (fun (α0 : std.io.error.Error.t) => (let* α0 := M.alloc α0 in @@ -463,11 +463,13 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call + (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -475,7 +477,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -494,7 +496,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -504,7 +506,7 @@ Definition main : M unit := M.call (std.fs.create_dir_all α0) in let* α2 : unit := M.call - ((core.result.Result.t unit std.io.error.Error.t)::["unwrap_or_else"] + (impl (core.result.Result.t unit std.io.error.Error.t) "unwrap_or_else" α1 (fun (α0 : std.io.error.Error.t) => (let* α0 := M.alloc α0 in @@ -525,11 +527,13 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call + (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -537,7 +541,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -556,18 +560,18 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in let* _ : M.Val unit := let* α0 : ref str.t := M.read (mk_str "a/c/e.txt") in - let* α1 : ref std.path.Path.t := M.call (std.path.Path.t::["new"] α0) in + let* α1 : ref std.path.Path.t := M.call (impl std.path.Path.t "new" α0) in let* α2 : core.result.Result.t unit std.io.error.Error.t := M.call (filesystem_operations.touch α1) in let* α3 : unit := M.call - ((core.result.Result.t unit std.io.error.Error.t)::["unwrap_or_else"] + (impl (core.result.Result.t unit std.io.error.Error.t) "unwrap_or_else" α2 (fun (α0 : std.io.error.Error.t) => (let* α0 := M.alloc α0 in @@ -588,11 +592,13 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call + (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -600,7 +606,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -619,7 +625,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -634,9 +640,9 @@ Definition main : M unit := M.call (std.os.unix.fs.symlink α0 α1) in let* α3 : unit := M.call - ((core.result.Result.t - unit - std.io.error.Error.t)::["unwrap_or_else"] + (impl + (core.result.Result.t unit std.io.error.Error.t) + "unwrap_or_else" α2 (fun (α0 : std.io.error.Error.t) => (let* α0 := M.alloc α0 in @@ -658,12 +664,12 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := M.call - (std.io.error.Error.t::["kind"] (borrow why)) in + (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in @@ -673,7 +679,8 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call + (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -695,13 +702,13 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in let* _ : M.Val unit := let* α0 : ref str.t := M.read (mk_str "a/c/b.txt") in - let* α1 : ref std.path.Path.t := M.call (std.path.Path.t::["new"] α0) in + let* α1 : ref std.path.Path.t := M.call (impl std.path.Path.t "new" α0) in let* α2 : core.result.Result.t alloc.string.String.t std.io.error.Error.t := M.call (filesystem_operations.cat α1) in let* α3 : @@ -727,10 +734,10 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -738,7 +745,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -761,7 +768,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -769,7 +776,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt @@ -786,7 +793,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -816,10 +823,10 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -827,7 +834,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt @@ -914,21 +921,23 @@ Definition main : M unit := M.read path in let* α6 : std.fs.DirEntry.t := M.call - ((core.result.Result.t + (impl + (core.result.Result.t std.fs.DirEntry.t - std.io.error.Error.t)::["unwrap"] + std.io.error.Error.t) + "unwrap" α5) in let* α7 : M.Val std.fs.DirEntry.t := M.alloc α6 in let* α8 : std.path.PathBuf.t := M.call - (std.fs.DirEntry.t::["path"] + (impl std.fs.DirEntry.t "path" (borrow α7)) in let* α9 : M.Val std.path.PathBuf.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] + (impl core.fmt.rt.Argument.t "new_debug" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := @@ -943,7 +952,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] + (impl core.fmt.Arguments.t "new_v1" α4 α13) in let* α15 : unit := @@ -972,7 +981,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -982,7 +991,7 @@ Definition main : M unit := M.call (std.fs.remove_file α0) in let* α2 : unit := M.call - ((core.result.Result.t unit std.io.error.Error.t)::["unwrap_or_else"] + (impl (core.result.Result.t unit std.io.error.Error.t) "unwrap_or_else" α1 (fun (α0 : std.io.error.Error.t) => (let* α0 := M.alloc α0 in @@ -1003,11 +1012,13 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call + (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -1015,7 +1026,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -1034,7 +1045,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -1044,7 +1055,7 @@ Definition main : M unit := M.call (std.fs.remove_dir α0) in let* α2 : unit := M.call - ((core.result.Result.t unit std.io.error.Error.t)::["unwrap_or_else"] + (impl (core.result.Result.t unit std.io.error.Error.t) "unwrap_or_else" α1 (fun (α0 : std.io.error.Error.t) => (let* α0 := M.alloc α0 in @@ -1065,11 +1076,13 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : std.io.error.ErrorKind.t := - M.call (std.io.error.Error.t::["kind"] (borrow why)) in + M.call + (impl std.io.error.Error.t "kind" (borrow why)) in let* α6 : M.Val std.io.error.ErrorKind.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow α6)) in + (impl core.fmt.rt.Argument.t "new_debug" + (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -1077,7 +1090,7 @@ Definition main : M unit := let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/foreign_function_interface.v b/CoqOfRust/examples/default/examples/std_misc/foreign_function_interface.v index 27a1ea396..18b7f3362 100644 --- a/CoqOfRust/examples/default/examples/std_misc/foreign_function_interface.v +++ b/CoqOfRust/examples/default/examples/std_misc/foreign_function_interface.v @@ -55,16 +55,16 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow z)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow z)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow z_sqrt)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow z_sqrt)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -79,20 +79,20 @@ Definition main : M unit := let* α5 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow z)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow z)) in let* α7 : foreign_function_interface.Complex.t := M.read z in let* α8 : foreign_function_interface.Complex.t := M.call (foreign_function_interface.cos α7) in let* α9 : M.Val foreign_function_interface.Complex.t := M.alloc α8 in let* α10 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α9)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α9)) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α10 ] in let* α12 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α11) in let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α13) in let* α15 : unit := M.call (std.io.stdio._print α14) in M.alloc α15 in M.alloc tt in @@ -135,10 +135,7 @@ Section Impl_core_clone_Clone_for_foreign_function_interface_Complex_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -194,7 +191,7 @@ Section Impl_core_fmt_Debug_for_foreign_function_interface_Complex_t. let* α7 : ref foreign_function_interface.Complex.t := M.read self in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (foreign_function_interface.Complex.Get_re (deref α7)))) in let* α9 : ref foreign_function_interface.Complex.t := M.read self in @@ -203,7 +200,7 @@ Section Impl_core_fmt_Debug_for_foreign_function_interface_Complex_t. let* α11 : f32.t := UnOp.neg α10 in let* α12 : M.Val f32.t := M.alloc α11 in let* α13 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α12)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α12)) in let* α14 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8; α13 ] in let* α15 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -211,9 +208,9 @@ Section Impl_core_fmt_Debug_for_foreign_function_interface_Complex_t. let* α16 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α15) in let* α17 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α16) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α16) in let* α18 : core.result.Result.t unit core.fmt.Error.t := - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α17) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α17) in M.alloc α18 else let* α0 : mut_ref core.fmt.Formatter.t := M.read f in @@ -227,13 +224,13 @@ Section Impl_core_fmt_Debug_for_foreign_function_interface_Complex_t. let* α7 : ref foreign_function_interface.Complex.t := M.read self in let* α8 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (foreign_function_interface.Complex.Get_re (deref α7)))) in let* α9 : ref foreign_function_interface.Complex.t := M.read self in let* α10 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (foreign_function_interface.Complex.Get_im (deref α9)))) in let* α11 : M.Val (array core.fmt.rt.Argument.t) := @@ -243,15 +240,13 @@ Section Impl_core_fmt_Debug_for_foreign_function_interface_Complex_t. let* α13 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α12) in let* α14 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α13) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α13) in let* α15 : core.result.Result.t unit core.fmt.Error.t := - M.call (core.fmt.Formatter.t::["write_fmt"] α0 α14) in + M.call (impl core.fmt.Formatter.t "write_fmt" α0 α14) in M.alloc α15 in M.read α5. - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; diff --git a/CoqOfRust/examples/default/examples/std_misc/path.v b/CoqOfRust/examples/default/examples/std_misc/path.v index e4bdf763c..735a3f973 100644 --- a/CoqOfRust/examples/default/examples/std_misc/path.v +++ b/CoqOfRust/examples/default/examples/std_misc/path.v @@ -31,11 +31,12 @@ fn main() { Definition main : M unit := let* path : M.Val (ref std.path.Path.t) := let* α0 : ref str.t := M.read (mk_str ".") in - let* α1 : ref std.path.Path.t := M.call (std.path.Path.t::["new"] α0) in + let* α1 : ref std.path.Path.t := M.call (impl std.path.Path.t "new" α0) in M.alloc α1 in let* _display : M.Val std.path.Display.t := let* α0 : ref std.path.Path.t := M.read path in - let* α1 : std.path.Display.t := M.call (std.path.Path.t::["display"] α0) in + let* α1 : std.path.Display.t := + M.call (impl std.path.Path.t "display" α0) in M.alloc α1 in let* new_path : M.Val std.path.PathBuf.t := let* α0 : _ := @@ -45,33 +46,36 @@ Definition main : M unit := (Trait := ℐ))) in let* α1 : ref std.path.Path.t := M.read path in let* α2 : ref str.t := M.read (mk_str "a") in - let* α3 : std.path.PathBuf.t := M.call (std.path.Path.t::["join"] α1 α2) in + let* α3 : std.path.PathBuf.t := + M.call (impl std.path.Path.t "join" α1 α2) in let* α4 : M.Val std.path.PathBuf.t := M.alloc α3 in let* α5 : ref std.path.Path.t := M.call (α0 (borrow α4)) in let* α6 : ref str.t := M.read (mk_str "b") in - let* α7 : std.path.PathBuf.t := M.call (std.path.Path.t::["join"] α5 α6) in + let* α7 : std.path.PathBuf.t := + M.call (impl std.path.Path.t "join" α5 α6) in M.alloc α7 in let* _ : M.Val unit := let* α0 : ref str.t := M.read (mk_str "c") in let* α1 : unit := - M.call (std.path.PathBuf.t::["push"] (borrow_mut new_path) α0) in + M.call (impl std.path.PathBuf.t "push" (borrow_mut new_path) α0) in M.alloc α1 in let* _ : M.Val unit := let* α0 : ref str.t := M.read (mk_str "myfile.tar.gz") in let* α1 : unit := - M.call (std.path.PathBuf.t::["push"] (borrow_mut new_path) α0) in + M.call (impl std.path.PathBuf.t "push" (borrow_mut new_path) α0) in M.alloc α1 in let* _ : M.Val unit := let* α0 : ref str.t := M.read (mk_str "package.tgz") in let* α1 : unit := - M.call (std.path.PathBuf.t::["set_file_name"] (borrow_mut new_path) α0) in + M.call + (impl std.path.PathBuf.t "set_file_name" (borrow_mut new_path) α0) in M.alloc α1 in let* α0 : _ := ltac:(M.get_method (fun ℐ => core.ops.deref.Deref.deref (Self := std.path.PathBuf.t) (Trait := ℐ))) in let* α1 : ref std.path.Path.t := M.call (α0 (borrow new_path)) in let* α2 : core.option.Option.t (ref str.t) := - M.call (std.path.Path.t::["to_str"] α1) in + M.call (impl std.path.Path.t "to_str" α1) in let* α3 : M.Val (core.option.Option.t (ref str.t)) := M.alloc α2 in let* α0 : M.Val unit := match_operator @@ -105,7 +109,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow s)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow s)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -113,7 +117,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt diff --git a/CoqOfRust/examples/default/examples/std_misc/program_arguments.v b/CoqOfRust/examples/default/examples/std_misc/program_arguments.v index 9e9946bbb..43a696293 100644 --- a/CoqOfRust/examples/default/examples/std_misc/program_arguments.v +++ b/CoqOfRust/examples/default/examples/std_misc/program_arguments.v @@ -46,14 +46,14 @@ Definition main : M unit := let* α6 : ref alloc.string.String.t := M.call (α5 (borrow args) ((Integer.of_Z 0) : usize.t)) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] α6) in + M.call (impl core.fmt.rt.Argument.t "new_display" α6) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -69,12 +69,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : usize.t := M.call - ((alloc.vec.Vec.t alloc.string.String.t alloc.alloc.Global.t)::["len"] + (impl + (alloc.vec.Vec.t alloc.string.String.t alloc.alloc.Global.t) + "len" (borrow args)) in let* α7 : usize.t := BinOp.Panic.sub α6 ((Integer.of_Z 1) : usize.t) in let* α8 : M.Val usize.t := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α8)) in let* α10 : _ := ltac:(M.get_method (fun ℐ => core.ops.index.Index.index @@ -89,14 +91,14 @@ Definition main : M unit := |}) in let* α12 : M.Val (ref (slice alloc.string.String.t)) := M.alloc α11 in let* α13 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α12)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α12)) in let* α14 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9; α13 ] in let* α15 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α14) in let* α16 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α15) in let* α17 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α16) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α16) in let* α18 : unit := M.call (std.io.stdio._print α17) in M.alloc α18 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/program_arguments_parsing.v b/CoqOfRust/examples/default/examples/std_misc/program_arguments_parsing.v index 001b68183..b6dfce2eb 100644 --- a/CoqOfRust/examples/default/examples/std_misc/program_arguments_parsing.v +++ b/CoqOfRust/examples/default/examples/std_misc/program_arguments_parsing.v @@ -21,14 +21,14 @@ Definition increase (number : i32.t) : M unit := let* α6 : i32.t := BinOp.Panic.add α5 ((Integer.of_Z 1) : i32.t) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -55,14 +55,14 @@ Definition decrease (number : i32.t) : M unit := let* α6 : i32.t := BinOp.Panic.sub α5 ((Integer.of_Z 1) : i32.t) in let* α7 : M.Val i32.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -97,7 +97,7 @@ match_args {increase|decrease} let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -167,7 +167,7 @@ Definition main : M unit := M.alloc α2 in let* α0 : usize.t := M.call - ((alloc.vec.Vec.t alloc.string.String.t alloc.alloc.Global.t)::["len"] + (impl (alloc.vec.Vec.t alloc.string.String.t alloc.alloc.Global.t) "len" (borrow args)) in let* α1 : M.Val usize.t := M.alloc α0 in let* α0 : M.Val unit := @@ -188,7 +188,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -212,7 +212,7 @@ Definition main : M unit := let* α3 : ref str.t := M.call (α0 α2) in let* α4 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α3) in + M.call (impl str.t "parse" α3) in let* α5 : M.Val (core.result.Result.t i32.t core.num.error.ParseIntError.t) := @@ -235,7 +235,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt @@ -253,7 +253,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt) : @@ -297,7 +297,7 @@ Definition main : M unit := let* α2 : ref str.t := M.call (α0 α1) in let* α3 : core.result.Result.t i32.t core.num.error.ParseIntError.t := - M.call (str.t::["parse"] α2) in + M.call (impl str.t "parse" α2) in let* α4 : M.Val (core.result.Result.t @@ -337,7 +337,8 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call + (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._eprint α4) in M.alloc α5 in @@ -393,7 +394,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._eprint α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/std_misc/threads.v b/CoqOfRust/examples/default/examples/std_misc/threads.v index 8cf63cfa6..abd914134 100644 --- a/CoqOfRust/examples/default/examples/std_misc/threads.v +++ b/CoqOfRust/examples/default/examples/std_misc/threads.v @@ -30,9 +30,9 @@ Definition main : M unit := let* α0 : alloc.vec.Vec.t (std.thread.JoinHandle.t unit) alloc.alloc.Global.t := M.call - (alloc.vec.Vec.t - (std.thread.JoinHandle.t unit) - alloc.alloc.Global.t)::["new"] in + (impl + (alloc.vec.Vec.t (std.thread.JoinHandle.t unit) alloc.alloc.Global.t) + "new") in M.alloc α0 in let* _ : M.Val unit := let* α0 : _ := @@ -105,7 +105,9 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl + core.fmt.rt.Argument.t + "new_display" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := @@ -120,7 +122,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := @@ -132,9 +134,11 @@ Definition main : M unit := M unit)) in let* α1 : unit := M.call - ((alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t (std.thread.JoinHandle.t unit) - alloc.alloc.Global.t)::["push"] + alloc.alloc.Global.t) + "push" (borrow_mut children) α0) in M.alloc α1 in @@ -215,7 +219,8 @@ Definition main : M unit := (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t) := - M.call ((std.thread.JoinHandle.t unit)::["join"] α0) in + M.call + (impl (std.thread.JoinHandle.t unit) "join" α0) in let* α2 : M.Val (core.result.Result.t diff --git a/CoqOfRust/examples/default/examples/std_misc/threads_test_case_map_reduce.v b/CoqOfRust/examples/default/examples/std_misc/threads_test_case_map_reduce.v index 831e4ec48..81b3dd46b 100644 --- a/CoqOfRust/examples/default/examples/std_misc/threads_test_case_map_reduce.v +++ b/CoqOfRust/examples/default/examples/std_misc/threads_test_case_map_reduce.v @@ -109,14 +109,14 @@ Definition main : M unit := let* α0 : alloc.vec.Vec.t (std.thread.JoinHandle.t u32.t) alloc.alloc.Global.t := M.call - (alloc.vec.Vec.t - (std.thread.JoinHandle.t u32.t) - alloc.alloc.Global.t)::["new"] in + (impl + (alloc.vec.Vec.t (std.thread.JoinHandle.t u32.t) alloc.alloc.Global.t) + "new") in M.alloc α0 in let* chunked_data : M.Val core.str.iter.SplitWhitespace.t := let* α0 : ref str.t := M.read data in let* α1 : core.str.iter.SplitWhitespace.t := - M.call (str.t::["split_whitespace"] α0) in + M.call (impl str.t "split_whitespace" α0) in M.alloc α1 in let* _ : M.Val unit := let* α0 : _ := @@ -206,11 +206,11 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow data_segment)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6; α7 ] in @@ -221,7 +221,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] α5 α10) in + (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in @@ -250,7 +250,7 @@ Definition main : M unit := let* α2 : ref str.t := M.read data_segment in let* α3 : core.str.iter.Chars.t := - M.call (str.t::["chars"] α2) in + M.call (impl str.t "chars" α2) in let* α4 : core.iter.adapters.map.Map.t core.str.iter.Chars.t @@ -271,7 +271,7 @@ Definition main : M unit := core.option.Option.t u32.t := M.call - (char.t::["to_digit"] + (impl char.t "to_digit" α0 ((Integer.of_Z 10) : u32.t)) in @@ -280,8 +280,10 @@ Definition main : M unit := (mk_str "should be a digit") in M.call - ((core.option.Option.t - u32.t)::["expect"] + (impl + (core.option.Option.t + u32.t) + "expect" α1 α2)) : M u32.t @@ -307,11 +309,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α4) in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl + core.fmt.rt.Argument.t + "new_display" (borrow i)) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl + core.fmt.rt.Argument.t + "new_display" (borrow result)) in let* α8 : M.Val @@ -327,7 +333,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := M.call - (core.fmt.Arguments.t::["new_v1"] + (impl core.fmt.Arguments.t "new_v1" α5 α10) in let* α12 : unit := @@ -338,9 +344,11 @@ Definition main : M unit := M u32.t)) in let* α1 : unit := M.call - ((alloc.vec.Vec.t + (impl + (alloc.vec.Vec.t (std.thread.JoinHandle.t u32.t) - alloc.alloc.Global.t)::["push"] + alloc.alloc.Global.t) + "push" (borrow_mut children) α0) in M.alloc α1 in @@ -413,13 +421,13 @@ Definition main : M unit := core.result.Result.t u32.t (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t) := - M.call ((std.thread.JoinHandle.t u32.t)::["join"] α0) in + M.call (impl (std.thread.JoinHandle.t u32.t) "join" α0) in M.call - ((core.result.Result.t + (impl + (core.result.Result.t u32.t - (alloc.boxed.Box.t - _ (* dyn *) - alloc.alloc.Global.t))::["unwrap"] + (alloc.boxed.Box.t _ (* dyn *) alloc.alloc.Global.t)) + "unwrap" α1)) : M u32.t ]) : @@ -437,14 +445,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow final_result)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow final_result)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/subtle.v b/CoqOfRust/examples/default/examples/subtle.v index a31c1c3c1..f6abefe4b 100644 --- a/CoqOfRust/examples/default/examples/subtle.v +++ b/CoqOfRust/examples/default/examples/subtle.v @@ -42,10 +42,7 @@ Section Impl_core_clone_Clone_for_subtle_Choice_t. ] in M.read α0. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -74,11 +71,9 @@ Section Impl_core_fmt_Debug_for_subtle_Choice_t. M.alloc (borrow (subtle.Choice.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref u8.t)) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -100,10 +95,7 @@ Section Impl_subtle_Choice_t. let* α0 : ref subtle.Choice.t := M.read self in M.read (subtle.Choice.Get_0 (deref α0)). - Global Instance AssociatedFunction_unwrap_u8 : - Notations.DoubleColon Self "unwrap_u8" := { - Notations.double_colon := unwrap_u8; - }. + Axiom unwrap_u8_is_impl : impl Self "unwrap_u8" = unwrap_u8. End Impl_subtle_Choice_t. End Impl_subtle_Choice_t. @@ -151,10 +143,7 @@ Section Impl_core_convert_From_subtle_Choice_t_for_bool_t. M.alloc (BinOp.Pure.ne α0 ((Integer.of_Z 0) : u8.t)) in M.read α0. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := subtle.Choice.t) := { core.convert.From.from := from; @@ -189,10 +178,7 @@ Section Impl_core_ops_bit_BitAnd_for_subtle_Choice_t. let* α2 : u8.t := M.read (subtle.Choice.Get_0 rhs) in M.call (α0 (BinOp.Pure.bit_and α1 α2)). - Global Instance AssociatedFunction_bitand : - Notations.DoubleColon Self "bitand" := { - Notations.double_colon := bitand; - }. + Axiom bitand_is_impl : impl Self "bitand" = bitand. Global Instance ℐ : core.ops.bit.BitAnd.Trait Self @@ -234,10 +220,7 @@ Section Impl_core_ops_bit_BitAndAssign_for_subtle_Choice_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_bitand_assign : - Notations.DoubleColon Self "bitand_assign" := { - Notations.double_colon := bitand_assign; - }. + Axiom bitand_assign_is_impl : impl Self "bitand_assign" = bitand_assign. Global Instance ℐ : core.ops.bit.BitAndAssign.Trait Self @@ -274,10 +257,7 @@ Section Impl_core_ops_bit_BitOr_for_subtle_Choice_t. let* α2 : u8.t := M.read (subtle.Choice.Get_0 rhs) in M.call (α0 (BinOp.Pure.bit_or α1 α2)). - Global Instance AssociatedFunction_bitor : - Notations.DoubleColon Self "bitor" := { - Notations.double_colon := bitor; - }. + Axiom bitor_is_impl : impl Self "bitor" = bitor. Global Instance ℐ : core.ops.bit.BitOr.Trait Self @@ -319,10 +299,7 @@ Section Impl_core_ops_bit_BitOrAssign_for_subtle_Choice_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_bitor_assign : - Notations.DoubleColon Self "bitor_assign" := { - Notations.double_colon := bitor_assign; - }. + Axiom bitor_assign_is_impl : impl Self "bitor_assign" = bitor_assign. Global Instance ℐ : core.ops.bit.BitOrAssign.Trait Self @@ -359,10 +336,7 @@ Section Impl_core_ops_bit_BitXor_for_subtle_Choice_t. let* α2 : u8.t := M.read (subtle.Choice.Get_0 rhs) in M.call (α0 (BinOp.Pure.bit_xor α1 α2)). - Global Instance AssociatedFunction_bitxor : - Notations.DoubleColon Self "bitxor" := { - Notations.double_colon := bitxor; - }. + Axiom bitxor_is_impl : impl Self "bitxor" = bitxor. Global Instance ℐ : core.ops.bit.BitXor.Trait Self @@ -404,10 +378,7 @@ Section Impl_core_ops_bit_BitXorAssign_for_subtle_Choice_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_bitxor_assign : - Notations.DoubleColon Self "bitxor_assign" := { - Notations.double_colon := bitxor_assign; - }. + Axiom bitxor_assign_is_impl : impl Self "bitxor_assign" = bitxor_assign. Global Instance ℐ : core.ops.bit.BitXorAssign.Trait Self @@ -442,9 +413,7 @@ Section Impl_core_ops_bit_Not_for_subtle_Choice_t. let* α1 : u8.t := M.read (subtle.Choice.Get_0 self) in M.call (α0 (BinOp.Pure.bit_and ((Integer.of_Z 1) : u8.t) (UnOp.not α1))). - Global Instance AssociatedFunction_not : Notations.DoubleColon Self "not" := { - Notations.double_colon := not; - }. + Axiom not_is_impl : impl Self "not" = not. Global Instance ℐ : core.ops.bit.Not.Trait Self := { core.ops.bit.Not.Output := Output; @@ -521,10 +490,7 @@ Section Impl_core_convert_From_u8_t_for_subtle_Choice_t. let* α1 : u8.t := M.call (subtle.black_box α0) in M.pure (subtle.Choice.Build_t α1). - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := u8.t) := { core.convert.From.from := from; @@ -580,12 +546,12 @@ Section Impl_subtle_ConstantTimeEq_for_slice_T. M.catch_return (let* len : M.Val usize.t := let* α0 : ref (slice T) := M.read self in - let* α1 : usize.t := M.call ((slice T)::["len"] α0) in + let* α1 : usize.t := M.call (impl (slice T) "len" α0) in M.alloc α1 in let* _ : M.Val unit := let* α0 : usize.t := M.read len in let* α1 : ref (slice T) := M.read _rhs in - let* α2 : usize.t := M.call ((slice T)::["len"] α1) in + let* α2 : usize.t := M.call (impl (slice T) "len" α1) in let* α3 : M.Val bool.t := M.alloc (BinOp.Pure.ne α0 α2) in let* α4 : bool.t := M.read (use α3) in if α4 then @@ -619,9 +585,11 @@ Section Impl_subtle_ConstantTimeEq_for_slice_T. (U := core.slice.iter.Iter.t T) (Trait := ℐ))) in let* α2 : ref (slice T) := M.read self in - let* α3 : core.slice.iter.Iter.t T := M.call ((slice T)::["iter"] α2) in + let* α3 : core.slice.iter.Iter.t T := + M.call (impl (slice T) "iter" α2) in let* α4 : ref (slice T) := M.read _rhs in - let* α5 : core.slice.iter.Iter.t T := M.call ((slice T)::["iter"] α4) in + let* α5 : core.slice.iter.Iter.t T := + M.call (impl (slice T) "iter" α4) in let* α6 : core.iter.adapters.zip.Zip.t (core.slice.iter.Iter.t T) @@ -700,7 +668,7 @@ Section Impl_subtle_ConstantTimeEq_for_slice_T. let* α5 : M.Val subtle.Choice.t := M.alloc α4 in let* α6 : u8.t := M.call - (subtle.Choice.t::["unwrap_u8"] + (impl subtle.Choice.t "unwrap_u8" (borrow α5)) in assign β (BinOp.Pure.bit_and α0 α6) in M.alloc tt @@ -724,10 +692,7 @@ Section Impl_subtle_ConstantTimeEq_for_slice_T. let* α0 : M.Val subtle.Choice.t := M.alloc α2 in M.read α0). - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -767,10 +732,7 @@ Section Impl_subtle_ConstantTimeEq_for_subtle_Choice_t. let* α6 : subtle.Choice.t := M.call (α1 α3 α5) in M.call (α0 α6). - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -813,7 +775,7 @@ Section Impl_subtle_ConstantTimeEq_for_u8_t. let* y : M.Val u8.t := let* α0 : u8.t := M.read x in let* α1 : u8.t := M.read x in - let* α2 : u8.t := M.call (u8.t::["wrapping_neg"] α1) in + let* α2 : u8.t := M.call (impl u8.t "wrapping_neg" α1) in let* α3 : i32.t := BinOp.Panic.sub ((Integer.of_Z 8) : i32.t) ((Integer.of_Z 1) : i32.t) in let* α4 : u8.t := BinOp.Panic.shr (BinOp.Pure.bit_or α0 α2) α3 in @@ -833,10 +795,7 @@ Section Impl_subtle_ConstantTimeEq_for_u8_t. let* α0 : M.Val subtle.Choice.t := M.alloc α6 in M.read α0. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -871,10 +830,7 @@ Section Impl_subtle_ConstantTimeEq_for_i8_t. let* α8 : M.Val u8.t := M.alloc α7 in M.call (α0 (borrow α4) (borrow α8)). - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -917,7 +873,7 @@ Section Impl_subtle_ConstantTimeEq_for_u16_t. let* y : M.Val u16.t := let* α0 : u16.t := M.read x in let* α1 : u16.t := M.read x in - let* α2 : u16.t := M.call (u16.t::["wrapping_neg"] α1) in + let* α2 : u16.t := M.call (impl u16.t "wrapping_neg" α1) in let* α3 : i32.t := BinOp.Panic.sub ((Integer.of_Z 16) : i32.t) @@ -938,10 +894,7 @@ Section Impl_subtle_ConstantTimeEq_for_u16_t. let* α0 : M.Val subtle.Choice.t := M.alloc α5 in M.read α0. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -976,10 +929,7 @@ Section Impl_subtle_ConstantTimeEq_for_i16_t. let* α8 : M.Val u16.t := M.alloc α7 in M.call (α0 (borrow α4) (borrow α8)). - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1022,7 +972,7 @@ Section Impl_subtle_ConstantTimeEq_for_u32_t. let* y : M.Val u32.t := let* α0 : u32.t := M.read x in let* α1 : u32.t := M.read x in - let* α2 : u32.t := M.call (u32.t::["wrapping_neg"] α1) in + let* α2 : u32.t := M.call (impl u32.t "wrapping_neg" α1) in let* α3 : i32.t := BinOp.Panic.sub ((Integer.of_Z 32) : i32.t) @@ -1043,10 +993,7 @@ Section Impl_subtle_ConstantTimeEq_for_u32_t. let* α0 : M.Val subtle.Choice.t := M.alloc α5 in M.read α0. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1081,10 +1028,7 @@ Section Impl_subtle_ConstantTimeEq_for_i32_t. let* α8 : M.Val u32.t := M.alloc α7 in M.call (α0 (borrow α4) (borrow α8)). - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1127,7 +1071,7 @@ Section Impl_subtle_ConstantTimeEq_for_u64_t. let* y : M.Val u64.t := let* α0 : u64.t := M.read x in let* α1 : u64.t := M.read x in - let* α2 : u64.t := M.call (u64.t::["wrapping_neg"] α1) in + let* α2 : u64.t := M.call (impl u64.t "wrapping_neg" α1) in let* α3 : i32.t := BinOp.Panic.sub ((Integer.of_Z 64) : i32.t) @@ -1148,10 +1092,7 @@ Section Impl_subtle_ConstantTimeEq_for_u64_t. let* α0 : M.Val subtle.Choice.t := M.alloc α5 in M.read α0. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1186,10 +1127,7 @@ Section Impl_subtle_ConstantTimeEq_for_i64_t. let* α8 : M.Val u64.t := M.alloc α7 in M.call (α0 (borrow α4) (borrow α8)). - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1235,7 +1173,7 @@ Section Impl_subtle_ConstantTimeEq_for_usize_t. let* y : M.Val usize.t := let* α0 : usize.t := M.read x in let* α1 : usize.t := M.read x in - let* α2 : usize.t := M.call (usize.t::["wrapping_neg"] α1) in + let* α2 : usize.t := M.call (impl usize.t "wrapping_neg" α1) in let* α3 : usize.t := M.call core.mem.size_of in let* α4 : usize.t := BinOp.Panic.mul α3 ((Integer.of_Z 8) : usize.t) in let* α5 : usize.t := BinOp.Panic.sub α4 ((Integer.of_Z 1) : usize.t) in @@ -1255,10 +1193,7 @@ Section Impl_subtle_ConstantTimeEq_for_usize_t. let* α0 : M.Val subtle.Choice.t := M.alloc α5 in M.read α0. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1296,10 +1231,7 @@ Section Impl_subtle_ConstantTimeEq_for_isize_t. let* α8 : M.Val usize.t := M.alloc α7 in M.call (α0 (borrow α4) (borrow α8)). - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -1340,7 +1272,7 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. let* choice := M.alloc choice in let* mask : M.Val u8.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i8.t := M.cast α0 in let* α2 : i8.t := UnOp.neg α1 in let* α3 : u8.t := M.cast α2 in @@ -1366,10 +1298,8 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. let* α0 : M.Val u8.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -1389,7 +1319,7 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. let* choice := M.alloc choice in let* mask : M.Val u8.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i8.t := M.cast α0 in let* α2 : i8.t := UnOp.neg α1 in let* α3 : u8.t := M.cast α2 in @@ -1412,10 +1342,8 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1437,7 +1365,7 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. let* choice := M.alloc choice in let* mask : M.Val u8.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i8.t := M.cast α0 in let* α2 : i8.t := UnOp.neg α1 in let* α3 : u8.t := M.cast α2 in @@ -1466,10 +1394,8 @@ Section Impl_subtle_ConditionallySelectable_for_u8_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1503,7 +1429,7 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. let* choice := M.alloc choice in let* mask : M.Val i8.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i8.t := M.cast α0 in let* α2 : i8.t := UnOp.neg α1 in let* α3 : M.Val i8.t := M.alloc α2 in @@ -1529,10 +1455,8 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. let* α0 : M.Val i8.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -1552,7 +1476,7 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. let* choice := M.alloc choice in let* mask : M.Val i8.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i8.t := M.cast α0 in let* α2 : i8.t := UnOp.neg α1 in let* α3 : M.Val i8.t := M.alloc α2 in @@ -1575,10 +1499,8 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1600,7 +1522,7 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. let* choice := M.alloc choice in let* mask : M.Val i8.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i8.t := M.cast α0 in let* α2 : i8.t := UnOp.neg α1 in let* α3 : M.Val i8.t := M.alloc α2 in @@ -1629,10 +1551,8 @@ Section Impl_subtle_ConditionallySelectable_for_i8_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1666,7 +1586,7 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. let* choice := M.alloc choice in let* mask : M.Val u16.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i16.t := M.cast α0 in let* α2 : i16.t := UnOp.neg α1 in let* α3 : u16.t := M.cast α2 in @@ -1692,10 +1612,8 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. let* α0 : M.Val u16.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -1715,7 +1633,7 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. let* choice := M.alloc choice in let* mask : M.Val u16.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i16.t := M.cast α0 in let* α2 : i16.t := UnOp.neg α1 in let* α3 : u16.t := M.cast α2 in @@ -1738,10 +1656,8 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1763,7 +1679,7 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. let* choice := M.alloc choice in let* mask : M.Val u16.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i16.t := M.cast α0 in let* α2 : i16.t := UnOp.neg α1 in let* α3 : u16.t := M.cast α2 in @@ -1792,10 +1708,8 @@ Section Impl_subtle_ConditionallySelectable_for_u16_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1829,7 +1743,7 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. let* choice := M.alloc choice in let* mask : M.Val i16.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i16.t := M.cast α0 in let* α2 : i16.t := UnOp.neg α1 in let* α3 : M.Val i16.t := M.alloc α2 in @@ -1855,10 +1769,8 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. let* α0 : M.Val i16.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -1878,7 +1790,7 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. let* choice := M.alloc choice in let* mask : M.Val i16.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i16.t := M.cast α0 in let* α2 : i16.t := UnOp.neg α1 in let* α3 : M.Val i16.t := M.alloc α2 in @@ -1901,10 +1813,8 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -1926,7 +1836,7 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. let* choice := M.alloc choice in let* mask : M.Val i16.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i16.t := M.cast α0 in let* α2 : i16.t := UnOp.neg α1 in let* α3 : M.Val i16.t := M.alloc α2 in @@ -1955,10 +1865,8 @@ Section Impl_subtle_ConditionallySelectable_for_i16_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -1992,7 +1900,7 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. let* choice := M.alloc choice in let* mask : M.Val u32.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i32.t := M.cast α0 in let* α2 : i32.t := UnOp.neg α1 in let* α3 : u32.t := M.cast α2 in @@ -2018,10 +1926,8 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. let* α0 : M.Val u32.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -2041,7 +1947,7 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. let* choice := M.alloc choice in let* mask : M.Val u32.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i32.t := M.cast α0 in let* α2 : i32.t := UnOp.neg α1 in let* α3 : u32.t := M.cast α2 in @@ -2064,10 +1970,8 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -2089,7 +1993,7 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. let* choice := M.alloc choice in let* mask : M.Val u32.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i32.t := M.cast α0 in let* α2 : i32.t := UnOp.neg α1 in let* α3 : u32.t := M.cast α2 in @@ -2118,10 +2022,8 @@ Section Impl_subtle_ConditionallySelectable_for_u32_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -2155,7 +2057,7 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. let* choice := M.alloc choice in let* mask : M.Val i32.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i32.t := M.cast α0 in let* α2 : i32.t := UnOp.neg α1 in let* α3 : M.Val i32.t := M.alloc α2 in @@ -2181,10 +2083,8 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. let* α0 : M.Val i32.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -2204,7 +2104,7 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. let* choice := M.alloc choice in let* mask : M.Val i32.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i32.t := M.cast α0 in let* α2 : i32.t := UnOp.neg α1 in let* α3 : M.Val i32.t := M.alloc α2 in @@ -2227,10 +2127,8 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -2252,7 +2150,7 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. let* choice := M.alloc choice in let* mask : M.Val i32.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i32.t := M.cast α0 in let* α2 : i32.t := UnOp.neg α1 in let* α3 : M.Val i32.t := M.alloc α2 in @@ -2281,10 +2179,8 @@ Section Impl_subtle_ConditionallySelectable_for_i32_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -2318,7 +2214,7 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. let* choice := M.alloc choice in let* mask : M.Val u64.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i64.t := M.cast α0 in let* α2 : i64.t := UnOp.neg α1 in let* α3 : u64.t := M.cast α2 in @@ -2344,10 +2240,8 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. let* α0 : M.Val u64.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -2367,7 +2261,7 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. let* choice := M.alloc choice in let* mask : M.Val u64.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i64.t := M.cast α0 in let* α2 : i64.t := UnOp.neg α1 in let* α3 : u64.t := M.cast α2 in @@ -2390,10 +2284,8 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -2415,7 +2307,7 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. let* choice := M.alloc choice in let* mask : M.Val u64.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i64.t := M.cast α0 in let* α2 : i64.t := UnOp.neg α1 in let* α3 : u64.t := M.cast α2 in @@ -2444,10 +2336,8 @@ Section Impl_subtle_ConditionallySelectable_for_u64_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -2481,7 +2371,7 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. let* choice := M.alloc choice in let* mask : M.Val i64.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i64.t := M.cast α0 in let* α2 : i64.t := UnOp.neg α1 in let* α3 : M.Val i64.t := M.alloc α2 in @@ -2507,10 +2397,8 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. let* α0 : M.Val i64.t := M.alloc α7 in M.read α0. - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. (* fn conditional_assign(&mut self, other: &Self, choice: Choice) { @@ -2530,7 +2418,7 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. let* choice := M.alloc choice in let* mask : M.Val i64.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i64.t := M.cast α0 in let* α2 : i64.t := UnOp.neg α1 in let* α3 : M.Val i64.t := M.alloc α2 in @@ -2553,10 +2441,8 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_assign : - Notations.DoubleColon Self "conditional_assign" := { - Notations.double_colon := conditional_assign; - }. + Axiom conditional_assign_is_impl : + impl Self "conditional_assign" = conditional_assign. (* fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice) { @@ -2578,7 +2464,7 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. let* choice := M.alloc choice in let* mask : M.Val i64.t := let* α0 : u8.t := - M.call (subtle.Choice.t::["unwrap_u8"] (borrow choice)) in + M.call (impl subtle.Choice.t "unwrap_u8" (borrow choice)) in let* α1 : i64.t := M.cast α0 in let* α2 : i64.t := UnOp.neg α1 in let* α3 : M.Val i64.t := M.alloc α2 in @@ -2607,10 +2493,8 @@ Section Impl_subtle_ConditionallySelectable_for_i64_t. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_swap : - Notations.DoubleColon Self "conditional_swap" := { - Notations.double_colon := conditional_swap; - }. + Axiom conditional_swap_is_impl : + impl Self "conditional_swap" = conditional_swap. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -2655,10 +2539,8 @@ Section Impl_subtle_ConditionallySelectable_for_subtle_Choice_t. α3) in M.pure (subtle.Choice.Build_t α4). - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -2722,10 +2604,8 @@ Section Impl_subtle_ConditionallyNegatable_for_T. let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_conditional_negate : - Notations.DoubleColon Self "conditional_negate" := { - Notations.double_colon := conditional_negate; - }. + Axiom conditional_negate_is_impl : + impl Self "conditional_negate" = conditional_negate. Global Instance ℐ : subtle.ConditionallyNegatable.Trait Self := { subtle.ConditionallyNegatable.conditional_negate := conditional_negate; @@ -2778,10 +2658,7 @@ Section Impl_core_clone_Clone_for_subtle_CtOption_t_T. M.call (α3 (borrow (subtle.CtOption.Get_is_some (deref α4)))) in M.pure {| subtle.CtOption.value := α2; subtle.CtOption.is_some := α5; |}. - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -2834,11 +2711,15 @@ Section Impl_core_fmt_Debug_for_subtle_CtOption_t_T. let* α9 : M.Val (ref (ref subtle.Choice.t)) := M.alloc (borrow α8) in let* α10 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α9) in M.call - (core.fmt.Formatter.t::["debug_struct_field2_finish"] α0 α1 α2 α5 α6 α10). + (impl core.fmt.Formatter.t "debug_struct_field2_finish" + α0 + α1 + α2 + α5 + α6 + α10). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -2864,9 +2745,9 @@ Section Impl_core_convert_From_subtle_CtOption_t_T_for_core_option_Option_t_T. Definition from (source : subtle.CtOption.t T) : M (core.option.Option.t T) := let* source := M.alloc source in let* α0 : subtle.Choice.t := - M.call ((subtle.CtOption.t T)::["is_some"] (borrow source)) in + M.call (impl (subtle.CtOption.t T) "is_some" (borrow source)) in let* α1 : M.Val subtle.Choice.t := M.alloc α0 in - let* α2 : u8.t := M.call (subtle.Choice.t::["unwrap_u8"] (borrow α1)) in + let* α2 : u8.t := M.call (impl subtle.Choice.t "unwrap_u8" (borrow α1)) in let* α3 : M.Val bool.t := M.alloc (BinOp.Pure.eq α2 ((Integer.of_Z 1) : u8.t)) in let* α4 : bool.t := M.read (use α3) in @@ -2878,10 +2759,7 @@ Section Impl_core_convert_From_subtle_CtOption_t_T_for_core_option_Option_t_T. M.alloc core.option.Option.None in M.read α5. - Global Instance AssociatedFunction_from : - Notations.DoubleColon Self "from" := { - Notations.double_colon := from; - }. + Axiom from_is_impl : impl Self "from" = from. Global Instance ℐ : core.convert.From.Trait Self (T := subtle.CtOption.t T) := { @@ -2914,9 +2792,7 @@ Section Impl_subtle_CtOption_t_T. let* α1 : subtle.Choice.t := M.read is_some in M.pure {| subtle.CtOption.value := α0; subtle.CtOption.is_some := α1; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* pub fn expect(self, msg: &str) -> T { @@ -2931,7 +2807,7 @@ Section Impl_subtle_CtOption_t_T. let* _ : M.Val unit := let* α0 : u8.t := M.call - (subtle.Choice.t::["unwrap_u8"] + (impl subtle.Choice.t "unwrap_u8" (borrow (subtle.CtOption.Get_is_some self))) in let* α1 : M.Val u8.t := M.alloc α0 in let* α2 : M.Val u8.t := M.alloc ((Integer.of_Z 1) : u8.t) in @@ -2969,7 +2845,7 @@ Section Impl_subtle_CtOption_t_T. M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow msg)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow msg)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -2977,7 +2853,7 @@ Section Impl_subtle_CtOption_t_T. let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α10) in let* α12 : never.t := M.call (core.panicking.assert_failed @@ -2996,10 +2872,7 @@ Section Impl_subtle_CtOption_t_T. ] in M.read (subtle.CtOption.Get_value self). - Global Instance AssociatedFunction_expect : - Notations.DoubleColon Self "expect" := { - Notations.double_colon := expect; - }. + Axiom expect_is_impl : impl Self "expect" = expect. (* pub fn unwrap(self) -> T { @@ -3013,7 +2886,7 @@ Section Impl_subtle_CtOption_t_T. let* _ : M.Val unit := let* α0 : u8.t := M.call - (subtle.Choice.t::["unwrap_u8"] + (impl subtle.Choice.t "unwrap_u8" (borrow (subtle.CtOption.Get_is_some self))) in let* α1 : M.Val u8.t := M.alloc α0 in let* α2 : M.Val u8.t := M.alloc ((Integer.of_Z 1) : u8.t) in @@ -3061,10 +2934,7 @@ Section Impl_subtle_CtOption_t_T. ] in M.read (subtle.CtOption.Get_value self). - Global Instance AssociatedFunction_unwrap : - Notations.DoubleColon Self "unwrap" := { - Notations.double_colon := unwrap; - }. + Axiom unwrap_is_impl : impl Self "unwrap" = unwrap. (* pub fn unwrap_or(self, def: T) -> T @@ -3089,11 +2959,7 @@ Section Impl_subtle_CtOption_t_T. let* α1 : subtle.Choice.t := M.read (subtle.CtOption.Get_is_some self) in M.call (α0 (borrow def) (borrow (subtle.CtOption.Get_value self)) α1). - Global Instance AssociatedFunction_unwrap_or - {ℋ_0 : subtle.ConditionallySelectable.Trait T} : - Notations.DoubleColon Self "unwrap_or" := { - Notations.double_colon := unwrap_or; - }. + Axiom unwrap_or_is_impl : impl Self "unwrap_or" = unwrap_or. (* pub fn unwrap_or_else(self, f: F) -> T @@ -3130,13 +2996,9 @@ Section Impl_subtle_CtOption_t_T. let* α5 : subtle.Choice.t := M.read (subtle.CtOption.Get_is_some self) in M.call (α0 (borrow α4) (borrow (subtle.CtOption.Get_value self)) α5). - Global Instance AssociatedFunction_unwrap_or_else - {F : Set} - {ℋ_0 : subtle.ConditionallySelectable.Trait T} - {ℋ_1 : core.ops.function.FnOnce.Trait F (Args := unit)} : - Notations.DoubleColon Self "unwrap_or_else" := { - Notations.double_colon := unwrap_or_else (F := F); - }. + Axiom unwrap_or_else_is_impl : + forall {F : Set}, + impl Self "unwrap_or_else" = unwrap_or_else (F := F). (* pub fn is_some(&self) -> Choice { @@ -3148,10 +3010,7 @@ Section Impl_subtle_CtOption_t_T. let* α0 : ref (subtle.CtOption.t T) := M.read self in M.read (subtle.CtOption.Get_is_some (deref α0)). - Global Instance AssociatedFunction_is_some : - Notations.DoubleColon Self "is_some" := { - Notations.double_colon := is_some; - }. + Axiom is_some_is_impl : impl Self "is_some" = is_some. (* pub fn is_none(&self) -> Choice { @@ -3168,10 +3027,7 @@ Section Impl_subtle_CtOption_t_T. M.read (subtle.CtOption.Get_is_some (deref α1)) in M.call (α0 α2). - Global Instance AssociatedFunction_is_none : - Notations.DoubleColon Self "is_none" := { - Notations.double_colon := is_none; - }. + Axiom is_none_is_impl : impl Self "is_none" = is_none. (* pub fn map(self, f: F) -> CtOption @@ -3221,16 +3077,11 @@ Section Impl_subtle_CtOption_t_T. M.call (α2 (borrow α5) (borrow (subtle.CtOption.Get_value self)) α6) in let* α8 : U := M.call (α0 α1 (α7)) in let* α9 : subtle.Choice.t := M.read (subtle.CtOption.Get_is_some self) in - M.call ((subtle.CtOption.t U)::["new"] α8 α9). + M.call (impl (subtle.CtOption.t U) "new" α8 α9). - Global Instance AssociatedFunction_map - {U F : Set} - {ℋ_0 : core.default.Default.Trait T} - {ℋ_1 : subtle.ConditionallySelectable.Trait T} - {ℋ_2 : core.ops.function.FnOnce.Trait F (Args := T)} : - Notations.DoubleColon Self "map" := { - Notations.double_colon := map (U := U) (F := F); - }. + Axiom map_is_impl : + forall {U F : Set}, + impl Self "map" = map (U := U) (F := F). (* pub fn and_then(self, f: F) -> CtOption @@ -3294,14 +3145,9 @@ Section Impl_subtle_CtOption_t_T. M.alloc α2 in M.read tmp. - Global Instance AssociatedFunction_and_then - {U F : Set} - {ℋ_0 : core.default.Default.Trait T} - {ℋ_1 : subtle.ConditionallySelectable.Trait T} - {ℋ_2 : core.ops.function.FnOnce.Trait F (Args := T)} : - Notations.DoubleColon Self "and_then" := { - Notations.double_colon := and_then (U := U) (F := F); - }. + Axiom and_then_is_impl : + forall {U F : Set}, + impl Self "and_then" = and_then (U := U) (F := F). (* pub fn or_else(self, f: F) -> CtOption @@ -3326,7 +3172,7 @@ Section Impl_subtle_CtOption_t_T. let* f := M.alloc f in let* is_none : M.Val subtle.Choice.t := let* α0 : subtle.Choice.t := - M.call ((subtle.CtOption.t T)::["is_none"] (borrow self)) in + M.call (impl (subtle.CtOption.t T) "is_none" (borrow self)) in M.alloc α0 in let* f : M.Val (subtle.CtOption.t T) := let* α0 : _ := @@ -3348,13 +3194,9 @@ Section Impl_subtle_CtOption_t_T. let* α0 : M.Val (subtle.CtOption.t T) := M.alloc α2 in M.read α0. - Global Instance AssociatedFunction_or_else - {F : Set} - {ℋ_0 : subtle.ConditionallySelectable.Trait T} - {ℋ_1 : core.ops.function.FnOnce.Trait F (Args := unit)} : - Notations.DoubleColon Self "or_else" := { - Notations.double_colon := or_else (F := F); - }. + Axiom or_else_is_impl : + forall {F : Set}, + impl Self "or_else" = or_else (F := F). End Impl_subtle_CtOption_t_T. End Impl_subtle_CtOption_t_T. @@ -3410,12 +3252,10 @@ Section Impl_subtle_ConditionallySelectable_for_subtle_CtOption_t_T. (borrow (subtle.CtOption.Get_is_some (deref α6))) (borrow (subtle.CtOption.Get_is_some (deref α7))) α8) in - M.call ((subtle.CtOption.t T)::["new"] α4 α9). + M.call (impl (subtle.CtOption.t T) "new" α4 α9). - Global Instance AssociatedFunction_conditional_select : - Notations.DoubleColon Self "conditional_select" := { - Notations.double_colon := conditional_select; - }. + Axiom conditional_select_is_impl : + impl Self "conditional_select" = conditional_select. Global Instance ℐ : subtle.ConditionallySelectable.Required.Trait Self := { subtle.ConditionallySelectable.conditional_select := conditional_select; @@ -3450,12 +3290,12 @@ Section Impl_subtle_ConstantTimeEq_for_subtle_CtOption_t_T. let* a : M.Val subtle.Choice.t := let* α0 : ref (subtle.CtOption.t T) := M.read self in let* α1 : subtle.Choice.t := - M.call ((subtle.CtOption.t T)::["is_some"] α0) in + M.call (impl (subtle.CtOption.t T) "is_some" α0) in M.alloc α1 in let* b : M.Val subtle.Choice.t := let* α0 : ref (subtle.CtOption.t T) := M.read rhs in let* α1 : subtle.Choice.t := - M.call ((subtle.CtOption.t T)::["is_some"] α0) in + M.call (impl (subtle.CtOption.t T) "is_some" α0) in M.alloc α1 in let* α0 : _ := ltac:(M.get_method (fun ℐ => @@ -3510,10 +3350,7 @@ Section Impl_subtle_ConstantTimeEq_for_subtle_CtOption_t_T. let* α0 : M.Val subtle.Choice.t := M.alloc α19 in M.read α0. - Global Instance AssociatedFunction_ct_eq : - Notations.DoubleColon Self "ct_eq" := { - Notations.double_colon := ct_eq; - }. + Axiom ct_eq_is_impl : impl Self "ct_eq" = ct_eq. Global Instance ℐ : subtle.ConstantTimeEq.Required.Trait Self := { subtle.ConstantTimeEq.ct_eq := ct_eq; @@ -3673,10 +3510,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u8_t. let* α0 : M.Val subtle.Choice.t := M.alloc α4 in M.read α0. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; @@ -3825,10 +3659,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u16_t. let* α0 : M.Val subtle.Choice.t := M.alloc α3 in M.read α0. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; @@ -3977,10 +3808,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u32_t. let* α0 : M.Val subtle.Choice.t := M.alloc α3 in M.read α0. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; @@ -4129,10 +3957,7 @@ Section Impl_subtle_ConstantTimeGreater_for_u64_t. let* α0 : M.Val subtle.Choice.t := M.alloc α3 in M.read α0. - Global Instance AssociatedFunction_ct_gt : - Notations.DoubleColon Self "ct_gt" := { - Notations.double_colon := ct_gt; - }. + Axiom ct_gt_is_impl : impl Self "ct_gt" = ct_gt. Global Instance ℐ : subtle.ConstantTimeGreater.Trait Self := { subtle.ConstantTimeGreater.ct_gt := ct_gt; diff --git a/CoqOfRust/examples/default/examples/test0.v b/CoqOfRust/examples/default/examples/test0.v index 757f42a60..37e6ad3e8 100644 --- a/CoqOfRust/examples/default/examples/test0.v +++ b/CoqOfRust/examples/default/examples/test0.v @@ -55,14 +55,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow test0.message)) in + (impl core.fmt.rt.Argument.t "new_display" (borrow test0.message)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -93,7 +93,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -101,7 +101,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -132,7 +132,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow j)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow j)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -140,7 +140,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -161,7 +161,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -190,7 +190,7 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow i)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -198,7 +198,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -222,7 +222,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -241,7 +241,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/clone.v b/CoqOfRust/examples/default/examples/traits/clone.v index 43a8226b1..f27a7b443 100644 --- a/CoqOfRust/examples/default/examples/traits/clone.v +++ b/CoqOfRust/examples/default/examples/traits/clone.v @@ -22,11 +22,9 @@ Section Impl_core_fmt_Debug_for_clone_Unit_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "Unit") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -46,10 +44,7 @@ Section Impl_core_clone_Clone_for_clone_Unit_t. let* α0 : ref clone.Unit.t := M.read self in M.read (deref α0). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -108,10 +103,7 @@ Section Impl_core_clone_Clone_for_clone_Pair_t. M.call (α3 (borrow (clone.Pair.Get_1 (deref α4)))) in M.pure (clone.Pair.Build_t α2 α5). - Global Instance AssociatedFunction_clone : - Notations.DoubleColon Self "clone" := { - Notations.double_colon := clone; - }. + Axiom clone_is_impl : impl Self "clone" = clone. Global Instance ℐ : core.clone.Clone.Required.Trait Self := { core.clone.Clone.clone := clone; @@ -146,11 +138,9 @@ Section Impl_core_fmt_Debug_for_clone_Pair_t. M.Val (ref (ref (alloc.boxed.Box.t i32.t alloc.alloc.Global.t))) := M.alloc (borrow α6) in let* α8 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α7) in - M.call (core.fmt.Formatter.t::["debug_tuple_field2_finish"] α0 α1 α4 α8). + M.call (impl core.fmt.Formatter.t "debug_tuple_field2_finish" α0 α1 α4 α8). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -208,14 +198,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow unit)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow unit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -229,25 +219,25 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow copied_unit)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow copied_unit)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in let* pair : M.Val clone.Pair.t := let* α0 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 1) : i32.t)) in let* α1 : alloc.boxed.Box.t i32.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t i32.t alloc.alloc.Global.t)::["new"] + (impl (alloc.boxed.Box.t i32.t alloc.alloc.Global.t) "new" ((Integer.of_Z 2) : i32.t)) in M.alloc (clone.Pair.Build_t α0 α1) in let* _ : M.Val unit := @@ -260,14 +250,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow pair)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow pair)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -282,14 +272,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow moved_pair)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow moved_pair)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -313,14 +303,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow cloned_pair)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow cloned_pair)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/derive.v b/CoqOfRust/examples/default/examples/traits/derive.v index 81971326d..73ee26085 100644 --- a/CoqOfRust/examples/default/examples/traits/derive.v +++ b/CoqOfRust/examples/default/examples/traits/derive.v @@ -40,9 +40,7 @@ Section Impl_core_cmp_PartialEq_for_derive_Centimeters_t. let* α3 : f64.t := M.read (derive.Centimeters.Get_0 (deref α2)) in M.pure (BinOp.Pure.eq α1 α3). - Global Instance AssociatedFunction_eq : Notations.DoubleColon Self "eq" := { - Notations.double_colon := eq; - }. + Axiom eq_is_impl : impl Self "eq" = eq. Global Instance ℐ : core.cmp.PartialEq.Required.Trait Self @@ -79,10 +77,7 @@ Section Impl_core_cmp_PartialOrd_for_derive_Centimeters_t. (borrow (derive.Centimeters.Get_0 (deref α1))) (borrow (derive.Centimeters.Get_0 (deref α2)))). - Global Instance AssociatedFunction_partial_cmp : - Notations.DoubleColon Self "partial_cmp" := { - Notations.double_colon := partial_cmp; - }. + Axiom partial_cmp_is_impl : impl Self "partial_cmp" = partial_cmp. Global Instance ℐ : core.cmp.PartialOrd.Required.Trait Self @@ -127,11 +122,9 @@ Section Impl_core_fmt_Debug_for_derive_Inches_t. M.alloc (borrow (derive.Inches.Get_0 (deref α2))) in let* α4 : M.Val (ref (ref i32.t)) := M.alloc (borrow α3) in let* α5 : ref _ (* dyn *) := M.read (pointer_coercion "Unsize" α4) in - M.call (core.fmt.Formatter.t::["debug_tuple_field1_finish"] α0 α1 α5). + M.call (impl core.fmt.Formatter.t "debug_tuple_field1_finish" α0 α1 α5). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -175,10 +168,7 @@ Section Impl_derive_Inches_t. ] in M.read α0. - Global Instance AssociatedFunction_to_centimeters : - Notations.DoubleColon Self "to_centimeters" := { - Notations.double_colon := to_centimeters; - }. + Axiom to_centimeters_is_impl : impl Self "to_centimeters" = to_centimeters. End Impl_derive_Inches_t. End Impl_derive_Inches_t. @@ -236,14 +226,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow foot)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow foot)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -258,7 +248,7 @@ Definition main : M unit := (Rhs := derive.Centimeters.t) (Trait := ℐ))) in let* α1 : derive.Centimeters.t := - M.call (derive.Inches.t::["to_centimeters"] (borrow foot)) in + M.call (impl derive.Inches.t "to_centimeters" (borrow foot)) in let* α2 : M.Val derive.Centimeters.t := M.alloc α1 in let* α3 : bool.t := M.call (α0 (borrow α2) (borrow meter)) in let* α4 : M.Val bool.t := M.alloc α3 in @@ -280,14 +270,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow cmp)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow cmp)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/disambiguating_overlapping_traits.v b/CoqOfRust/examples/default/examples/traits/disambiguating_overlapping_traits.v index 2b2fc63da..a3e9ba308 100644 --- a/CoqOfRust/examples/default/examples/traits/disambiguating_overlapping_traits.v +++ b/CoqOfRust/examples/default/examples/traits/disambiguating_overlapping_traits.v @@ -55,9 +55,7 @@ Section Impl_disambiguating_overlapping_traits_UsernameWidget_for_disambiguating (borrow (disambiguating_overlapping_traits.Form.Get_username (deref α1)))). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : disambiguating_overlapping_traits.UsernameWidget.Trait Self := { @@ -80,9 +78,7 @@ Section Impl_disambiguating_overlapping_traits_AgeWidget_for_disambiguating_over let* α0 : ref disambiguating_overlapping_traits.Form.t := M.read self in M.read (disambiguating_overlapping_traits.Form.Get_age (deref α0)). - Global Instance AssociatedFunction_get : Notations.DoubleColon Self "get" := { - Notations.double_colon := get; - }. + Axiom get_is_impl : impl Self "get" = get. Global Instance ℐ : disambiguating_overlapping_traits.AgeWidget.Trait Self := { diff --git a/CoqOfRust/examples/default/examples/traits/drop.v b/CoqOfRust/examples/default/examples/traits/drop.v index 0a9f3f710..f1a2e6dd1 100644 --- a/CoqOfRust/examples/default/examples/traits/drop.v +++ b/CoqOfRust/examples/default/examples/traits/drop.v @@ -35,7 +35,7 @@ Section Impl_core_ops_drop_Drop_for_drop_Droppable_t. let* α5 : mut_ref drop.Droppable.t := M.read self in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (drop.Droppable.Get_name (deref α5)))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -43,17 +43,14 @@ Section Impl_core_ops_drop_Drop_for_drop_Droppable_t. let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_drop : - Notations.DoubleColon Self "drop" := { - Notations.double_colon := drop; - }. + Axiom drop_is_impl : impl Self "drop" = drop. Global Instance ℐ : core.ops.drop.Drop.Trait Self := { core.ops.drop.Drop.drop := drop; @@ -117,7 +114,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -131,7 +128,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -144,7 +141,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -158,7 +155,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -175,7 +172,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/hash.v b/CoqOfRust/examples/default/examples/traits/hash.v index 1c0c86d10..96d57ebb0 100644 --- a/CoqOfRust/examples/default/examples/traits/hash.v +++ b/CoqOfRust/examples/default/examples/traits/hash.v @@ -64,12 +64,7 @@ Section Impl_core_hash_Hash_for_hash_Person_t. let* α0 : M.Val unit := M.alloc α3 in M.read α0. - Global Instance AssociatedFunction_hash - {__H : Set} - {ℋ_0 : core.hash.Hasher.Trait __H} : - Notations.DoubleColon Self "hash" := { - Notations.double_colon := hash (__H := __H); - }. + Axiom hash_is_impl : forall {__H : Set}, impl Self "hash" = hash (__H := __H). Global Instance ℐ : core.hash.Hash.Required.Trait Self := { core.hash.Hash.hash {__H : Set} {ℋ_0 : core.hash.Hasher.Trait __H} := @@ -94,7 +89,7 @@ Definition calculate_hash let* t := M.alloc t in let* s : M.Val std.hash.random.DefaultHasher.t := let* α0 : std.hash.random.DefaultHasher.t := - M.call std.hash.random.DefaultHasher.t::["new"] in + M.call (impl std.hash.random.DefaultHasher.t "new") in M.alloc α0 in let* _ : M.Val unit := let* α0 : _ := diff --git a/CoqOfRust/examples/default/examples/traits/impl_trait_as_return_type.v b/CoqOfRust/examples/default/examples/traits/impl_trait_as_return_type.v index c3a6cc069..a673de2ec 100644 --- a/CoqOfRust/examples/default/examples/traits/impl_trait_as_return_type.v +++ b/CoqOfRust/examples/default/examples/traits/impl_trait_as_return_type.v @@ -139,7 +139,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* v2 : M.Val (alloc.vec.Vec.t i32.t alloc.alloc.Global.t) := let* α0 : M.Val (array i32.t) := @@ -149,7 +149,7 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice i32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := - M.call ((slice i32.t)::["into_vec"] α2) in + M.call (impl (slice i32.t) "into_vec" α2) in M.alloc α3 in let* v3 : M.Val type not implemented := let* α0 : alloc.vec.Vec.t i32.t alloc.alloc.Global.t := M.read v1 in @@ -466,7 +466,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/iterators.v b/CoqOfRust/examples/default/examples/traits/iterators.v index d003137fc..258c9a87a 100644 --- a/CoqOfRust/examples/default/examples/traits/iterators.v +++ b/CoqOfRust/examples/default/examples/traits/iterators.v @@ -58,10 +58,7 @@ Section Impl_core_iter_traits_iterator_Iterator_for_iterators_Fibonacci_t. M.alloc (core.option.Option.Some α0) in M.read α0. - Global Instance AssociatedFunction_next : - Notations.DoubleColon Self "next" := { - Notations.double_colon := next; - }. + Axiom next_is_impl : impl Self "next" = next. Global Instance ℐ : core.iter.traits.iterator.Iterator.Required.Trait Self := { @@ -217,7 +214,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -239,14 +236,14 @@ Definition main : M unit := M.call (α5 (borrow_mut sequence)) in let* α7 : M.Val (core.option.Option.t i32.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -268,14 +265,14 @@ Definition main : M unit := M.call (α5 (borrow_mut sequence)) in let* α7 : M.Val (core.option.Option.t i32.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -297,14 +294,14 @@ Definition main : M unit := M.call (α5 (borrow_mut sequence)) in let* α7 : M.Val (core.option.Option.t i32.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -326,14 +323,14 @@ Definition main : M unit := M.call (α5 (borrow_mut sequence)) in let* α7 : M.Val (core.option.Option.t i32.t) := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -347,7 +344,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -414,7 +411,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -424,7 +421,8 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in @@ -449,7 +447,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -521,7 +519,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -531,7 +529,8 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in @@ -556,7 +555,7 @@ Definition main : M unit := let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -646,7 +645,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -656,7 +655,8 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call + (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in @@ -689,14 +689,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val (ref (array u32.t)) := M.alloc (borrow array) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α5)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α5)) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -708,7 +708,7 @@ Definition main : M unit := let* α1 : M.Val (ref (array u32.t)) := M.alloc (borrow array) in let* α2 : ref (slice u32.t) := M.read (pointer_coercion "Unsize" α1) in let* α3 : core.slice.iter.Iter.t u32.t := - M.call ((slice u32.t)::["iter"] α2) in + M.call (impl (slice u32.t) "iter" α2) in let* α4 : core.slice.iter.Iter.t u32.t := M.call (α0 α3) in let* α5 : M.Val (core.slice.iter.Iter.t u32.t) := M.alloc α4 in let* α6 : M.Val unit := @@ -761,7 +761,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow i)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in @@ -771,7 +771,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/operator_overloading.v b/CoqOfRust/examples/default/examples/traits/operator_overloading.v index 71d305b08..cb895b784 100644 --- a/CoqOfRust/examples/default/examples/traits/operator_overloading.v +++ b/CoqOfRust/examples/default/examples/traits/operator_overloading.v @@ -34,11 +34,9 @@ Section Impl_core_fmt_Debug_for_operator_overloading_FooBar_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "FooBar") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -67,11 +65,9 @@ Section Impl_core_fmt_Debug_for_operator_overloading_BarFoo_t. let* f := M.alloc f in let* α0 : mut_ref core.fmt.Formatter.t := M.read f in let* α1 : ref str.t := M.read (mk_str "BarFoo") in - M.call (core.fmt.Formatter.t::["write_str"] α0 α1). + M.call (impl core.fmt.Formatter.t "write_str" α0 α1). - Global Instance AssociatedFunction_fmt : Notations.DoubleColon Self "fmt" := { - Notations.double_colon := fmt; - }. + Axiom fmt_is_impl : impl Self "fmt" = fmt. Global Instance ℐ : core.fmt.Debug.Trait Self := { core.fmt.Debug.fmt := fmt; @@ -110,7 +106,7 @@ Section Impl_core_ops_arith_Add_operator_overloading_Bar_t_for_operator_overload let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -118,9 +114,7 @@ Section Impl_core_ops_arith_Add_operator_overloading_Bar_t_for_operator_overload M.alloc operator_overloading.FooBar.Build in M.read α0. - Global Instance AssociatedFunction_add : Notations.DoubleColon Self "add" := { - Notations.double_colon := add; - }. + Axiom add_is_impl : impl Self "add" = add. Global Instance ℐ : core.ops.arith.Add.Trait Self (Rhs := operator_overloading.Bar.t) := { @@ -161,7 +155,7 @@ Section Impl_core_ops_arith_Add_operator_overloading_Foo_t_for_operator_overload let* α3 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α2) in let* α4 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_const"] α3) in + M.call (impl core.fmt.Arguments.t "new_const" α3) in let* α5 : unit := M.call (std.io.stdio._print α4) in M.alloc α5 in M.alloc tt in @@ -169,9 +163,7 @@ Section Impl_core_ops_arith_Add_operator_overloading_Foo_t_for_operator_overload M.alloc operator_overloading.BarFoo.Build in M.read α0. - Global Instance AssociatedFunction_add : Notations.DoubleColon Self "add" := { - Notations.double_colon := add; - }. + Axiom add_is_impl : impl Self "add" = add. Global Instance ℐ : core.ops.arith.Add.Trait Self (Rhs := operator_overloading.Foo.t) := { @@ -209,14 +201,14 @@ Definition main : M unit := (α5 operator_overloading.Foo.Build operator_overloading.Bar.Build) in let* α7 : M.Val operator_overloading.FooBar.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -240,14 +232,14 @@ Definition main : M unit := (α5 operator_overloading.Bar.Build operator_overloading.Foo.Build) in let* α7 : M.Val operator_overloading.BarFoo.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/returning_traits_with_dyn.v b/CoqOfRust/examples/default/examples/traits/returning_traits_with_dyn.v index d37f98fa0..4a54f28a4 100644 --- a/CoqOfRust/examples/default/examples/traits/returning_traits_with_dyn.v +++ b/CoqOfRust/examples/default/examples/traits/returning_traits_with_dyn.v @@ -35,10 +35,7 @@ Section Impl_returning_traits_with_dyn_Animal_for_returning_traits_with_dyn_Shee let* self := M.alloc self in M.read (mk_str "baaaaah!"). - Global Instance AssociatedFunction_noise : - Notations.DoubleColon Self "noise" := { - Notations.double_colon := noise; - }. + Axiom noise_is_impl : impl Self "noise" = noise. Global Instance ℐ : returning_traits_with_dyn.Animal.Trait Self := { returning_traits_with_dyn.Animal.noise := noise; @@ -59,10 +56,7 @@ Section Impl_returning_traits_with_dyn_Animal_for_returning_traits_with_dyn_Cow_ let* self := M.alloc self in M.read (mk_str "moooooo!"). - Global Instance AssociatedFunction_noise : - Notations.DoubleColon Self "noise" := { - Notations.double_colon := noise; - }. + Axiom noise_is_impl : impl Self "noise" = noise. Global Instance ℐ : returning_traits_with_dyn.Animal.Trait Self := { returning_traits_with_dyn.Animal.noise := noise; @@ -94,9 +88,11 @@ Definition random_animal returning_traits_with_dyn.Sheep.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t + (impl + (alloc.boxed.Box.t returning_traits_with_dyn.Sheep.t - alloc.alloc.Global.t)::["new"] + alloc.alloc.Global.t) + "new" returning_traits_with_dyn.Sheep.Build) in let* α1 : M.Val @@ -111,9 +107,11 @@ Definition random_animal returning_traits_with_dyn.Cow.t alloc.alloc.Global.t := M.call - ((alloc.boxed.Box.t + (impl + (alloc.boxed.Box.t returning_traits_with_dyn.Cow.t - alloc.alloc.Global.t)::["new"] + alloc.alloc.Global.t) + "new" returning_traits_with_dyn.Cow.Build) in let* α1 : M.Val @@ -163,14 +161,14 @@ Definition main : M unit := let* α7 : ref str.t := M.call (α5 (borrow (deref α6))) in let* α8 : M.Val (ref str.t) := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/traits/supertraits.v b/CoqOfRust/examples/default/examples/traits/supertraits.v index 1f95db15a..1fdf715ad 100644 --- a/CoqOfRust/examples/default/examples/traits/supertraits.v +++ b/CoqOfRust/examples/default/examples/traits/supertraits.v @@ -73,7 +73,7 @@ Definition comp_sci_student_greeting let* α9 : alloc.string.String.t := M.call (α7 α8) in let* α10 : M.Val alloc.string.String.t := M.alloc α9 in let* α11 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α10)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α10)) in let* α12 : _ := ltac:(M.get_method (fun ℐ => supertraits.Student.university (Self := _ (* dyn *)) (Trait := ℐ))) in @@ -81,7 +81,7 @@ Definition comp_sci_student_greeting let* α14 : alloc.string.String.t := M.call (α12 α13) in let* α15 : M.Val alloc.string.String.t := M.alloc α14 in let* α16 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α15)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α15)) in let* α17 : _ := ltac:(M.get_method (fun ℐ => supertraits.Programmer.fav_language @@ -91,7 +91,7 @@ Definition comp_sci_student_greeting let* α19 : alloc.string.String.t := M.call (α17 α18) in let* α20 : M.Val alloc.string.String.t := M.alloc α19 in let* α21 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α20)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α20)) in let* α22 : _ := ltac:(M.get_method (fun ℐ => supertraits.CompSciStudent.git_username @@ -101,7 +101,7 @@ Definition comp_sci_student_greeting let* α24 : alloc.string.String.t := M.call (α22 α23) in let* α25 : M.Val alloc.string.String.t := M.alloc α24 in let* α26 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α25)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α25)) in let* α27 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α11; α16; α21; α26 ] in let* α28 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -109,7 +109,7 @@ Definition comp_sci_student_greeting let* α29 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α28) in let* α30 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α29) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α29) in let* α31 : alloc.string.String.t := M.call (alloc.fmt.format α30) in M.alloc α31 in M.read res. diff --git a/CoqOfRust/examples/default/examples/traits/traits.v b/CoqOfRust/examples/default/examples/traits/traits.v index 3cc079a49..276c3f775 100644 --- a/CoqOfRust/examples/default/examples/traits/traits.v +++ b/CoqOfRust/examples/default/examples/traits/traits.v @@ -40,10 +40,7 @@ Section Impl_traits_Sheep_t. let* α0 : ref traits.Sheep.t := M.read self in M.read (traits.Sheep.Get_naked (deref α0)). - Global Instance AssociatedFunction_is_naked : - Notations.DoubleColon Self "is_naked" := { - Notations.double_colon := is_naked; - }. + Axiom is_naked_is_impl : impl Self "is_naked" = is_naked. End Impl_traits_Sheep_t. End Impl_traits_Sheep_t. @@ -64,9 +61,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. let* α0 : ref str.t := M.read name in M.pure {| traits.Sheep.name := α0; traits.Sheep.naked := false; |}. - Global Instance AssociatedFunction_new : Notations.DoubleColon Self "new" := { - Notations.double_colon := new; - }. + Axiom new_is_impl : impl Self "new" = new. (* fn name(&self) -> &'static str { @@ -78,10 +73,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. let* α0 : ref traits.Sheep.t := M.read self in M.read (traits.Sheep.Get_name (deref α0)). - Global Instance AssociatedFunction_name : - Notations.DoubleColon Self "name" := { - Notations.double_colon := name; - }. + Axiom name_is_impl : impl Self "name" = name. (* fn noise(&self) -> &'static str { @@ -95,7 +87,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. Definition noise (self : ref Self) : M (ref str.t) := let* self := M.alloc self in let* α0 : ref traits.Sheep.t := M.read self in - let* α1 : bool.t := M.call (traits.Sheep.t::["is_naked"] α0) in + let* α1 : bool.t := M.call (impl traits.Sheep.t "is_naked" α0) in let* α2 : M.Val bool.t := M.alloc α1 in let* α3 : bool.t := M.read (use α2) in let* α4 : M.Val (ref str.t) := @@ -105,10 +97,7 @@ Section Impl_traits_Animal_for_traits_Sheep_t. M.pure (mk_str "baaaaah!") in M.read α4. - Global Instance AssociatedFunction_noise : - Notations.DoubleColon Self "noise" := { - Notations.double_colon := noise; - }. + Axiom noise_is_impl : impl Self "noise" = noise. (* fn talk(&self) { @@ -131,13 +120,13 @@ Section Impl_traits_Animal_for_traits_Sheep_t. let* α6 : ref traits.Sheep.t := M.read self in let* α7 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (traits.Sheep.Get_name (deref α6)))) in let* α8 : ref traits.Sheep.t := M.read self in let* α9 : ref str.t := M.call (noise α8) in let* α10 : M.Val (ref str.t) := M.alloc α9 in let* α11 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α10)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α10)) in let* α12 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α11 ] in let* α13 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -145,17 +134,14 @@ Section Impl_traits_Animal_for_traits_Sheep_t. let* α14 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α13) in let* α15 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α5 α14) in + M.call (impl core.fmt.Arguments.t "new_v1" α5 α14) in let* α16 : unit := M.call (std.io.stdio._print α15) in M.alloc α16 in M.alloc tt in let* α0 : M.Val unit := M.alloc tt in M.read α0. - Global Instance AssociatedFunction_talk : - Notations.DoubleColon Self "talk" := { - Notations.double_colon := talk; - }. + Axiom talk_is_impl : impl Self "talk" = talk. Global Instance ℐ : traits.Animal.Required.Trait Self := { traits.Animal.new := new; @@ -186,7 +172,7 @@ Section Impl_traits_Sheep_t_2. let* self := M.alloc self in let* α0 : mut_ref traits.Sheep.t := M.read self in let* α1 : bool.t := - M.call (traits.Sheep.t::["is_naked"] (borrow (deref α0))) in + M.call (impl traits.Sheep.t "is_naked" (borrow (deref α0))) in let* α2 : M.Val bool.t := M.alloc α1 in let* α3 : bool.t := M.read (use α2) in let* α4 : M.Val unit := @@ -207,14 +193,14 @@ Section Impl_traits_Sheep_t_2. let* α7 : ref str.t := M.call (α5 (borrow (deref α6))) in let* α8 : M.Val (ref str.t) := M.alloc α7 in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α8)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α8)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α10) in let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -232,7 +218,7 @@ Section Impl_traits_Sheep_t_2. let* α5 : mut_ref traits.Sheep.t := M.read self in let* α6 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow (traits.Sheep.Get_name (deref α5)))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -240,7 +226,7 @@ Section Impl_traits_Sheep_t_2. let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -250,10 +236,7 @@ Section Impl_traits_Sheep_t_2. M.alloc tt in M.read α4. - Global Instance AssociatedFunction_shear : - Notations.DoubleColon Self "shear" := { - Notations.double_colon := shear; - }. + Axiom shear_is_impl : impl Self "shear" = shear. End Impl_traits_Sheep_t_2. End Impl_traits_Sheep_t_2. @@ -284,7 +267,7 @@ Definition main : M unit := let* α1 : unit := M.call (α0 (borrow dolly)) in M.alloc α1 in let* _ : M.Val unit := - let* α0 : unit := M.call (traits.Sheep.t::["shear"] (borrow_mut dolly)) in + let* α0 : unit := M.call (impl traits.Sheep.t "shear" (borrow_mut dolly)) in M.alloc α0 in let* _ : M.Val unit := let* α0 : _ := diff --git a/CoqOfRust/examples/default/examples/traits/traits_parms.v b/CoqOfRust/examples/default/examples/traits/traits_parms.v index 44fcbede9..db192fd0e 100644 --- a/CoqOfRust/examples/default/examples/traits/traits_parms.v +++ b/CoqOfRust/examples/default/examples/traits/traits_parms.v @@ -97,10 +97,7 @@ Section Impl_traits_parms_SomeTrait_for_traits_parms_SomeOtherType_t. *) Definition some_fn : M unit := M.pure tt. - Global Instance AssociatedFunction_some_fn : - Notations.DoubleColon Self "some_fn" := { - Notations.double_colon := some_fn; - }. + Axiom some_fn_is_impl : impl Self "some_fn" = some_fn. Global Instance ℐ : traits_parms.SomeTrait.Trait Self := { traits_parms.SomeTrait.SomeType := SomeType; diff --git a/CoqOfRust/examples/default/examples/types/aliasing.v b/CoqOfRust/examples/default/examples/types/aliasing.v index 020ce9a7e..d803afdb7 100644 --- a/CoqOfRust/examples/default/examples/types/aliasing.v +++ b/CoqOfRust/examples/default/examples/types/aliasing.v @@ -43,15 +43,16 @@ Definition main : M unit := let* α6 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow nanoseconds)) in + M.call + (impl core.fmt.rt.Argument.t "new_display" (borrow nanoseconds)) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow inches)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow inches)) in let* α9 : u64.t := M.read nanoseconds in let* α10 : u64.t := M.read inches in let* α11 : u64.t := BinOp.Panic.add α9 α10 in let* α12 : M.Val u64.t := M.alloc α11 in let* α13 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α12)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α12)) in let* α14 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α13 ] in let* α15 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -59,7 +60,7 @@ Definition main : M unit := let* α16 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α15) in let* α17 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α16) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α16) in let* α18 : unit := M.call (std.io.stdio._print α17) in M.alloc α18 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/types/casting.v b/CoqOfRust/examples/default/examples/types/casting.v index be94e28fd..72e824b5b 100644 --- a/CoqOfRust/examples/default/examples/types/casting.v +++ b/CoqOfRust/examples/default/examples/types/casting.v @@ -104,11 +104,11 @@ Definition main : M unit := let* α6 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α5) in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow decimal)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow decimal)) in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow integer)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow integer)) in let* α9 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow character)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow character)) in let* α10 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7; α8; α9 ] in let* α11 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -116,7 +116,7 @@ Definition main : M unit := let* α12 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α11) in let* α13 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α6 α12) in + M.call (impl core.fmt.Arguments.t "new_v1" α6 α12) in let* α14 : unit := M.call (std.io.stdio._print α13) in M.alloc α14 in M.alloc tt in @@ -131,14 +131,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val u16.t := M.alloc ((Integer.of_Z 1000) : u16.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow (use α5))) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow (use α5))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -153,14 +153,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val u8.t := M.alloc ((Integer.of_Z 1000) : u8.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow (use α5))) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow (use α5))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -176,14 +176,14 @@ Definition main : M unit := let* α5 : u8.t := M.cast ((Integer.of_Z (-1)) : i8.t) in let* α6 : M.Val u8.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -202,14 +202,14 @@ Definition main : M unit := ((Integer.of_Z 256) : i32.t) in let* α6 : M.Val i32.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -224,14 +224,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i16.t := M.alloc ((Integer.of_Z 128) : i16.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow (use α5))) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow (use α5))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -246,14 +246,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i8.t := M.alloc ((Integer.of_Z 128) : i8.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow (use α5))) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow (use α5))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -268,14 +268,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val u8.t := M.alloc ((Integer.of_Z 1000) : u8.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow (use α5))) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow (use α5))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -290,14 +290,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : M.Val i8.t := M.alloc ((Integer.of_Z 232) : i8.t) in let* α6 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow (use α5))) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow (use α5))) in let* α7 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α6 ] in let* α8 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α7) in let* α9 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α8) in let* α10 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α9) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α9) in let* α11 : unit := M.call (std.io.stdio._print α10) in M.alloc α11 in M.alloc tt in @@ -314,14 +314,14 @@ Definition main : M unit := let* α6 : u8.t := M.cast α5 in let* α7 : M.Val u8.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -338,14 +338,14 @@ Definition main : M unit := let* α6 : u8.t := M.cast α5 in let* α7 : M.Val u8.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -362,14 +362,14 @@ Definition main : M unit := let* α6 : u8.t := M.cast α5 in let* α7 : M.Val u8.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -383,17 +383,17 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : f32.t := M.read (UnsupportedLiteral : M.Val f32.t) in - let* α6 : u8.t := M.call (f32.t::["to_int_unchecked"] α5) in + let* α6 : u8.t := M.call (impl f32.t "to_int_unchecked" α5) in let* α7 : M.Val u8.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -407,17 +407,17 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : f32.t := M.read (UnsupportedLiteral : M.Val f32.t) in - let* α6 : u8.t := M.call (f32.t::["to_int_unchecked"] α5) in + let* α6 : u8.t := M.call (impl f32.t "to_int_unchecked" α5) in let* α7 : M.Val u8.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in @@ -431,17 +431,17 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : f32.t := M.read core.f32.NAN in - let* α6 : u8.t := M.call (f32.t::["to_int_unchecked"] α5) in + let* α6 : u8.t := M.call (impl f32.t "to_int_unchecked" α5) in let* α7 : M.Val u8.t := M.alloc α6 in let* α8 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α7)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α7)) in let* α9 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α8 ] in let* α10 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α9) in let* α11 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α10) in let* α12 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α11) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α11) in let* α13 : unit := M.call (std.io.stdio._print α12) in M.alloc α13 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/types/inference.v b/CoqOfRust/examples/default/examples/types/inference.v index b5e36a15d..2fec068d2 100644 --- a/CoqOfRust/examples/default/examples/types/inference.v +++ b/CoqOfRust/examples/default/examples/types/inference.v @@ -24,13 +24,13 @@ Definition main : M unit := let* elem : M.Val u8.t := M.alloc ((Integer.of_Z 5) : u8.t) in let* vec : M.Val (alloc.vec.Vec.t u8.t alloc.alloc.Global.t) := let* α0 : alloc.vec.Vec.t u8.t alloc.alloc.Global.t := - M.call (alloc.vec.Vec.t u8.t alloc.alloc.Global.t)::["new"] in + M.call (impl (alloc.vec.Vec.t u8.t alloc.alloc.Global.t) "new") in M.alloc α0 in let* _ : M.Val unit := let* α0 : u8.t := M.read elem in let* α1 : unit := M.call - ((alloc.vec.Vec.t u8.t alloc.alloc.Global.t)::["push"] + (impl (alloc.vec.Vec.t u8.t alloc.alloc.Global.t) "push" (borrow_mut vec) α0) in M.alloc α1 in @@ -44,14 +44,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow vec)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow vec)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/types/literals.v b/CoqOfRust/examples/default/examples/types/literals.v index 7661ac4b3..6034446ea 100644 --- a/CoqOfRust/examples/default/examples/types/literals.v +++ b/CoqOfRust/examples/default/examples/types/literals.v @@ -39,14 +39,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow x)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -62,14 +62,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow y)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -85,14 +85,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow z)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -108,14 +108,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow i)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in @@ -131,14 +131,14 @@ Definition main : M unit := let* α5 : usize.t := M.call (core.mem.size_of_val (borrow f)) in let* α6 : M.Val usize.t := M.alloc α5 in let* α7 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow α6)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow α6)) in let* α8 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α7 ] in let* α9 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α8) in let* α10 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α9) in let* α11 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α10) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α10) in let* α12 : unit := M.call (std.io.stdio._print α11) in M.alloc α12 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/unsafe_operations/calling_unsafe_functions.v b/CoqOfRust/examples/default/examples/unsafe_operations/calling_unsafe_functions.v index 176ad0844..de97f0d1d 100644 --- a/CoqOfRust/examples/default/examples/unsafe_operations/calling_unsafe_functions.v +++ b/CoqOfRust/examples/default/examples/unsafe_operations/calling_unsafe_functions.v @@ -31,18 +31,18 @@ Definition main : M unit := let* α2 : alloc.boxed.Box.t (slice u32.t) alloc.alloc.Global.t := M.read (pointer_coercion "Unsize" α1) in let* α3 : alloc.vec.Vec.t u32.t alloc.alloc.Global.t := - M.call ((slice u32.t)::["into_vec"] α2) in + M.call (impl (slice u32.t) "into_vec" α2) in M.alloc α3 in let* pointer : M.Val (ref u32.t) := let* α0 : ref u32.t := M.call - ((alloc.vec.Vec.t u32.t alloc.alloc.Global.t)::["as_ptr"] + (impl (alloc.vec.Vec.t u32.t alloc.alloc.Global.t) "as_ptr" (borrow some_vector)) in M.alloc α0 in let* length : M.Val usize.t := let* α0 : usize.t := M.call - ((alloc.vec.Vec.t u32.t alloc.alloc.Global.t)::["len"] + (impl (alloc.vec.Vec.t u32.t alloc.alloc.Global.t) "len" (borrow some_vector)) in M.alloc α0 in let* my_slice : M.Val (ref (slice u32.t)) := @@ -54,7 +54,7 @@ Definition main : M unit := let* _ : M.Val unit := let* α0 : ref (slice u32.t) := M.call - ((alloc.vec.Vec.t u32.t alloc.alloc.Global.t)::["as_slice"] + (impl (alloc.vec.Vec.t u32.t alloc.alloc.Global.t) "as_slice" (borrow some_vector)) in let* α1 : M.Val (ref (slice u32.t)) := M.alloc α0 in let* α2 : M.Val ((ref (ref (slice u32.t))) * (ref (ref (slice u32.t)))) := diff --git a/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_clobbered_registers.v b/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_clobbered_registers.v index 8f43401aa..9349713b5 100644 --- a/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_clobbered_registers.v +++ b/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_clobbered_registers.v @@ -50,9 +50,9 @@ Definition main : M unit := M.call (core.str.converts.from_utf8 α1) in let* α3 : ref str.t := M.call - ((core.result.Result.t - (ref str.t) - core.str.error.Utf8Error.t)::["unwrap"] + (impl + (core.result.Result.t (ref str.t) core.str.error.Utf8Error.t) + "unwrap" α2) in M.alloc α3 in let* _ : M.Val unit := @@ -65,14 +65,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow name)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow name)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v b/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v index d31af3421..2e281d45c 100644 --- a/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v +++ b/CoqOfRust/examples/default/examples/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v @@ -51,14 +51,14 @@ Definition foo (arg : i32.t) : M i32.t := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow arg)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow arg)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/variable_bindings/declare_first.v b/CoqOfRust/examples/default/examples/variable_bindings/declare_first.v index a57e1607d..90d8b0ebd 100644 --- a/CoqOfRust/examples/default/examples/variable_bindings/declare_first.v +++ b/CoqOfRust/examples/default/examples/variable_bindings/declare_first.v @@ -47,14 +47,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_display"] (borrow a_binding)) in + M.call (impl core.fmt.rt.Argument.t "new_display" (borrow a_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -71,14 +71,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow another_binding)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow another_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/variable_bindings/mutability.v b/CoqOfRust/examples/default/examples/variable_bindings/mutability.v index 26c2b3140..1ff5a1a14 100644 --- a/CoqOfRust/examples/default/examples/variable_bindings/mutability.v +++ b/CoqOfRust/examples/default/examples/variable_bindings/mutability.v @@ -33,14 +33,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow mutable_binding)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow mutable_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -60,14 +61,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow mutable_binding)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow mutable_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/variable_bindings/scope.v b/CoqOfRust/examples/default/examples/variable_bindings/scope.v index 24a470c58..70152b5a0 100644 --- a/CoqOfRust/examples/default/examples/variable_bindings/scope.v +++ b/CoqOfRust/examples/default/examples/variable_bindings/scope.v @@ -39,7 +39,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow short_lived_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -47,7 +47,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -63,7 +63,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow long_lived_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -71,7 +71,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/variable_bindings/variable_bindings.v b/CoqOfRust/examples/default/examples/variable_bindings/variable_bindings.v index 027607502..2bbe186aa 100644 --- a/CoqOfRust/examples/default/examples/variable_bindings/variable_bindings.v +++ b/CoqOfRust/examples/default/examples/variable_bindings/variable_bindings.v @@ -40,14 +40,14 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_debug"] (borrow copied_integer)) in + (impl core.fmt.rt.Argument.t "new_debug" (borrow copied_integer)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -61,14 +61,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow a_boolean)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow a_boolean)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -82,14 +82,14 @@ Definition main : M unit := let* α4 : ref (slice (ref str.t)) := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := - M.call (core.fmt.rt.Argument.t::["new_debug"] (borrow unit_)) in + M.call (impl core.fmt.rt.Argument.t "new_debug" (borrow unit_)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/examples/default/examples/variable_bindings/variable_shadowing.v b/CoqOfRust/examples/default/examples/variable_bindings/variable_shadowing.v index d9e018ac8..bfe43c08c 100644 --- a/CoqOfRust/examples/default/examples/variable_bindings/variable_shadowing.v +++ b/CoqOfRust/examples/default/examples/variable_bindings/variable_shadowing.v @@ -35,7 +35,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow shadowed_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -43,7 +43,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -59,7 +59,7 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] + (impl core.fmt.rt.Argument.t "new_display" (borrow shadowed_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := @@ -67,7 +67,7 @@ Definition main : M unit := let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -83,14 +83,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow shadowed_binding)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow shadowed_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in @@ -106,14 +107,15 @@ Definition main : M unit := M.read (pointer_coercion "Unsize" α3) in let* α5 : core.fmt.rt.Argument.t := M.call - (core.fmt.rt.Argument.t::["new_display"] (borrow shadowed_binding)) in + (impl core.fmt.rt.Argument.t "new_display" + (borrow shadowed_binding)) in let* α6 : M.Val (array core.fmt.rt.Argument.t) := M.alloc [ α5 ] in let* α7 : M.Val (ref (array core.fmt.rt.Argument.t)) := M.alloc (borrow α6) in let* α8 : ref (slice core.fmt.rt.Argument.t) := M.read (pointer_coercion "Unsize" α7) in let* α9 : core.fmt.Arguments.t := - M.call (core.fmt.Arguments.t::["new_v1"] α4 α8) in + M.call (impl core.fmt.Arguments.t "new_v1" α4 α8) in let* α10 : unit := M.call (std.io.stdio._print α9) in M.alloc α10 in M.alloc tt in diff --git a/CoqOfRust/lib/lib.v b/CoqOfRust/lib/lib.v index 8ff90016a..eb52f018e 100644 --- a/CoqOfRust/lib/lib.v +++ b/CoqOfRust/lib/lib.v @@ -38,11 +38,7 @@ Notation "e1 ::[ e2 ]" := (Notations.double_colon e1 e2) Notation "e1 ::type[ e2 ]" := (Notations.double_colon_type e1 e2) (at level 0). -Definition defaultType (T : option Set) (Default : Set) : Set := - match T with - | Some T => T - | None => Default - end. +Parameter impl : forall {A : Set}, Set -> string -> A. Parameter axiom : forall {A : Set}, A. diff --git a/lib/src/coq.rs b/lib/src/coq.rs index cef88fe34..75f0190bc 100644 --- a/lib/src/coq.rs +++ b/lib/src/coq.rs @@ -100,6 +100,9 @@ pub(crate) enum DefinitionKind<'a> { /// an opaque constant /// (using `Parameter`) Assumption { ty: Expression<'a> }, + /// a Coq axiom + /// (using `Axiom`) + Axiom { ty: Expression<'a> }, /// a definition with an `exact` tactic Ltac { args: Vec, @@ -179,6 +182,10 @@ pub(crate) enum Expression<'a> { /// the expression for the resulting type image: Rc>, }, + Equality { + lhs: Rc>, + rhs: Rc>, + }, /// a product of two variables (they can be types or numbers) Product { /// left hand side @@ -569,6 +576,11 @@ impl<'a> Definition<'a> { nest([text(":"), line(), ty.to_doc(false)]), text("."), ]), + DefinitionKind::Axiom { ty } => nest([ + nest([text("Axiom"), line(), text(self.name.to_owned()), line()]), + nest([text(":"), line(), ty.to_doc(false)]), + text("."), + ]), DefinitionKind::Ltac { args, body } => nest([ nest([ nest([text("Ltac"), line(), text(self.name.to_owned())]), @@ -968,6 +980,16 @@ impl<'a> Expression<'a> { ]), ), ), + Self::Equality { lhs, rhs } => paren( + with_paren, + nest([ + lhs.to_doc(false), + line(), + text("="), + line(), + rhs.to_doc(false), + ]), + ), Self::Product { lhs, rhs } => paren( with_paren, group([ diff --git a/lib/src/expression.rs b/lib/src/expression.rs index 5e40c263a..e366e27ce 100644 --- a/lib/src/expression.rs +++ b/lib/src/expression.rs @@ -818,12 +818,18 @@ impl ExprKind { ]), text("))"), ]), - ExprKind::AssociatedFunction { ty, func } => nest([ - ty.to_coq().to_doc(true), - text("::["), - text(format!("\"{func}\"")), - text("]"), - ]), + ExprKind::AssociatedFunction { ty, func } => paren( + with_paren, + nest([ + text("impl"), + line(), + ty.to_coq().to_doc(true), + line(), + text("\""), + text(func), + text("\""), + ]), + ), ExprKind::Literal(literal, ty) => match ty { None => literal.to_doc(with_paren), Some(ty) => paren( @@ -844,13 +850,15 @@ impl ExprKind { from_user, } => { let inner_with_paren = with_paren || *from_user; + let is_func_impl = + matches!(func.kind.as_ref(), ExprKind::AssociatedFunction { .. }); let inner_application = optional_insert_with( args.is_empty(), func.to_doc(inner_with_paren), paren( inner_with_paren, nest([ - func.to_doc(true), + func.to_doc(!is_func_impl), concat(args.iter().map(|arg| concat([line(), arg.to_doc(true)]))), ]), ), diff --git a/lib/src/top_level.rs b/lib/src/top_level.rs index 3e3c5b835..facfde2f3 100644 --- a/lib/src/top_level.rs +++ b/lib/src/top_level.rs @@ -1672,14 +1672,44 @@ impl ImplItemKind { ImplItemKind::Definition { definition, .. } => coq::TopLevel::new(&[ coq::TopLevelItem::Code(definition.to_doc(name, None)), coq::TopLevelItem::Line, - Self::class_instance_to_coq( - "AssociatedFunction", - name, - Some(&definition.ty_params), - Some(&definition.where_predicates), - "Notations.DoubleColon Self", - "Notations.double_colon", - ), + coq::TopLevelItem::Definition(coq::Definition::new( + &format!("{name}_is_impl"), + &coq::DefinitionKind::Axiom { + ty: coq::Expression::PiType { + args: if definition.ty_params.is_empty() { + vec![] + } else { + vec![coq::ArgDecl::new( + &coq::ArgDeclVar::Simple { + idents: definition.ty_params.clone(), + ty: Some(coq::Expression::Set), + }, + coq::ArgSpecKind::Implicit, + )] + }, + image: Rc::new(coq::Expression::Equality { + lhs: Rc::new(coq::Expression::just_name("impl").apply_many(&[ + coq::Expression::just_name("Self"), + coq::Expression::String(name.to_string()), + ])), + rhs: Rc::new( + coq::Expression::just_name(name).apply_many_args( + &definition + .ty_params + .iter() + .map(|ty_param| { + ( + Some(ty_param.clone()), + coq::Expression::just_name(ty_param), + ) + }) + .collect::>(), + ), + ), + }), + }, + }, + )), ]), ImplItemKind::Type { ty } => { coq::TopLevel::new(&[coq::TopLevelItem::Definition(coq::Definition::new(