diff --git a/CoqOfRust/CoqOfRust.v b/CoqOfRust/CoqOfRust.v index b3bfca405..2d596902a 100644 --- a/CoqOfRust/CoqOfRust.v +++ b/CoqOfRust/CoqOfRust.v @@ -32,7 +32,6 @@ Require Export CoqOfRust.lib.lib. Export List.ListNotations. Require Export CoqOfRust.M. -Export M.Notations. Parameter pointer_coercion : string -> Value.t -> Value.t. diff --git a/CoqOfRust/M.v b/CoqOfRust/M.v index 568073908..3a87593b8 100644 --- a/CoqOfRust/M.v +++ b/CoqOfRust/M.v @@ -97,6 +97,17 @@ Module Integer. End Integer. Module Pointer. + Module Address. + (** The type [Value] is know just after as [Value.t], but not defined here yet. *) + Inductive t (Value : Set) : Set := + | Null + | Immediate (value : Value) + | Mutable {Address : Set} (address : Address). + Arguments Null {_}. + Arguments Immediate {_}. + Arguments Mutable {_ _}. + End Address. + Module Index. (** We are very explicit for the indexes, so that if the target is mutated and the index does not make any sense anymore we can detect it. This @@ -116,10 +127,20 @@ Module Pointer. End Path. Inductive t (Value : Set) : Set := - | Immediate (value : Value) - | Mutable {Address : Set} (address : Address) (path : Path.t). - Arguments Immediate {_}. - Arguments Mutable {_ _}. + (** The field [to_value] does not change the runtime semantics, but is here for instrumentation to + relate the semantics of the untyped mode to the semantics of the type mode. This is the + function to go from the typed space to the untyped [Value.t] space. + + It is set once and for all at the creation of the pointer (allocation). When creating a + pointer to a sub-field (extending the [path]) we keep the same [to_value] function. *) + | Make {Big_A A : Set} + (big_to_value : Big_A -> Value) + (to_value : A -> Value) + (projection : Big_A -> option A) + (injection : Big_A -> A -> option Big_A) + (address : Address.t Value) + (path : Path.t). + Arguments Make {_ _ _}. End Pointer. Module Value. @@ -201,6 +222,15 @@ Module Value. end end. + Lemma read_path_suffix_eq + (value : Value.t) (path1 path2 : Pointer.Path.t) : + read_path value (path1 ++ path2) = + match read_path value path1 with + | Some value => read_path value path2 + | None => None + end. + Admitted. + (** Update the part of a value at a certain [path], and return [None] if the path is of invalid shape. *) Fixpoint write_value @@ -305,8 +335,9 @@ End Value. Module Primitive. Inductive t : Set := | StateAlloc (value : Value.t) - | StateRead {Address : Set} (address : Address) - | StateWrite {Address : Set} (address : Address) (value : Value.t) + | StateRead (pointer : Pointer.t Value.t) + | StateWrite (pointer : Pointer.t Value.t) (update : Value.t) + | MakeSubPointer (pointer : Pointer.t Value.t) (index : Pointer.Index.t) | EnvRead | GetFunction (path : string) (generic_tys : list Ty.t) | GetAssociatedFunction (ty : Ty.t) (name : string) (generic_tys : list Ty.t) @@ -416,6 +447,12 @@ Module Option. | Some x => f x | None => None end. + + Definition map {A B : Set} (x : option A) (f : A -> B) : option B := + match x with + | Some x => Some (f x) + | None => None + end. End Option. (** This parameter is used as a marker to allow a monadic notation @@ -508,6 +545,9 @@ Definition break_match : M := Definition panic (message : string) : M := raise (Exception.Panic message). +Definition impossible : M := + LowM.Impossible. + Definition call_closure (f : Value.t) (args : list Value.t) : M := LowM.CallClosure f args LowM.Pure. @@ -520,26 +560,14 @@ Definition alloc (v : Value.t) : M := Definition read (r : Value.t) : M := match r with - | Value.Pointer (Pointer.Immediate v) => LowM.Pure (inl v) - | Value.Pointer (Pointer.Mutable address path) => - let* v := call_primitive (Primitive.StateRead address) in - match Value.read_path v path with - | Some v => LowM.Pure (inl v) - | None => LowM.Impossible - end - | _ => LowM.Impossible + | Value.Pointer pointer => call_primitive (Primitive.StateRead pointer) + | _ => impossible end. Definition write (r : Value.t) (update : Value.t) : M := match r with - | Value.Pointer (Pointer.Immediate _) => LowM.Impossible - | Value.Pointer (Pointer.Mutable address path) => - let* value := call_primitive (Primitive.StateRead address) in - match Value.write_value value path update with - | Some value => call_primitive (Primitive.StateWrite address value) - | None => LowM.Impossible - end - | _ => LowM.Impossible + | Value.Pointer pointer => call_primitive (Primitive.StateWrite pointer update) + | _ => impossible end. Definition copy (r : Value.t) : M := @@ -549,9 +577,6 @@ Definition copy (r : Value.t) : M := Definition read_env : M := call_primitive Primitive.EnvRead. -Definition impossible : M := - LowM.Impossible. - Parameter get_constant : string -> M. Definition get_function (path : string) (generic_tys : list Ty.t) : M := @@ -672,69 +697,62 @@ Definition never_to_any (x : Value.t) : M := Definition use (x : Value.t) : Value.t := x. +Definition closure (f : list Value.t -> M) : Value.t := + Value.Closure (existS (Value.t, M) f). + (** An error should not occur as we statically know the number of fields in a tuple, but the code for the error branch is still there for typing and debugging reasons. *) -Definition get_tuple_field (value : Value.t) (index : Z) : Value.t := - match value with - | Value.Pointer pointer => - match pointer with - | Pointer.Immediate value => - match value with - | Value.Tuple fields => - match List.nth_error fields (Z.to_nat index) with - | Some field => Value.Pointer (Pointer.Immediate field) - | None => Value.Error "invalid tuple index" - end - | _ => Value.Error "expected a tuple" - end - | Pointer.Mutable address path => - let new_path := path ++ [Pointer.Index.Tuple index] in - Value.Pointer (Pointer.Mutable address new_path) - end +Definition get_tuple_field (value : Value.t) (index : Z) : Value.t. +Admitted. + (* match value with + | Value.Pointer to_value {| Pointer.address := address; Pointer.path := path |} => + let new_path := path ++ [Pointer.Index.Tuple index] in + Value.Pointer to_value {| Pointer.address := address; Pointer.path := new_path |} | _ => Value.Error "expected an address" - end. + end. *) (** This function might fail, in case the [index] is out of range. *) -Definition get_array_field (value : Value.t) (index : Value.t) : M := +Parameter get_array_field : forall (value : Value.t) (index : Value.t), M. +(* Definition get_array_field (value : Value.t) (index : Value.t) : M := let* index := read index in match index with | Value.Integer Integer.Usize index => match value with - | Value.Pointer pointer => + | Value.Pointer to_value pointer => match pointer with | Pointer.Immediate value => match value with | Value.Array fields => (* As this is in `usize`, the index is necessarily positive. *) match List.nth_error fields (Z.to_nat index) with - | Some field => pure (Value.Pointer (Pointer.Immediate field)) + | Some field => pure (Value.Pointer to_value (Pointer.Immediate field)) | None => panic "invalid array index" end | _ => pure (Value.Error "expected an array") end | Pointer.Mutable address path => let new_path := path ++ [Pointer.Index.Array index] in - pure (Value.Pointer (Pointer.Mutable address new_path)) + pure (Value.Pointer to_value (Pointer.Mutable address new_path)) end | _ => pure (Value.Error "expected an address") end | _ => pure (Value.Error "Expected a usize as an array index") - end. + end. *) -(** Same as for [get_tuple_field], an error should not occur. *) -Definition get_struct_tuple_field +Parameter get_struct_tuple_field : forall (constructor : string) (index : Z), Value.t. +(* Definition get_struct_tuple_field (value : Value.t) (constructor : string) (index : Z) : Value.t := match value with - | Value.Pointer pointer => + | Value.Pointer to_value pointer => match pointer with | Pointer.Immediate value => match value with | Value.StructTuple current_constructor fields => if String.eqb current_constructor constructor then match List.nth_error fields (Z.to_nat index) with - | Some value => Value.Pointer (Pointer.Immediate value) + | Some value => Value.Pointer to_value (Pointer.Immediate value) | None => Value.Error "field not found" end else @@ -743,48 +761,39 @@ Definition get_struct_tuple_field end | Pointer.Mutable address path => let new_path := path ++ [Pointer.Index.StructTuple constructor index] in - Value.Pointer (Pointer.Mutable address new_path) + Value.Pointer to_value (Pointer.Mutable address new_path) end | _ => Value.Error "expected an address" + end. *) + +Definition get_struct_record_field_closure (constructor field : string) (args : list Value.t) : M := + match args with + | [Value.Pointer pointer] => + call_primitive (Primitive.MakeSubPointer + pointer + (Pointer.Index.StructRecord constructor field) + ) + | _ => impossible end. -(** Same as for [get_tuple_field], an error should not occur. *) -Definition get_struct_record_field - (value : Value.t) (constructor field : string) : - Value.t := - match value with - | Value.Pointer (Pointer.Immediate value) => - match value with - | Value.StructRecord current_constructor fields => - if String.eqb current_constructor constructor then - match List.assoc fields field with - | Some value => Value.Pointer (Pointer.Immediate value) - | None => Value.Error "field not found" - end - else - Value.Error "different values of constructor" - | _ => Value.Error "not a struct record" - end - | Value.Pointer (Pointer.Mutable address path) => - let new_path := path ++ [Pointer.Index.StructRecord constructor field] in - Value.Pointer (Pointer.Mutable address new_path) - | _ => Value.Error "expected an address" - end. +Definition get_struct_record_field (constructor field : string) : Value.t := + closure (get_struct_record_field_closure constructor field). Parameter pointer_coercion : Value.t -> Value.t. Definition get_struct_tuple_field_or_break_match (value : Value.t) (constructor : string) (index : Z) : - M := - match value with - | Value.Pointer pointer => + M. +Admitted. + (* match value with + | Value.Pointer to_value pointer => match pointer with | Pointer.Immediate value => match value with | Value.StructTuple current_constructor fields => if String.eqb current_constructor constructor then match List.nth_error fields (Z.to_nat index) with - | Some value => pure (Value.Pointer (Pointer.Immediate value)) + | Some value => pure (Value.Pointer to_value (Pointer.Immediate value)) | None => M.impossible end else @@ -800,7 +809,7 @@ Definition get_struct_tuple_field_or_break_match if String.eqb current_constructor constructor then let new_path := path ++ [Pointer.Index.StructTuple constructor index] in - pure (Value.Pointer (Pointer.Mutable address new_path)) + pure (Value.Pointer to_value (Pointer.Mutable address new_path)) else break_match | _ => M.impossible @@ -808,20 +817,21 @@ Definition get_struct_tuple_field_or_break_match end end | _ => M.impossible - end. + end. *) Definition get_struct_record_field_or_break_match (value : Value.t) (constructor field : string) : - M := - match value with - | Value.Pointer pointer => + M. +Admitted. + (* match value with + | Value.Pointer to_value pointer => match pointer with | Pointer.Immediate value => match value with | Value.StructRecord current_constructor fields => if String.eqb current_constructor constructor then match List.assoc fields field with - | Some value => pure (Value.Pointer (Pointer.Immediate value)) + | Some value => pure (Value.Pointer to_value (Pointer.Immediate value)) | None => M.impossible end else @@ -837,7 +847,7 @@ Definition get_struct_record_field_or_break_match if String.eqb current_constructor constructor then let new_path := path ++ [Pointer.Index.StructRecord constructor field] in - pure (Value.Pointer (Pointer.Mutable address new_path)) + pure (Value.Pointer to_value (Pointer.Mutable address new_path)) else break_match | _ => M.impossible @@ -845,7 +855,7 @@ Definition get_struct_record_field_or_break_match end end | _ => M.impossible - end. + end. *) Definition is_constant_or_break_match (value expected_value : Value.t) : M := if Value.eqb value expected_value then @@ -871,9 +881,6 @@ Parameter get_slice_rest_or_break_match : integers. *) Parameter rust_cast : Value.t -> Value.t. -Definition closure (f : list Value.t -> M) : Value.t := - Value.Closure (existS (Value.t, M) f). - Definition constructor_as_closure (constructor : string) : Value.t := closure (fun args => pure (Value.StructTuple constructor args)). diff --git a/CoqOfRust/blacklist.txt b/CoqOfRust/blacklist.txt index 6d1a02d7e..26a62706b 100644 --- a/CoqOfRust/blacklist.txt +++ b/CoqOfRust/blacklist.txt @@ -1,3 +1,6 @@ +alloc/ +core/ +move/ alloc/boxed.v core/any.v core/array/mod.v diff --git a/CoqOfRust/examples/axiomatized/examples/custom/add_one.v b/CoqOfRust/examples/axiomatized/examples/custom/add_one.v index 986d5675c..bf2452fd2 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/add_one.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/add_one.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter add_one : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/custom/constructor_as_function.v b/CoqOfRust/examples/axiomatized/examples/custom/constructor_as_function.v index 2120daa08..b3b0cbf1d 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/constructor_as_function.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/constructor_as_function.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter matching : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/custom/hello_world.v b/CoqOfRust/examples/axiomatized/examples/custom/hello_world.v index 15a7f815c..24c422a32 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/hello_world.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/hello_world.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter message : Value.t. diff --git a/CoqOfRust/examples/axiomatized/examples/custom/if_let.v b/CoqOfRust/examples/axiomatized/examples/custom/if_let.v index a22c93b58..80076c538 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/if_let.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/if_let.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter order : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/custom/impl_param.v b/CoqOfRust/examples/axiomatized/examples/custom/impl_param.v index a7fa611ee..944e890a2 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/impl_param.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/impl_param.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter with_impls : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/custom/module_duplicate.v b/CoqOfRust/examples/axiomatized/examples/custom/module_duplicate.v index 9bc0b2494..f56adcc45 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/module_duplicate.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/module_duplicate.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module foo. Module gre. diff --git a/CoqOfRust/examples/axiomatized/examples/custom/mutual_loop.v b/CoqOfRust/examples/axiomatized/examples/custom/mutual_loop.v index 70eb1dc21..f65b34fd5 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/mutual_loop.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/mutual_loop.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/custom/pattern_in_function_parameters.v b/CoqOfRust/examples/axiomatized/examples/custom/pattern_in_function_parameters.v index 7fdc7ae38..e79d69f24 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/pattern_in_function_parameters.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/pattern_in_function_parameters.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter sum : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/custom/polymorphic_associated_function.v b/CoqOfRust/examples/axiomatized/examples/custom/polymorphic_associated_function.v index 62b3f0f0c..4d9a15b74 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/polymorphic_associated_function.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/polymorphic_associated_function.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/custom/provided_method.v b/CoqOfRust/examples/axiomatized/examples/custom/provided_method.v index 3113a0148..49183b20f 100644 --- a/CoqOfRust/examples/axiomatized/examples/custom/provided_method.v +++ b/CoqOfRust/examples/axiomatized/examples/custom/provided_method.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) Module ProvidedAndRequired. 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 b5d950909..91e2033c9 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/basic_contract_caller.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/basic_contract_caller.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v index d5dd62699..e97d5cce0 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/call_runtime.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v index 320e0abf8..7f86d363d 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/conditional_compilation.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v index 9665cef03..327763b20 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_terminate.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v index ebe681bb9..e00fa41ee 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/contract_transfer.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v index a3556d5c5..11a641e5b 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_allocator.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v index 7ab5cf2a8..c6a7c0713 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/custom_environment.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v index 311284135..d05694184 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/dns.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { 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 e410b0226..b89f05e25 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/e2e_call_runtime.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/e2e_call_runtime.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v index 2e198bb7d..ef887c49d 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc1155.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v index 144fc78ef..f3f2a0049 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc20.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v index 2425a2ad4..bd80dd47c 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/erc721.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v index ad9be484a..892213400 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/flipper.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v index f67051ae7..5761fb76e 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/incrementer.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { 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 673e9ed1e..29fcb9e69 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { 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 69f472490..5a434522e 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom Hash : (Ty.path "call_builder_delegate::Hash") = (Ty.apply (Ty.path "array") [ Ty.path "u8" ]). 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 637329d57..18eb2493e 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { 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 6b0e22145..6a1a070a1 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { 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 56dc5246f..2d4acd077 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { 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 012c95204..9028957e9 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/mapping_integration_tests.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/mapping_integration_tests.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v index d113ef885..72f65a433 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/mother.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v index 1ff8fa0a0..f0bec5f9c 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/multisig.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v index 6077c79cb..3b9166b1d 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/payment_channel.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { 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 6e601253c..9a909e6f5 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/set_code_hash.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Error 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 5fb12b769..c7796a547 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v index 9ce0910b2..ca3c3b459 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_erc20.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v index 6505e5214..28098cff6 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_flipper.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Flip' *) diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v index 1da3518a1..27bce4ce5 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/trait_incrementer.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Increment' *) diff --git a/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v b/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v index 935cb0544..a53c12edf 100644 --- a/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v +++ b/CoqOfRust/examples/axiomatized/examples/ink_contracts/wildcard_selector.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter decode_input : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example01.v b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example01.v index 67b04ee02..2b74b1fa2 100644 --- a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example01.v +++ b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example01.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter id : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example02.v b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example02.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example02.v +++ b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example02.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example03.v b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example03.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example03.v +++ b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example03.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example04.v b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example04.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example04.v +++ b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example04.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v index 31338a555..08e27b1ff 100644 --- a/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v +++ b/CoqOfRust/examples/axiomatized/examples/monadic_transformation/example05.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/attributes/dead_code.v b/CoqOfRust/examples/axiomatized/examples/rust_book/attributes/dead_code.v index a5bc42ca5..aa35b3386 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/attributes/dead_code.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/attributes/dead_code.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter used_function : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/cargo/concurrent_tests.v b/CoqOfRust/examples/axiomatized/examples/rust_book/cargo/concurrent_tests.v index 208727c5b..1f9115365 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/cargo/concurrent_tests.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/cargo/concurrent_tests.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter foo : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/converting_to_string.v b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/converting_to_string.v index 920a6bfdc..4ddda62ed 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/converting_to_string.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/converting_to_string.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/from.v b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/from.v index f36791ccf..3d6e96df1 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/from.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/from.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/into.v b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/into.v index 933a6f150..f6a3029ae 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/into.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/into.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/parsing_a_string.v b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/parsing_a_string.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/parsing_a_string.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/parsing_a_string.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/try_from_and_try_into.v b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/try_from_and_try_into.v index 196332e41..568ff68db 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/try_from_and_try_into.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/conversion/try_from_and_try_into.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/constants.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/constants.v index c91d36a03..352650d2e 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/constants.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/constants.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter value_LANGUAGE : Value.t. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums.v index 18e53c016..2d429d00b 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum WebEvent diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_c_like.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_c_like.v index 3c386b8a9..1d425fba9 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_c_like.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_c_like.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Number diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_testcase_linked_list.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_testcase_linked_list.v index d083eabc2..7125fad9b 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_testcase_linked_list.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_testcase_linked_list.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum List diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v1.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v1.v index 4da1b914f..2b4e9f47c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v1.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v1.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum VeryVerboseEnumOfThingsToDoWithNumbers diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v2.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v2.v index 81943e55f..726e20649 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v2.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_type_aliases_v2.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum VeryVerboseEnumOfThingsToDoWithNumbers diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_use.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_use.v index a9c2f2f55..a17ed7aaa 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_use.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/enums_use.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Status diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/structures.v b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/structures.v index 7659d8cec..8cde038ed 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/structures.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/custom_types/structures.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/aliases_for_result.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/aliases_for_result.v index 6701feff3..e5cdd24c6 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/aliases_for_result.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/aliases_for_result.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom AliasedResult : forall (T : Ty.t), diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/boxing_errors.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/boxing_errors.v index 2e45f3557..d0fa05f7d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/boxing_errors.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/boxing_errors.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom Result : forall (T : Ty.t), diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_and_then.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_and_then.v index 128adb766..d7b802e83 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_and_then.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_and_then.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Food diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_map.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_map.v index 76e7fb1b7..1c2d80713 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_map.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/combinators_map.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Food diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/defining_an_error_type.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/defining_an_error_type.v index 96697bafe..a5df3bd50 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/defining_an_error_type.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/defining_an_error_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/early_returns.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/early_returns.v index a4eee29c7..7dcacf56d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/early_returns.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/early_returns.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter multiply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark.v index a4eee29c7..7dcacf56d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter multiply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v index a4eee29c7..7dcacf56d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter multiply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_failed.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_failed.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_failed.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_failed.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_combinators.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_combinators.v index a4eee29c7..7dcacf56d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_combinators.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_combinators.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter multiply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_match.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_match.v index a4eee29c7..7dcacf56d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_match.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/map_in_result_via_match.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter multiply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/multiple_error_types.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/multiple_error_types.v index f8e090a30..7d6cfefcc 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/multiple_error_types.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/multiple_error_types.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter double_first : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/option_and_unwrap.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/option_and_unwrap.v index 3796a020e..5db339283 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/option_and_unwrap.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/option_and_unwrap.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter give_adult : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/other_uses_of_question_mark.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/other_uses_of_question_mark.v index 6f686a606..7446e62a2 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/other_uses_of_question_mark.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/other_uses_of_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom Result : forall (T : Ty.t), diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/panic.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/panic.v index 0cca8ff89..a20e03b15 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/panic.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/panic.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter drink : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options.v index f8e090a30..7d6cfefcc 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter double_first : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v index f8e090a30..7d6cfefcc 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter double_first : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/result_use_in_main.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/result_use_in_main.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/result_use_in_main.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/result_use_in_main.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v index b934512b1..e617139d6 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v index 85383ebd3..c1b1a00f7 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v index 619c03891..c15af2b6f 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v index fda9cd4ad..62cfcef0c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_via_question_mark.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_via_question_mark.v index bfc17fe38..a96ed2d85 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_via_question_mark.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/unpacking_options_via_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/wrapping_errors.v b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/wrapping_errors.v index 3b57a5579..5755b6d83 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/wrapping_errors.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/error_handling/wrapping_errors.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum DoubleError diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/blocks.v b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/blocks.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/blocks.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/blocks.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/const_underscore_expression.v b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/const_underscore_expression.v index b0113a251..9742436a9 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/const_underscore_expression.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/const_underscore_expression.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module underscore. (* StructRecord diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/statement.v b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/statement.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/statement.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/statement.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/variable_binding_and_expression.v b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/variable_binding_and_expression.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/variable_binding_and_expression.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/expressions/variable_binding_and_expression.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_else.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_else.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_else.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_else.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_challenge.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_challenge.v index a11c00561..6154b7dd7 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_challenge.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_challenge.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Foo diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_dont_use_match.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_dont_use_match.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_dont_use_match.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_dont_use_match.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_match_enum_values.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_match_enum_values.v index 6324b6e9d..67d1e4267 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_match_enum_values.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/if_let_match_enum_values.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Foo diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/infinite_loop.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/infinite_loop.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/infinite_loop.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/infinite_loop.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_nesting_and_labels.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_nesting_and_labels.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_nesting_and_labels.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_nesting_and_labels.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_returning_from_loops.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_returning_from_loops.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_returning_from_loops.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/loop_returning_from_loops.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding.v index d69257563..fd1a63482 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter age : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v index 3290a1718..29e245813 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter some_number : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_enums.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_enums.v index 02e7cf5bc..31c284a8c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_enums.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_enums.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Color diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_structs.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_structs.v index 945c40403..42e6888c3 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_structs.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_structs.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards.v index 0ee0a5b86..f0070c764 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Temperature diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards_unreachable.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards_unreachable.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards_unreachable.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/match_guards_unreachable.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let_match_is_weird.v b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let_match_is_weird.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let_match_is_weird.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/flow_of_control/while_let_match_is_weird.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/associated_functions_and_methods.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/associated_functions_and_methods.v index 812e8c734..17fc820b7 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/associated_functions_and_methods.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/associated_functions_and_methods.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions.v index d7603def4..a6df08fc1 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v index b9cc8953a..f4d3d35fd 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v index bd9a6c068..c5917766f 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter some_fn : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions.v index c5db5b551..71a3ab91a 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter is_divisible_by : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_input_parameters.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_input_parameters.v index 01910e6c5..986d2d54a 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_input_parameters.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_input_parameters.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter apply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_output_parameters.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_output_parameters.v index 1baf2a0d0..f3508b1c1 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_output_parameters.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_as_output_parameters.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter create_fn : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_capturing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_capturing.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_capturing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_capturing.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_Iterator_any.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_Iterator_any.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_Iterator_any.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_Iterator_any.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_input_functions.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_input_functions.v index d7259e22e..306a98da6 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_input_functions.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_input_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter call_me : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define.v index a494e03e2..686d8252c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v index 893a21d57..52987e00c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter apply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_order.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_order.v index 981261918..c166a2b6d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_order.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/functions_order.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/higher_order_functions.v b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/higher_order_functions.v index 2456ea501..04664ce34 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/functions/higher_order_functions.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/functions/higher_order_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter is_odd : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics.v index a7f58b346..7d74d73ce 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_problem.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_problem.v index 4466decd2..354a3fdaa 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_problem.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_problem.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_solution.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_solution.v index 947002dcd..05132debb 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_solution.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_associated_types_solution.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds.v index 2b4802ea4..67c9f9931 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'HasArea' *) diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v index b9a9bdc9d..78ad33bf8 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_functions.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_functions.v index ee273b20e..a16e5518e 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_functions.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_implementation.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_implementation.v index 420d27974..15a944b05 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_implementation.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_implementation.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_multiple_bounds.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_multiple_bounds.v index c20f858d8..8a9eeec83 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_multiple_bounds.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_multiple_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter compare_prints : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom.v index d6777da25..bb93ca9c5 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v index 50f990080..547c39a4f 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type.v index 4de541c7b..962f905d0 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v index 8de494de0..ff4c9ba85 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Inch diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_traits.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_traits.v index 2da248e88..12f64d5ae 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_traits.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_where_clauses.v b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_where_clauses.v index 1efaab50c..1f2f88346 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_where_clauses.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/generics/generics_where_clauses.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'PrintInOption' *) diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/guessing_game/guessing_game.v b/CoqOfRust/examples/axiomatized/examples/rust_book/guessing_game/guessing_game.v index 35f5dddfe..c4faad033 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/guessing_game/guessing_game.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/guessing_game/guessing_game.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter gen_range : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/formatted_print.v b/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/formatted_print.v index 561a7290c..f0a95d6e9 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/formatted_print.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/formatted_print.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/hello_world.v b/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/hello_world.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/hello_world.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/hello_world/hello_world.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_example.v b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_example.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_example.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_example.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_designators.v b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_designators.v index d2812c0d7..f981cde8d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_designators.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_designators.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter foo : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_dsl.v b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_dsl.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_dsl.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_dsl.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_overload.v b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_overload.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_overload.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_overload.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_repeat.v b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_repeat.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_repeat.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_repeat.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/struct_visibility.v b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/struct_visibility.v index d37e0fb61..534537140 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/struct_visibility.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/struct_visibility.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module my. (* StructRecord diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/super_and_self.v b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/super_and_self.v index 6b41ba686..13620039e 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/super_and_self.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/super_and_self.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter function : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/the_use_as_declaration.v b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/the_use_as_declaration.v index 0fa9a2673..4090fab02 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/the_use_as_declaration.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/the_use_as_declaration.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter function : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/visibility.v b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/visibility.v index 841e44901..785c90513 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/modules/visibility.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/modules/visibility.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module my_mod. Parameter private_function : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/arrays_and_slices.v b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/arrays_and_slices.v index cd1e4ad4a..f77bd49c8 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/arrays_and_slices.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/arrays_and_slices.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter analyze_slice : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/compound_types.v b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/compound_types.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/compound_types.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/compound_types.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/literals_operators.v b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/literals_operators.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/literals_operators.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/literals_operators.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/tuples.v b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/tuples.v index e4f3a827b..3efc7c29f 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/tuples.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/primitives/tuples.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter reverse : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing.v index 655dce63d..c739f1f62 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter eat_box_i32 : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v index 6c232c5a8..c03db5ae6 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v index 04dfbcfd9..b490a4d70 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v index 78e76eaf3..d85d7516d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v index 78d89c3c0..329e9ba43 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v index 1b8e7700e..15032fa3b 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter multiply : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v index 2d3e1f433..34d26c7bb 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter elided_input : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v index 7b3dd52d8..8a3fa17f7 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter print_one : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v index 589147a0a..553a2b212 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v index 529acb278..9e81511d1 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter value_NUM : Value.t. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v index bd1358155..99f8a8e52 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v index 0f6934780..2bdd06225 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v index 30ebc2e3f..4025d54eb 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter destroy_box : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v index 743408cc1..c1166e499 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii.v index 8ad20f92b..ab8366b9b 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter create_box : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v index 30ffcf011..a0514ba1d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/arc.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/arc.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/arc.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/arc.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/box_stack_heap.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/box_stack_heap.v index 41e971168..6ddc9abfe 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/box_stack_heap.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/box_stack_heap.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map.v index 774d40789..a0bd17d93 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter call : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v index 36b98776a..6d9dfd5db 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_hash_set.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_hash_set.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_hash_set.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/hash_map_hash_set.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/option.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/option.v index a0a043304..c3a2b62ca 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/option.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/option.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter checked_division : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/panic.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/panic.v index 0d561a349..67a7da883 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/panic.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/panic.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter division : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/rc.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/rc.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/rc.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/rc.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result.v index 4e432da29..df430c958 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module checked. (* diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result_chaining_with_question_mark.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result_chaining_with_question_mark.v index 71f533fd7..9d3d4726b 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result_chaining_with_question_mark.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/result_chaining_with_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module checked. (* diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_literals_and_escapes.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_literals_and_escapes.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_literals_and_escapes.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_literals_and_escapes.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_raw_string_literals.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_raw_string_literals.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_raw_string_literals.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/strings_raw_string_literals.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/vectors.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/vectors.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/vectors.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_library_types/vectors.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/channels.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/channels.v index 078b67d5a..04812ed8d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/channels.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/channels.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter value_NTHREADS : Value.t. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_pipes.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_pipes.v index 146ae9caa..93e5885ec 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_pipes.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_pipes.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter value_PANGRAM : Value.t. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_wait.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_wait.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_wait.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/child_processes_wait.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_create.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_create.v index c53119360..17b22d569 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_create.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_create.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter value_LOREM_IPSUM : Value.t. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_open.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_open.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_open.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_open.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines.v index 73847250a..8e224e88b 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter read_lines : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v index 73847250a..8e224e88b 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter read_lines : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/filesystem_operations.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/filesystem_operations.v index 97580ab1b..ab52dcdec 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/filesystem_operations.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/filesystem_operations.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter cat : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/foreign_function_interface.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/foreign_function_interface.v index 70da26a20..582222a34 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/foreign_function_interface.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/foreign_function_interface.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Unhandled foreign module here *) diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/path.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/path.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/path.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/path.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments_parsing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments_parsing.v index d54ec7172..55c2d42f4 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments_parsing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/program_arguments_parsing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter increase : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads.v index 078b67d5a..04812ed8d 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter value_NTHREADS : Value.t. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads_test_case_map_reduce.v b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads_test_case_map_reduce.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads_test_case_map_reduce.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/std_misc/threads_test_case_map_reduce.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/testing/documentation_testing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/testing/documentation_testing.v index c6a606ada..33d73c087 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/testing/documentation_testing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/testing/documentation_testing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter add : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/testing/unit_testing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/testing/unit_testing.v index dd3b6359d..f91dfe5d6 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/testing/unit_testing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/testing/unit_testing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter add : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/clone.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/clone.v index 0eba4b298..f09110c35 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/clone.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/clone.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/derive.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/derive.v index 081936625..42f4197a7 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/derive.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/derive.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/disambiguating_overlapping_traits.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/disambiguating_overlapping_traits.v index 12b3475a9..add6ac2fe 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/disambiguating_overlapping_traits.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/disambiguating_overlapping_traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'UsernameWidget' *) diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/drop.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/drop.v index 75fc1f013..0048c9bbd 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/drop.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/drop.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/hash.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/hash.v index 55a299105..e4ddff578 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/hash.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/hash.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/impl_trait_as_return_type.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/impl_trait_as_return_type.v index 79e3c7930..c2cc8542f 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/impl_trait_as_return_type.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/impl_trait_as_return_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter combine_vecs_explicit_return_type : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/iterators.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/iterators.v index 38b593180..8a23b20bd 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/iterators.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/iterators.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/operator_overloading.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/operator_overloading.v index c67709f5e..8542a142e 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/operator_overloading.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/operator_overloading.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/returning_traits_with_dyn.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/returning_traits_with_dyn.v index f02cb5ca7..7f383ac4a 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/returning_traits_with_dyn.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/returning_traits_with_dyn.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/supertraits.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/supertraits.v index a0866c821..096ed0390 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/supertraits.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/supertraits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Person' *) diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits.v index 004a3910a..9ae8ff229 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits_parms.v b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits_parms.v index 1b69243ac..a51e40c2e 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits_parms.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/traits/traits_parms.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Foo' *) diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/types/aliasing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/types/aliasing.v index 627462428..e3b53998f 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/types/aliasing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/types/aliasing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom NanoSecond : (Ty.path "aliasing::NanoSecond") = (Ty.path "u64"). diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/types/casting.v b/CoqOfRust/examples/axiomatized/examples/rust_book/types/casting.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/types/casting.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/types/casting.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/types/inference.v b/CoqOfRust/examples/axiomatized/examples/rust_book/types/inference.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/types/inference.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/types/inference.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/types/literals.v b/CoqOfRust/examples/axiomatized/examples/rust_book/types/literals.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/types/literals.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/types/literals.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/calling_unsafe_functions.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/calling_unsafe_functions.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/calling_unsafe_functions.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/calling_unsafe_functions.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v index ad481d140..8f04c62d9 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inout.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inout.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inout.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inout.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_labels.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_labels.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_labels.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_labels.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v index 4bf2c70c6..d62cbea56 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_options.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_options.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_options.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_options.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v index 7731fb2af..0ba6507ac 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/raw_pointers.v b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/raw_pointers.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/raw_pointers.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/unsafe_operations/raw_pointers.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/declare_first.v b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/declare_first.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/declare_first.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/declare_first.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/freezing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/freezing.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/freezing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/freezing.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/mutability.v b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/mutability.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/mutability.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/mutability.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/scope.v b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/scope.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/scope.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/scope.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_bindings.v b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_bindings.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_bindings.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_bindings.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_shadowing.v b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_shadowing.v index cb8f119b6..26ddad53c 100644 --- a/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_shadowing.v +++ b/CoqOfRust/examples/axiomatized/examples/rust_book/variable_bindings/variable_shadowing.v @@ -1,4 +1,5 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Parameter main : (list Ty.t) -> (list Value.t) -> M. diff --git a/CoqOfRust/examples/axiomatized/examples/subtle.v b/CoqOfRust/examples/axiomatized/examples/subtle.v index 7ef7b576d..fc3da10a4 100644 --- a/CoqOfRust/examples/axiomatized/examples/subtle.v +++ b/CoqOfRust/examples/axiomatized/examples/subtle.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/custom/add_one.v b/CoqOfRust/examples/default/examples/custom/add_one.v index 5002081aa..81427f464 100644 --- a/CoqOfRust/examples/default/examples/custom/add_one.v +++ b/CoqOfRust/examples/default/examples/custom/add_one.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn add_one(x: u32) -> u32 { diff --git a/CoqOfRust/examples/default/examples/custom/constructor_as_function.v b/CoqOfRust/examples/default/examples/custom/constructor_as_function.v index 8b26af397..e3662024b 100644 --- a/CoqOfRust/examples/default/examples/custom/constructor_as_function.v +++ b/CoqOfRust/examples/default/examples/custom/constructor_as_function.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn matching(tuple: (i32, i32)) -> i32 { @@ -73,10 +74,10 @@ Module Impl_core_fmt_Debug_for_constructor_as_function_Constructor. (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field - (M.read (| self |)) - "constructor_as_function::Constructor" - 0 + M.call_closure (| + M.get_struct_tuple_field "constructor_as_function::Constructor" 0, + [ M.read (| self |) ] + |) |)) ] |))) diff --git a/CoqOfRust/examples/default/examples/custom/hello_world.v b/CoqOfRust/examples/default/examples/custom/hello_world.v index 3f6694c07..0f350b5d1 100644 --- a/CoqOfRust/examples/default/examples/custom/hello_world.v +++ b/CoqOfRust/examples/default/examples/custom/hello_world.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Definition message : Value.t := M.run ltac:(M.monadic (Value.String "Hello, World!")). diff --git a/CoqOfRust/examples/default/examples/custom/if_let.v b/CoqOfRust/examples/default/examples/custom/if_let.v index c38f46a00..05ab45634 100644 --- a/CoqOfRust/examples/default/examples/custom/if_let.v +++ b/CoqOfRust/examples/default/examples/custom/if_let.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn order(b1: bool, b2: bool, b3: bool, b4: bool) -> bool { diff --git a/CoqOfRust/examples/default/examples/custom/impl_param.v b/CoqOfRust/examples/default/examples/custom/impl_param.v index acc3f942b..fddbbb606 100644 --- a/CoqOfRust/examples/default/examples/custom/impl_param.v +++ b/CoqOfRust/examples/default/examples/custom/impl_param.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn with_impls(func: impl Default, func2: impl Default, foo: A) { diff --git a/CoqOfRust/examples/default/examples/custom/module_duplicate.v b/CoqOfRust/examples/default/examples/custom/module_duplicate.v index 132c0a3f3..df64b8534 100644 --- a/CoqOfRust/examples/default/examples/custom/module_duplicate.v +++ b/CoqOfRust/examples/default/examples/custom/module_duplicate.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module foo. Module gre. diff --git a/CoqOfRust/examples/default/examples/custom/mutual_loop.v b/CoqOfRust/examples/default/examples/custom/mutual_loop.v index 975d66d5f..26f8a9bf3 100644 --- a/CoqOfRust/examples/default/examples/custom/mutual_loop.v +++ b/CoqOfRust/examples/default/examples/custom/mutual_loop.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/custom/pattern_in_function_parameters.v b/CoqOfRust/examples/default/examples/custom/pattern_in_function_parameters.v index 5420c1ba9..6c63d10cf 100644 --- a/CoqOfRust/examples/default/examples/custom/pattern_in_function_parameters.v +++ b/CoqOfRust/examples/default/examples/custom/pattern_in_function_parameters.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn sum((x, y): (i32, i32)) -> i32 { diff --git a/CoqOfRust/examples/default/examples/custom/polymorphic_associated_function.v b/CoqOfRust/examples/default/examples/custom/polymorphic_associated_function.v index b4ba64624..d69041cbb 100644 --- a/CoqOfRust/examples/default/examples/custom/polymorphic_associated_function.v +++ b/CoqOfRust/examples/default/examples/custom/polymorphic_associated_function.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -33,7 +34,10 @@ Module Impl_polymorphic_associated_function_Foo_A. M.get_trait_method (| "core::convert::Into", A, [ B ], "into", [] |), [ M.read (| - M.get_struct_record_field self "polymorphic_associated_function::Foo" "data" + M.call_closure (| + M.get_struct_record_field "polymorphic_associated_function::Foo" "data", + [ self ] + |) |) ] |)) @@ -81,7 +85,10 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := M.alloc (| Value.Tuple [ - M.get_struct_record_field bar "polymorphic_associated_function::Foo" "data"; + M.call_closure (| + M.get_struct_record_field "polymorphic_associated_function::Foo" "data", + [ bar ] + |); UnsupportedLiteral ] |), diff --git a/CoqOfRust/examples/default/examples/custom/provided_method.v b/CoqOfRust/examples/default/examples/custom/provided_method.v index 0da55b997..a5067ff58 100644 --- a/CoqOfRust/examples/default/examples/custom/provided_method.v +++ b/CoqOfRust/examples/default/examples/custom/provided_method.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) Module ProvidedAndRequired. 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 17f84065b..097ca71d0 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/basic_contract_caller.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/basic_contract_caller.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -120,16 +121,16 @@ Module Impl_basic_contract_caller_OtherContract. M.read (| let _ := M.write (| - M.get_struct_record_field - (M.read (| self |)) - "basic_contract_caller::OtherContract" - "value", + M.call_closure (| + M.get_struct_record_field "basic_contract_caller::OtherContract" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "basic_contract_caller::OtherContract" - "value" + M.call_closure (| + M.get_struct_record_field "basic_contract_caller::OtherContract" "value", + [ M.read (| self |) ] + |) |)) |) in M.alloc (| Value.Tuple [] |) @@ -150,10 +151,10 @@ Module Impl_basic_contract_caller_OtherContract. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "basic_contract_caller::OtherContract" - "value" + M.call_closure (| + M.get_struct_record_field "basic_contract_caller::OtherContract" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -230,10 +231,12 @@ Module Impl_basic_contract_caller_BasicContractCaller. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "basic_contract_caller::BasicContractCaller" - "other_contract" + M.call_closure (| + M.get_struct_record_field + "basic_contract_caller::BasicContractCaller" + "other_contract", + [ M.read (| self |) ] + |) ] |) |) in @@ -245,10 +248,12 @@ Module Impl_basic_contract_caller_BasicContractCaller. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "basic_contract_caller::BasicContractCaller" - "other_contract" + M.call_closure (| + M.get_struct_record_field + "basic_contract_caller::BasicContractCaller" + "other_contract", + [ M.read (| self |) ] + |) ] |) |) diff --git a/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v b/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v index b4f34be5f..79f9060ef 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/call_runtime.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v b/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v index 8cbb2f8b7..0cb810444 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/conditional_compilation.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -136,7 +137,10 @@ Module Impl_conditional_compilation_Env. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "conditional_compilation::Env" "caller" + M.call_closure (| + M.get_struct_record_field "conditional_compilation::Env" "caller", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -307,16 +311,18 @@ Module Impl_conditional_compilation_ConditionalCompilation. M.read (| let _ := M.write (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value", + M.call_closure (| + M.get_struct_record_field "conditional_compilation::ConditionalCompilation" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value" + M.call_closure (| + M.get_struct_record_field + "conditional_compilation::ConditionalCompilation" + "value", + [ M.read (| self |) ] + |) |)) |) in let caller := @@ -368,10 +374,12 @@ Module Impl_conditional_compilation_ConditionalCompilation. [ ("new_value", M.read (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value" + M.call_closure (| + M.get_struct_record_field + "conditional_compilation::ConditionalCompilation" + "value", + [ M.read (| self |) ] + |) |)); ("by_", M.read (| caller |)) ] @@ -451,16 +459,18 @@ Module Impl_conditional_compilation_ConditionalCompilation. |) in let _ := M.write (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value", + M.call_closure (| + M.get_struct_record_field "conditional_compilation::ConditionalCompilation" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value" + M.call_closure (| + M.get_struct_record_field + "conditional_compilation::ConditionalCompilation" + "value", + [ M.read (| self |) ] + |) |)) |) in let _ := @@ -490,10 +500,12 @@ Module Impl_conditional_compilation_ConditionalCompilation. [ ("new_value", M.read (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value" + M.call_closure (| + M.get_struct_record_field + "conditional_compilation::ConditionalCompilation" + "value", + [ M.read (| self |) ] + |) |)); ("by_", M.read (| caller |)); ("when", M.read (| block_number |)) @@ -527,16 +539,18 @@ Module Impl_conditional_compilation_Flip_for_conditional_compilation_Conditional M.read (| let _ := M.write (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value", + M.call_closure (| + M.get_struct_record_field "conditional_compilation::ConditionalCompilation" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value" + M.call_closure (| + M.get_struct_record_field + "conditional_compilation::ConditionalCompilation" + "value", + [ M.read (| self |) ] + |) |)) |) in M.alloc (| Value.Tuple [] |) @@ -555,10 +569,10 @@ Module Impl_conditional_compilation_Flip_for_conditional_compilation_Conditional ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value" + M.call_closure (| + M.get_struct_record_field "conditional_compilation::ConditionalCompilation" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -633,10 +647,10 @@ Module Impl_conditional_compilation_Flip_for_conditional_compilation_Conditional |) in let _ := M.write (| - M.get_struct_record_field - (M.read (| self |)) - "conditional_compilation::ConditionalCompilation" - "value", + M.call_closure (| + M.get_struct_record_field "conditional_compilation::ConditionalCompilation" "value", + [ M.read (| self |) ] + |), M.read (| value |) |) in M.alloc (| Value.Tuple [] |) diff --git a/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v b/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v index 432b32085..1ce624e63 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/contract_terminate.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -89,7 +90,10 @@ Module Impl_contract_terminate_Env. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "contract_terminate::Env" "caller" + M.call_closure (| + M.get_struct_record_field "contract_terminate::Env" "caller", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v b/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v index def7c546a..a5bd442f9 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/contract_transfer.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -91,7 +92,10 @@ Module Impl_contract_transfer_Env. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "contract_transfer::Env" "caller" + M.call_closure (| + M.get_struct_record_field "contract_transfer::Env" "caller", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v b/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v index 7b96eb817..7fd7ebb5f 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/custom_allocator.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -110,10 +111,10 @@ Module Impl_custom_allocator_CustomAllocator. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "custom_allocator::CustomAllocator" - "value"; + M.call_closure (| + M.get_struct_record_field "custom_allocator::CustomAllocator" "value", + [ M.read (| self |) ] + |); Value.Integer Integer.Usize 0 ] |), @@ -130,10 +131,10 @@ Module Impl_custom_allocator_CustomAllocator. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "custom_allocator::CustomAllocator" - "value"; + M.call_closure (| + M.get_struct_record_field "custom_allocator::CustomAllocator" "value", + [ M.read (| self |) ] + |); Value.Integer Integer.Usize 0 ] |) @@ -168,10 +169,10 @@ Module Impl_custom_allocator_CustomAllocator. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "custom_allocator::CustomAllocator" - "value"; + M.call_closure (| + M.get_struct_record_field "custom_allocator::CustomAllocator" "value", + [ M.read (| self |) ] + |); Value.Integer Integer.Usize 0 ] |) diff --git a/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v b/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v index 804c0f989..ba27b9d0f 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/custom_environment.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -223,7 +224,10 @@ Module Impl_custom_environment_Env. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "custom_environment::Env" "caller" + M.call_closure (| + M.get_struct_record_field "custom_environment::Env" "caller", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/dns.v b/CoqOfRust/examples/default/examples/ink_contracts/dns.v index 8166d89cd..0dcd1c708 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/dns.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/dns.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -229,8 +230,12 @@ Module Impl_core_cmp_PartialEq_for_dns_AccountId. (let self := M.alloc (| self |) in let other := M.alloc (| other |) in BinOp.Pure.eq - (M.read (| M.get_struct_tuple_field (M.read (| self |)) "dns::AccountId" 0 |)) - (M.read (| M.get_struct_tuple_field (M.read (| other |)) "dns::AccountId" 0 |)))) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "dns::AccountId" 0, [ M.read (| self |) ] |) + |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "dns::AccountId" 0, [ M.read (| other |) ] |) + |)))) | _, _ => M.impossible end. @@ -343,7 +348,9 @@ Module Impl_dns_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "dns::Env" "caller" |))) + M.read (| + M.call_closure (| M.get_struct_record_field "dns::Env" "caller", [ M.read (| self |) ] |) + |))) | _, _ => M.impossible end. @@ -751,10 +758,12 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_owner"; + M.call_closure (| + M.get_struct_record_field + "dns::DomainNameService" + "name_to_owner", + [ M.read (| self |) ] + |); name ] |) @@ -786,10 +795,10 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_owner"; + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "name_to_owner", + [ M.read (| self |) ] + |); M.read (| name |); M.read (| caller |) ] @@ -857,18 +866,18 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_owner"; + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "name_to_owner", + [ M.read (| self |) ] + |); name ] |); M.read (| - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "default_address" + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "default_address", + [ M.read (| self |) ] + |) |) ] |))) @@ -984,10 +993,10 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_address"; + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "name_to_address", + [ M.read (| self |) ] + |); name ] |) @@ -1003,10 +1012,10 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_address"; + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "name_to_address", + [ M.read (| self |) ] + |); M.read (| name |); M.read (| new_address |) ] @@ -1157,10 +1166,10 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_owner"; + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "name_to_owner", + [ M.read (| self |) ] + |); name ] |) @@ -1176,10 +1185,10 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_owner"; + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "name_to_owner", + [ M.read (| self |) ] + |); M.read (| name |); M.read (| to |) ] @@ -1252,18 +1261,18 @@ Module Impl_dns_DomainNameService. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "name_to_address"; + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "name_to_address", + [ M.read (| self |) ] + |); name ] |); M.read (| - M.get_struct_record_field - (M.read (| self |)) - "dns::DomainNameService" - "default_address" + M.call_closure (| + M.get_struct_record_field "dns::DomainNameService" "default_address", + [ M.read (| self |) ] + |) |) ] |))) 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 b06407de6..437817421 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/e2e_call_runtime.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/e2e_call_runtime.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v b/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v index e8c020d1d..6d87ac812 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/erc1155.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -218,8 +219,18 @@ Module Impl_core_cmp_PartialEq_for_erc1155_AccountId. (let self := M.alloc (| self |) in let other := M.alloc (| other |) in BinOp.Pure.eq - (M.read (| M.get_struct_tuple_field (M.read (| self |)) "erc1155::AccountId" 0 |)) - (M.read (| M.get_struct_tuple_field (M.read (| other |)) "erc1155::AccountId" 0 |)))) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "erc1155::AccountId" 0, + [ M.read (| self |) ] + |) + |)) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "erc1155::AccountId" 0, + [ M.read (| other |) ] + |) + |)))) | _, _ => M.impossible end. @@ -522,7 +533,12 @@ Module Impl_erc1155_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "erc1155::Env" "caller" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "erc1155::Env" "caller", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -719,7 +735,10 @@ Module Impl_erc1155_Contract. |) in let _ := let β := - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "token_id_nonce" in + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "token_id_nonce", + [ M.read (| self |) ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), Value.Integer Integer.U128 1 |) |) in let _ := M.alloc (| @@ -732,15 +751,18 @@ Module Impl_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "balances"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "balances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| caller |); M.read (| - M.get_struct_record_field - (M.read (| self |)) - "erc1155::Contract" - "token_id_nonce" + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "token_id_nonce", + [ M.read (| self |) ] + |) |) ]; M.read (| value |) @@ -801,10 +823,10 @@ Module Impl_erc1155_Contract. |)); ("token_id", M.read (| - M.get_struct_record_field - (M.read (| self |)) - "erc1155::Contract" - "token_id_nonce" + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "token_id_nonce", + [ M.read (| self |) ] + |) |)); ("value", M.read (| value |)) ] @@ -812,7 +834,10 @@ Module Impl_erc1155_Contract. ] |) |) in - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "token_id_nonce" + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "token_id_nonce", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -861,10 +886,12 @@ Module Impl_erc1155_Contract. (BinOp.Pure.le (M.read (| token_id |)) (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "erc1155::Contract" - "token_id_nonce" + M.call_closure (| + M.get_struct_record_field + "erc1155::Contract" + "token_id_nonce", + [ M.read (| self |) ] + |) |))) |)) in let _ := @@ -920,7 +947,10 @@ Module Impl_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "balances"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "balances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| caller |); M.read (| token_id |) ]; M.read (| value |) ] @@ -1025,7 +1055,10 @@ Module Impl_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "balances"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "balances", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| from |); M.read (| token_id |) ] |) ] |); @@ -1049,7 +1082,10 @@ Module Impl_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "balances"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "balances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| from |); M.read (| token_id |) ]; M.read (| sender_balance |) ] @@ -1074,7 +1110,10 @@ Module Impl_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "balances"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "balances", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| to |); M.read (| token_id |) ] |) ] |); @@ -1096,7 +1135,10 @@ Module Impl_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "balances"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "balances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| to |); M.read (| token_id |) ]; M.read (| recipient_balance |) ] @@ -1271,7 +1313,10 @@ Module Impl_erc1155_Erc1155_for_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "approvals"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "approvals", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| owner |); M.read (| operator |) ] |) ] |))) @@ -1306,7 +1351,10 @@ Module Impl_erc1155_Erc1155_for_erc1155_Contract. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc1155::Contract" "balances"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "balances", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| owner |); M.read (| token_id |) ] |) ] |); @@ -2589,10 +2637,10 @@ Module Impl_erc1155_Erc1155_for_erc1155_Contract. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "erc1155::Contract" - "approvals"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "approvals", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| caller |); M.read (| operator |) ]; Value.Tuple [] ] @@ -2617,10 +2665,10 @@ Module Impl_erc1155_Erc1155_for_erc1155_Contract. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "erc1155::Contract" - "approvals"; + M.call_closure (| + M.get_struct_record_field "erc1155::Contract" "approvals", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| caller |); M.read (| operator |) ] ] |) diff --git a/CoqOfRust/examples/default/examples/ink_contracts/erc20.v b/CoqOfRust/examples/default/examples/ink_contracts/erc20.v index f4b69df47..3b5d2da93 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/erc20.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/erc20.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -322,7 +323,12 @@ Module Impl_erc20_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "erc20::Env" "caller" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "erc20::Env" "caller", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -499,7 +505,12 @@ Module Impl_erc20_Erc20. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "erc20::Erc20" "total_supply" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "erc20::Erc20" "total_supply", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -530,7 +541,10 @@ Module Impl_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc20::Erc20" "balances"; + M.call_closure (| + M.get_struct_record_field "erc20::Erc20" "balances", + [ M.read (| self |) ] + |); M.read (| owner |) ] |) @@ -593,7 +607,10 @@ Module Impl_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc20::Erc20" "allowances"; + M.call_closure (| + M.get_struct_record_field "erc20::Erc20" "allowances", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| M.read (| owner |) |); M.read (| M.read (| spender |) |) ] |) @@ -702,7 +719,10 @@ Module Impl_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc20::Erc20" "balances"; + M.call_closure (| + M.get_struct_record_field "erc20::Erc20" "balances", + [ M.read (| self |) ] + |); M.read (| M.read (| from |) |); BinOp.Panic.sub (| M.read (| from_balance |), M.read (| value |) |) ] @@ -726,7 +746,10 @@ Module Impl_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc20::Erc20" "balances"; + M.call_closure (| + M.get_struct_record_field "erc20::Erc20" "balances", + [ M.read (| self |) ] + |); M.read (| M.read (| to |) |); BinOp.Panic.add (| M.read (| to_balance |), M.read (| value |) |) ] @@ -860,7 +883,10 @@ Module Impl_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc20::Erc20" "allowances"; + M.call_closure (| + M.get_struct_record_field "erc20::Erc20" "allowances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| owner |); M.read (| spender |) ]; M.read (| value |) ] @@ -1057,7 +1083,10 @@ Module Impl_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc20::Erc20" "allowances"; + M.call_closure (| + M.get_struct_record_field "erc20::Erc20" "allowances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| from |); M.read (| caller |) ]; BinOp.Panic.sub (| M.read (| allowance |), M.read (| value |) |) ] diff --git a/CoqOfRust/examples/default/examples/ink_contracts/erc721.v b/CoqOfRust/examples/default/examples/ink_contracts/erc721.v index f1afc6c1c..204bc6cb4 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/erc721.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/erc721.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -218,8 +219,18 @@ Module Impl_core_cmp_PartialEq_for_erc721_AccountId. (let self := M.alloc (| self |) in let other := M.alloc (| other |) in BinOp.Pure.eq - (M.read (| M.get_struct_tuple_field (M.read (| self |)) "erc721::AccountId" 0 |)) - (M.read (| M.get_struct_tuple_field (M.read (| other |)) "erc721::AccountId" 0 |)))) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "erc721::AccountId" 0, + [ M.read (| self |) ] + |) + |)) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "erc721::AccountId" 0, + [ M.read (| other |) ] + |) + |)))) | _, _ => M.impossible end. @@ -592,7 +603,12 @@ Module Impl_erc721_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "erc721::Env" "caller" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "erc721::Env" "caller", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -688,7 +704,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc721::Erc721" "owned_tokens_count"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "owned_tokens_count", + [ M.read (| self |) ] + |); M.read (| of |) ] |); @@ -724,7 +743,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc721::Erc721" "token_approvals"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "token_approvals", + [ M.read (| self |) ] + |); M.read (| id |) ] |) @@ -759,7 +781,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field (M.read (| self |)) "erc721::Erc721" "operator_approvals"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "operator_approvals", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| owner |); M.read (| operator |) ] |) ] |))) @@ -786,7 +811,13 @@ Module Impl_erc721_Erc721. "get", [] |), - [ M.get_struct_record_field (M.read (| self |)) "erc721::Erc721" "token_owner"; id ] + [ + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "token_owner", + [ M.read (| self |) ] + |); + id + ] |))) | _, _ => M.impossible end. @@ -889,10 +920,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "erc721::Erc721" - "token_approvals"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "token_approvals", + [ M.read (| self |) ] + |); id ] |) @@ -958,7 +989,13 @@ Module Impl_erc721_Erc721. "contains", [] |), - [ M.get_struct_record_field (M.read (| self |)) "erc721::Erc721" "token_owner"; id ] + [ + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "token_owner", + [ M.read (| self |) ] + |); + id + ] |))) | _, _ => M.impossible end. @@ -1002,7 +1039,13 @@ Module Impl_erc721_Erc721. "get", [] |), - [ M.get_struct_record_field (M.read (| self |)) "erc721::Erc721" "token_approvals"; id ] + [ + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "token_approvals", + [ M.read (| self |) ] + |); + id + ] |))) | _, _ => M.impossible end. @@ -1161,10 +1204,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "erc721::Erc721" - "operator_approvals"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "operator_approvals", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| caller |); M.read (| to |) ]; Value.Tuple [] ] @@ -1188,10 +1231,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "erc721::Erc721" - "operator_approvals"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "operator_approvals", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| caller |); M.read (| to |) ] ] |) @@ -1512,10 +1555,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "erc721::Erc721" - "token_approvals"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "token_approvals", + [ M.read (| self |) ] + |); id ] |) @@ -1546,10 +1589,10 @@ Module Impl_erc721_Erc721. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "erc721::Erc721" - "token_approvals"; + M.call_closure (| + M.get_struct_record_field "erc721::Erc721" "token_approvals", + [ M.read (| self |) ] + |); M.read (| id |); M.read (| M.read (| to |) |) ] diff --git a/CoqOfRust/examples/default/examples/ink_contracts/flipper.v b/CoqOfRust/examples/default/examples/ink_contracts/flipper.v index 0ee172150..b265372c1 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/flipper.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/flipper.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -63,10 +64,16 @@ Module Impl_flipper_Flipper. M.read (| let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "flipper::Flipper" "value", + M.call_closure (| + M.get_struct_record_field "flipper::Flipper" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field (M.read (| self |)) "flipper::Flipper" "value" + M.call_closure (| + M.get_struct_record_field "flipper::Flipper" "value", + [ M.read (| self |) ] + |) |)) |) in M.alloc (| Value.Tuple [] |) @@ -86,7 +93,12 @@ Module Impl_flipper_Flipper. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "flipper::Flipper" "value" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "flipper::Flipper" "value", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v b/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v index 3823c63fe..853f097c6 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/incrementer.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -64,7 +65,10 @@ Module Impl_incrementer_Incrementer. M.read (| let _ := let β := - M.get_struct_record_field (M.read (| self |)) "incrementer::Incrementer" "value" in + M.call_closure (| + M.get_struct_record_field "incrementer::Incrementer" "value", + [ M.read (| self |) ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), M.read (| by_ |) |) |) in M.alloc (| Value.Tuple [] |) |))) @@ -84,7 +88,10 @@ Module Impl_incrementer_Incrementer. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "incrementer::Incrementer" "value" + M.call_closure (| + M.get_struct_record_field "incrementer::Incrementer" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. 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 b86d8d801..45cf04696 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { 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 d327eb561..eb078d83f 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom Hash : (Ty.path "call_builder_delegate::Hash") = (Ty.apply (Ty.path "array") [ Ty.path "u8" ]). 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 96251681c..1e3b22bf0 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -433,10 +434,10 @@ Module Impl_constructors_return_value_ConstructorsReturnValue. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "constructors_return_value::ConstructorsReturnValue" - "value" + M.call_closure (| + M.get_struct_record_field "constructors_return_value::ConstructorsReturnValue" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. 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 023d42043..f796ef5e7 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -252,10 +253,16 @@ Module Impl_contract_ref_FlipperRef. M.read (| let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "contract_ref::FlipperRef" "value", + M.call_closure (| + M.get_struct_record_field "contract_ref::FlipperRef" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field (M.read (| self |)) "contract_ref::FlipperRef" "value" + M.call_closure (| + M.get_struct_record_field "contract_ref::FlipperRef" "value", + [ M.read (| self |) ] + |) |)) |) in M.alloc (| Value.Tuple [] |) @@ -276,7 +283,10 @@ Module Impl_contract_ref_FlipperRef. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "contract_ref::FlipperRef" "value" + M.call_closure (| + M.get_struct_record_field "contract_ref::FlipperRef" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -420,10 +430,10 @@ Module Impl_contract_ref_ContractRef. M.call_closure (| M.get_associated_function (| Ty.path "contract_ref::FlipperRef", "flip", [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "contract_ref::ContractRef" - "flipper" + M.call_closure (| + M.get_struct_record_field "contract_ref::ContractRef" "flipper", + [ M.read (| self |) ] + |) ] |) |) in @@ -446,7 +456,12 @@ Module Impl_contract_ref_ContractRef. (let self := M.alloc (| self |) in M.call_closure (| M.get_associated_function (| Ty.path "contract_ref::FlipperRef", "get", [] |), - [ M.get_struct_record_field (M.read (| self |)) "contract_ref::ContractRef" "flipper" ] + [ + M.call_closure (| + M.get_struct_record_field "contract_ref::ContractRef" "flipper", + [ M.read (| self |) ] + |) + ] |))) | _, _ => M.impossible end. 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 364a2a6a1..7224ed45e 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -146,13 +147,16 @@ Module Impl_integration_flipper_Flipper. M.read (| let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "integration_flipper::Flipper" "value", + M.call_closure (| + M.get_struct_record_field "integration_flipper::Flipper" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "integration_flipper::Flipper" - "value" + M.call_closure (| + M.get_struct_record_field "integration_flipper::Flipper" "value", + [ M.read (| self |) ] + |) |)) |) in M.alloc (| Value.Tuple [] |) @@ -173,7 +177,10 @@ Module Impl_integration_flipper_Flipper. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "integration_flipper::Flipper" "value" + M.call_closure (| + M.get_struct_record_field "integration_flipper::Flipper" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. 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 f72e7f8d3..fb97870d8 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/mapping_integration_tests.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/mapping_integration_tests.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -232,7 +233,10 @@ Module Impl_mapping_integration_tests_Env. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "mapping_integration_tests::Env" "caller" + M.call_closure (| + M.get_struct_record_field "mapping_integration_tests::Env" "caller", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -391,10 +395,10 @@ Module Impl_mapping_integration_tests_Mappings. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "mapping_integration_tests::Mappings" - "balances"; + M.call_closure (| + M.get_struct_record_field "mapping_integration_tests::Mappings" "balances", + [ M.read (| self |) ] + |); caller ] |) @@ -450,10 +454,10 @@ Module Impl_mapping_integration_tests_Mappings. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "mapping_integration_tests::Mappings" - "balances"; + M.call_closure (| + M.get_struct_record_field "mapping_integration_tests::Mappings" "balances", + [ M.read (| self |) ] + |); M.read (| caller |); M.read (| value |) ] @@ -510,10 +514,10 @@ Module Impl_mapping_integration_tests_Mappings. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "mapping_integration_tests::Mappings" - "balances"; + M.call_closure (| + M.get_struct_record_field "mapping_integration_tests::Mappings" "balances", + [ M.read (| self |) ] + |); M.read (| caller |) ] |) @@ -568,10 +572,10 @@ Module Impl_mapping_integration_tests_Mappings. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "mapping_integration_tests::Mappings" - "balances"; + M.call_closure (| + M.get_struct_record_field "mapping_integration_tests::Mappings" "balances", + [ M.read (| self |) ] + |); caller ] |) @@ -628,10 +632,10 @@ Module Impl_mapping_integration_tests_Mappings. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "mapping_integration_tests::Mappings" - "balances"; + M.call_closure (| + M.get_struct_record_field "mapping_integration_tests::Mappings" "balances", + [ M.read (| self |) ] + |); M.read (| caller |) ] |) @@ -688,10 +692,10 @@ Module Impl_mapping_integration_tests_Mappings. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "mapping_integration_tests::Mappings" - "balances"; + M.call_closure (| + M.get_struct_record_field "mapping_integration_tests::Mappings" "balances", + [ M.read (| self |) ] + |); M.read (| caller |) ] |) diff --git a/CoqOfRust/examples/default/examples/ink_contracts/mother.v b/CoqOfRust/examples/default/examples/ink_contracts/mother.v index 77e457961..62e35cf17 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/mother.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/mother.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -174,8 +175,18 @@ Module Impl_core_cmp_PartialEq_for_mother_AccountId. (let self := M.alloc (| self |) in let other := M.alloc (| other |) in BinOp.Pure.eq - (M.read (| M.get_struct_tuple_field (M.read (| self |)) "mother::AccountId" 0 |)) - (M.read (| M.get_struct_tuple_field (M.read (| other |)) "mother::AccountId" 0 |)))) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "mother::AccountId" 0, + [ M.read (| self |) ] + |) + |)) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "mother::AccountId" 0, + [ M.read (| other |) ] + |) + |)))) | _, _ => M.impossible end. @@ -361,8 +372,8 @@ Module Impl_core_cmp_PartialEq_for_mother_Bids. [] |), [ - M.get_struct_tuple_field (M.read (| self |)) "mother::Bids" 0; - M.get_struct_tuple_field (M.read (| other |)) "mother::Bids" 0 + M.call_closure (| M.get_struct_tuple_field "mother::Bids" 0, [ M.read (| self |) ] |); + M.call_closure (| M.get_struct_tuple_field "mother::Bids" 0, [ M.read (| other |) ] |) ] |))) | _, _ => M.impossible @@ -446,7 +457,12 @@ Module Impl_core_clone_Clone_for_mother_Bids. "clone", [] |), - [ M.get_struct_tuple_field (M.read (| self |)) "mother::Bids" 0 ] + [ + M.call_closure (| + M.get_struct_tuple_field "mother::Bids" 0, + [ M.read (| self |) ] + |) + ] |) ])) | _, _ => M.impossible @@ -1000,8 +1016,14 @@ Module Impl_core_cmp_PartialEq_for_mother_Auction. [] |), [ - M.get_struct_record_field (M.read (| self |)) "mother::Auction" "name"; - M.get_struct_record_field (M.read (| other |)) "mother::Auction" "name" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "name", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "mother::Auction" "name", + [ M.read (| other |) ] + |) ] |), ltac:(M.monadic @@ -1014,8 +1036,14 @@ Module Impl_core_cmp_PartialEq_for_mother_Auction. [] |), [ - M.get_struct_record_field (M.read (| self |)) "mother::Auction" "subject"; - M.get_struct_record_field (M.read (| other |)) "mother::Auction" "subject" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "subject", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "mother::Auction" "subject", + [ M.read (| other |) ] + |) ] |))) |), @@ -1029,8 +1057,14 @@ Module Impl_core_cmp_PartialEq_for_mother_Auction. [] |), [ - M.get_struct_record_field (M.read (| self |)) "mother::Auction" "bids"; - M.get_struct_record_field (M.read (| other |)) "mother::Auction" "bids" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "bids", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "mother::Auction" "bids", + [ M.read (| other |) ] + |) ] |))) |), @@ -1044,8 +1078,14 @@ Module Impl_core_cmp_PartialEq_for_mother_Auction. [] |), [ - M.get_struct_record_field (M.read (| self |)) "mother::Auction" "terms"; - M.get_struct_record_field (M.read (| other |)) "mother::Auction" "terms" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "terms", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "mother::Auction" "terms", + [ M.read (| other |) ] + |) ] |))) |), @@ -1059,18 +1099,30 @@ Module Impl_core_cmp_PartialEq_for_mother_Auction. [] |), [ - M.get_struct_record_field (M.read (| self |)) "mother::Auction" "status"; - M.get_struct_record_field (M.read (| other |)) "mother::Auction" "status" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "status", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "mother::Auction" "status", + [ M.read (| other |) ] + |) ] |))) |), ltac:(M.monadic (BinOp.Pure.eq (M.read (| - M.get_struct_record_field (M.read (| self |)) "mother::Auction" "finalized" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "finalized", + [ M.read (| self |) ] + |) |)) (M.read (| - M.get_struct_record_field (M.read (| other |)) "mother::Auction" "finalized" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "finalized", + [ M.read (| other |) ] + |) |)))) |), ltac:(M.monadic @@ -1089,8 +1141,14 @@ Module Impl_core_cmp_PartialEq_for_mother_Auction. [] |), [ - M.get_struct_record_field (M.read (| self |)) "mother::Auction" "vector"; - M.get_struct_record_field (M.read (| other |)) "mother::Auction" "vector" + M.call_closure (| + M.get_struct_record_field "mother::Auction" "vector", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "mother::Auction" "vector", + [ M.read (| other |) ] + |) ] |))) |))) @@ -1210,7 +1268,12 @@ Module Impl_core_clone_Clone_for_mother_Auction. "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "mother::Auction" "name" ] + [ + M.call_closure (| + M.get_struct_record_field "mother::Auction" "name", + [ M.read (| self |) ] + |) + ] |)); ("subject", M.call_closure (| @@ -1221,7 +1284,12 @@ Module Impl_core_clone_Clone_for_mother_Auction. "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "mother::Auction" "subject" ] + [ + M.call_closure (| + M.get_struct_record_field "mother::Auction" "subject", + [ M.read (| self |) ] + |) + ] |)); ("bids", M.call_closure (| @@ -1232,7 +1300,12 @@ Module Impl_core_clone_Clone_for_mother_Auction. "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "mother::Auction" "bids" ] + [ + M.call_closure (| + M.get_struct_record_field "mother::Auction" "bids", + [ M.read (| self |) ] + |) + ] |)); ("terms", M.call_closure (| @@ -1243,7 +1316,12 @@ Module Impl_core_clone_Clone_for_mother_Auction. "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "mother::Auction" "terms" ] + [ + M.call_closure (| + M.get_struct_record_field "mother::Auction" "terms", + [ M.read (| self |) ] + |) + ] |)); ("status", M.call_closure (| @@ -1254,12 +1332,22 @@ Module Impl_core_clone_Clone_for_mother_Auction. "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "mother::Auction" "status" ] + [ + M.call_closure (| + M.get_struct_record_field "mother::Auction" "status", + [ M.read (| self |) ] + |) + ] |)); ("finalized", M.call_closure (| M.get_trait_method (| "core::clone::Clone", Ty.path "bool", [], "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "mother::Auction" "finalized" ] + [ + M.call_closure (| + M.get_struct_record_field "mother::Auction" "finalized", + [ M.read (| self |) ] + |) + ] |)); ("vector", M.call_closure (| @@ -1272,7 +1360,12 @@ Module Impl_core_clone_Clone_for_mother_Auction. "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "mother::Auction" "vector" ] + [ + M.call_closure (| + M.get_struct_record_field "mother::Auction" "vector", + [ M.read (| self |) ] + |) + ] |)) ])) | _, _ => M.impossible @@ -1573,7 +1666,12 @@ Module Impl_mother_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "mother::Env" "caller" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "mother::Env" "caller", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/multisig.v b/CoqOfRust/examples/default/examples/ink_contracts/multisig.v index 0c3be8e56..a378eadcd 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/multisig.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/multisig.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -184,7 +185,12 @@ Module Impl_core_fmt_Debug_for_multisig_AccountId. M.read (| Value.String "AccountId" |); (* Unsize *) M.pointer_coercion - (M.alloc (| M.get_struct_tuple_field (M.read (| self |)) "multisig::AccountId" 0 |)) + (M.alloc (| + M.call_closure (| + M.get_struct_tuple_field "multisig::AccountId" 0, + [ M.read (| self |) ] + |) + |)) ] |))) | _, _ => M.impossible @@ -253,8 +259,18 @@ Module Impl_core_cmp_PartialEq_for_multisig_AccountId. (let self := M.alloc (| self |) in let other := M.alloc (| other |) in BinOp.Pure.eq - (M.read (| M.get_struct_tuple_field (M.read (| self |)) "multisig::AccountId" 0 |)) - (M.read (| M.get_struct_tuple_field (M.read (| other |)) "multisig::AccountId" 0 |)))) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "multisig::AccountId" 0, + [ M.read (| self |) ] + |) + |)) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "multisig::AccountId" 0, + [ M.read (| other |) ] + |) + |)))) | _, _ => M.impossible end. @@ -323,8 +339,14 @@ Module Impl_core_cmp_PartialOrd_for_multisig_AccountId. [] |), [ - M.get_struct_tuple_field (M.read (| self |)) "multisig::AccountId" 0; - M.get_struct_tuple_field (M.read (| other |)) "multisig::AccountId" 0 + M.call_closure (| + M.get_struct_tuple_field "multisig::AccountId" 0, + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_tuple_field "multisig::AccountId" 0, + [ M.read (| other |) ] + |) ] |))) | _, _ => M.impossible @@ -351,8 +373,14 @@ Module Impl_core_cmp_Ord_for_multisig_AccountId. M.call_closure (| M.get_trait_method (| "core::cmp::Ord", Ty.path "u128", [], "cmp", [] |), [ - M.get_struct_tuple_field (M.read (| self |)) "multisig::AccountId" 0; - M.get_struct_tuple_field (M.read (| other |)) "multisig::AccountId" 0 + M.call_closure (| + M.get_struct_tuple_field "multisig::AccountId" 0, + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_tuple_field "multisig::AccountId" 0, + [ M.read (| other |) ] + |) ] |))) | _, _ => M.impossible @@ -846,7 +874,12 @@ Module Impl_multisig_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "multisig::Env" "caller" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "multisig::Env" "caller", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -1260,10 +1293,12 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - contract - "multisig::Multisig" - "is_owner"; + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "is_owner", + [ contract ] + |); M.read (| M.read (| owner |) |); Value.Tuple [] ] @@ -1278,12 +1313,18 @@ Module Impl_multisig_Multisig. |)) in let _ := M.write (| - M.get_struct_record_field contract "multisig::Multisig" "owners", + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ contract ] + |), M.read (| owners |) |) in let _ := M.write (| - M.get_struct_record_field contract "multisig::Multisig" "transaction_list", + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transaction_list", + [ contract ] + |), M.call_closure (| M.get_trait_method (| "core::default::Default", @@ -1297,7 +1338,10 @@ Module Impl_multisig_Multisig. |) in let _ := M.write (| - M.get_struct_record_field contract "multisig::Multisig" "requirement", + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ contract ] + |), M.read (| requirement |) |) in contract @@ -1351,10 +1395,12 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "confirmation_count", + [ M.read (| self |) ] + |); trans_id ] |); @@ -1362,10 +1408,10 @@ Module Impl_multisig_Multisig. ] |)) (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "requirement" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ M.read (| self |) ] + |) |))) |)) in let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in @@ -1426,10 +1472,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transactions"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transactions", + [ M.read (| self |) ] + |); trans_id ] |); @@ -1476,10 +1522,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "is_owner"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "is_owner", + [ M.read (| self |) ] + |); M.read (| owner |) ] |)) @@ -1701,10 +1747,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "is_owner"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "is_owner", + [ M.read (| self |) ] + |); M.read (| owner |) ] |))) @@ -1785,16 +1831,19 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "owners" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |) ] |)), Value.Integer Integer.U32 1 |); M.read (| - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "requirement" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ M.read (| self |) ] + |) |) ] |) @@ -1810,7 +1859,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "is_owner"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "is_owner", + [ M.read (| self |) ] + |); M.read (| new_owner |); Value.Tuple [] ] @@ -1827,7 +1879,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "owners"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |); M.read (| new_owner |) ] |) @@ -1914,10 +1969,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "owners" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |) ] |) ] @@ -2000,13 +2055,15 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transaction_list") - "multisig::Transactions" - "transactions" + M.call_closure (| + M.get_struct_record_field "multisig::Transactions" "transactions", + [ + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transaction_list", + [ M.read (| self |) ] + |) + ] + |) ] |) |), @@ -2075,10 +2132,12 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmations"; + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "confirmations", + [ M.read (| self |) ] + |); key ] |) @@ -2106,10 +2165,12 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmations"; + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "confirmations", + [ M.read (| self |) ] + |); M.read (| key |) ] |) @@ -2134,10 +2195,12 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "confirmation_count", + [ M.read (| self |) ] + |); M.read (| trans_id |) ] |); @@ -2168,10 +2231,12 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "confirmation_count", + [ M.read (| self |) ] + |); M.read (| M.read (| trans_id |) |); M.read (| count |) ] @@ -2247,7 +2312,12 @@ Module Impl_multisig_Multisig. "len", [] |), - [ M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "owners" ] + [ + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |) + ] |)), Value.Integer Integer.U32 1 |) @@ -2259,7 +2329,10 @@ Module Impl_multisig_Multisig. [ M.read (| len |); M.read (| - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "requirement" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ M.read (| self |) ] + |) |) ] |) @@ -2290,7 +2363,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "owners"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |); M.read (| owner_index |) ] |) @@ -2306,14 +2382,20 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "is_owner"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "is_owner", + [ M.read (| self |) ] + |); M.read (| owner |) ] |) |) in let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "requirement", + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ M.read (| self |) ] + |), M.read (| requirement |) |) in let _ := @@ -2421,7 +2503,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "owners"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |); M.rust_cast (M.read (| owner_index |)) ] |), @@ -2438,7 +2523,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "is_owner"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "is_owner", + [ M.read (| self |) ] + |); M.read (| old_owner |) ] |) @@ -2454,7 +2542,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "is_owner"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "is_owner", + [ M.read (| self |) ] + |); M.read (| new_owner |); Value.Tuple [] ] @@ -2564,7 +2655,11 @@ Module Impl_multisig_Multisig. "len", [] |), - [ M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "owners" + [ + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |) ] |)); M.read (| new_requirement |) @@ -2573,7 +2668,10 @@ Module Impl_multisig_Multisig. |) in let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "requirement", + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ M.read (| self |) ] + |), M.read (| new_requirement |) |) in let _ := @@ -2663,10 +2761,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmation_count", + [ M.read (| self |) ] + |); transaction ] |); @@ -2688,10 +2786,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmations"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmations", + [ M.read (| self |) ] + |); key ] |)) @@ -2724,10 +2822,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmations"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmations", + [ M.read (| self |) ] + |); M.read (| key |); Value.Tuple [] ] @@ -2742,10 +2840,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmation_count", + [ M.read (| self |) ] + |); M.read (| transaction |); M.read (| count |) ] @@ -2768,10 +2866,10 @@ Module Impl_multisig_Multisig. BinOp.Pure.ge (M.read (| count |)) (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "requirement" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ M.read (| self |) ] + |) |)) |)) in let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in @@ -2786,10 +2884,10 @@ Module Impl_multisig_Multisig. [ BinOp.Panic.sub (| M.read (| - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "requirement" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "requirement", + [ M.read (| self |) ] + |) |), M.read (| count |) |) @@ -2888,23 +2986,27 @@ Module Impl_multisig_Multisig. |) in let trans_id := M.copy (| - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transaction_list") - "multisig::Transactions" - "next_id" + M.call_closure (| + M.get_struct_record_field "multisig::Transactions" "next_id", + [ + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transaction_list", + [ M.read (| self |) ] + |) + ] + |) |) in let _ := M.write (| - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transaction_list") - "multisig::Transactions" - "next_id", + M.call_closure (| + M.get_struct_record_field "multisig::Transactions" "next_id", + [ + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transaction_list", + [ M.read (| self |) ] + |) + ] + |), M.call_closure (| M.get_associated_function (| Ty.apply (Ty.path "core::option::Option") [ Ty.path "u32" ], @@ -2934,7 +3036,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "transactions"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transactions", + [ M.read (| self |) ] + |); M.read (| trans_id |); M.read (| transaction |) ] @@ -2951,13 +3056,15 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transaction_list") - "multisig::Transactions" - "transactions"; + M.call_closure (| + M.get_struct_record_field "multisig::Transactions" "transactions", + [ + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transaction_list", + [ M.read (| self |) ] + |) + ] + |); M.read (| trans_id |) ] |) @@ -3056,7 +3163,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field (M.read (| self |)) "multisig::Multisig" "transactions"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transactions", + [ M.read (| self |) ] + |); trans_id ] |) @@ -3093,10 +3203,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transactions"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transactions", + [ M.read (| self |) ] + |); M.read (| trans_id |) ] |) @@ -3142,13 +3252,19 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transaction_list") - "multisig::Transactions" - "transactions" + M.call_closure (| + M.get_struct_record_field + "multisig::Transactions" + "transactions", + [ + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "transaction_list", + [ M.read (| self |) ] + |) + ] + |) ] |) ] @@ -3199,13 +3315,15 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "transaction_list") - "multisig::Transactions" - "transactions"; + M.call_closure (| + M.get_struct_record_field "multisig::Transactions" "transactions", + [ + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "transaction_list", + [ M.read (| self |) ] + |) + ] + |); M.read (| pos |) ] |) @@ -3246,10 +3364,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "owners" + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "owners", + [ M.read (| self |) ] + |) ] |) ] @@ -3312,10 +3430,12 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmations"; + M.call_closure (| + M.get_struct_record_field + "multisig::Multisig" + "confirmations", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| trans_id |); @@ -3340,10 +3460,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmation_count", + [ M.read (| self |) ] + |); M.read (| trans_id |) ] |) @@ -3590,10 +3710,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmations"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmations", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| trans_id |); M.read (| caller |) ] |) ] |) @@ -3611,10 +3731,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmations"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmations", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| trans_id |); M.read (| caller |) ] ] |) @@ -3637,10 +3757,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmation_count", + [ M.read (| self |) ] + |); trans_id ] |); @@ -3666,10 +3786,10 @@ Module Impl_multisig_Multisig. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "multisig::Multisig" - "confirmation_count"; + M.call_closure (| + M.get_struct_record_field "multisig::Multisig" "confirmation_count", + [ M.read (| self |) ] + |); M.read (| trans_id |); M.read (| confirmation_count |) ] @@ -3811,10 +3931,12 @@ Module Impl_multisig_Multisig. ] |)) (M.read (| - M.get_struct_record_field - t - "multisig::Transaction" - "transferred_value" + M.call_closure (| + M.get_struct_record_field + "multisig::Transaction" + "transferred_value", + [ t ] + |) |))) |)) in let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in diff --git a/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v b/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v index 7cd93f50f..8dd07240f 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/payment_channel.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -90,9 +91,17 @@ Module Impl_core_cmp_PartialEq_for_payment_channel_AccountId. (let self := M.alloc (| self |) in let other := M.alloc (| other |) in BinOp.Pure.eq - (M.read (| M.get_struct_tuple_field (M.read (| self |)) "payment_channel::AccountId" 0 |)) (M.read (| - M.get_struct_tuple_field (M.read (| other |)) "payment_channel::AccountId" 0 + M.call_closure (| + M.get_struct_tuple_field "payment_channel::AccountId" 0, + [ M.read (| self |) ] + |) + |)) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "payment_channel::AccountId" 0, + [ M.read (| other |) ] + |) |)))) | _, _ => M.impossible end. @@ -354,7 +363,12 @@ Module Impl_payment_channel_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "payment_channel::Env" "caller" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "payment_channel::Env" "caller", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -777,10 +791,10 @@ Module Impl_payment_channel_PaymentChannel. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "recipient"; + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "recipient", + [ M.read (| self |) ] + |); M.alloc (| M.call_closure (| M.get_trait_method (| @@ -920,10 +934,12 @@ Module Impl_payment_channel_PaymentChannel. ] |) |); - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "recipient" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "recipient", + [ M.read (| self |) ] + |) ] |) |)) in @@ -959,10 +975,12 @@ Module Impl_payment_channel_PaymentChannel. BinOp.Pure.lt (M.read (| amount |)) (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "withdrawn" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "withdrawn", + [ M.read (| self |) ] + |) |)) |)) in let _ := @@ -1067,18 +1085,22 @@ Module Impl_payment_channel_PaymentChannel. |) |); M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "recipient" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "recipient", + [ M.read (| self |) ] + |) |); BinOp.Panic.sub (| M.read (| amount |), M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "withdrawn" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "withdrawn", + [ M.read (| self |) ] + |) |) |) ] @@ -1274,10 +1296,10 @@ Module Impl_payment_channel_PaymentChannel. |) |); M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "sender" + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "sender", + [ M.read (| self |) ] + |) |) ] |) @@ -1357,10 +1379,12 @@ Module Impl_payment_channel_PaymentChannel. ] |) |); - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "sender" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "sender", + [ M.read (| self |) ] + |) ] |) |)) in @@ -1408,10 +1432,12 @@ Module Impl_payment_channel_PaymentChannel. BinOp.Panic.add (| M.read (| now |), M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "close_duration" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "close_duration", + [ M.read (| self |) ] + |) |) |) |) in @@ -1443,10 +1469,12 @@ Module Impl_payment_channel_PaymentChannel. ("expiration", M.read (| expiration |)); ("close_duration", M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "close_duration" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "close_duration", + [ M.read (| self |) ] + |) |)) ] ] @@ -1455,10 +1483,10 @@ Module Impl_payment_channel_PaymentChannel. |) in let _ := M.write (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "expiration", + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "expiration", + [ M.read (| self |) ] + |), Value.StructTuple "core::option::Option::Some" [ M.read (| expiration |) ] |) in M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |) @@ -1499,10 +1527,10 @@ Module Impl_payment_channel_PaymentChannel. ltac:(M.monadic (M.read (| M.match_operator (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "expiration", + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "expiration", + [ M.read (| self |) ] + |), [ fun γ => ltac:(M.monadic @@ -1589,10 +1617,12 @@ Module Impl_payment_channel_PaymentChannel. |) |); M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "sender" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "sender", + [ M.read (| self |) ] + |) |) ] |) @@ -1692,10 +1722,12 @@ Module Impl_payment_channel_PaymentChannel. ] |) |); - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "recipient" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "recipient", + [ M.read (| self |) ] + |) ] |) |)) in @@ -1767,10 +1799,12 @@ Module Impl_payment_channel_PaymentChannel. BinOp.Pure.lt (M.read (| amount |)) (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "withdrawn" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "withdrawn", + [ M.read (| self |) ] + |) |)) |)) in let _ := @@ -1798,19 +1832,19 @@ Module Impl_payment_channel_PaymentChannel. BinOp.Panic.sub (| M.read (| amount |), M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "withdrawn" + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "withdrawn", + [ M.read (| self |) ] + |) |) |) |) in let _ := let β := - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "withdrawn" in + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "withdrawn", + [ M.read (| self |) ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), M.read (| amount_to_withdraw |) |) @@ -1861,10 +1895,12 @@ Module Impl_payment_channel_PaymentChannel. |) |); M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "recipient" + M.call_closure (| + M.get_struct_record_field + "payment_channel::PaymentChannel" + "recipient", + [ M.read (| self |) ] + |) |); M.read (| amount_to_withdraw |) ] @@ -1959,7 +1995,10 @@ Module Impl_payment_channel_PaymentChannel. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "payment_channel::PaymentChannel" "sender" + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "sender", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -1977,10 +2016,10 @@ Module Impl_payment_channel_PaymentChannel. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "recipient" + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "recipient", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -1999,10 +2038,10 @@ Module Impl_payment_channel_PaymentChannel. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "expiration" + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "expiration", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -2021,10 +2060,10 @@ Module Impl_payment_channel_PaymentChannel. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "withdrawn" + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "withdrawn", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -2043,10 +2082,10 @@ Module Impl_payment_channel_PaymentChannel. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "payment_channel::PaymentChannel" - "close_duration" + M.call_closure (| + M.get_struct_record_field "payment_channel::PaymentChannel" "close_duration", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. 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 bbb25491e..7ce25a8b2 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/set_code_hash.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Error @@ -95,7 +96,10 @@ Module Impl_set_code_hash_Incrementer. M.read (| let _ := let β := - M.get_struct_record_field (M.read (| self |)) "set_code_hash::Incrementer" "count" in + M.call_closure (| + M.get_struct_record_field "set_code_hash::Incrementer" "count", + [ M.read (| self |) ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), Value.Integer Integer.U32 1 |) |) in let _ := let _ := @@ -131,10 +135,12 @@ Module Impl_set_code_hash_Incrementer. [ Ty.path "u32" ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "set_code_hash::Incrementer" - "count" + M.call_closure (| + M.get_struct_record_field + "set_code_hash::Incrementer" + "count", + [ M.read (| self |) ] + |) ] |) ] @@ -163,7 +169,10 @@ Module Impl_set_code_hash_Incrementer. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "set_code_hash::Incrementer" "count" + M.call_closure (| + M.get_struct_record_field "set_code_hash::Incrementer" "count", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. 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 6e24d4c40..e2cd67012 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 @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -181,10 +182,10 @@ Module Impl_updated_incrementer_Incrementer. M.read (| let _ := let β := - M.get_struct_record_field - (M.read (| self |)) - "updated_incrementer::Incrementer" - "count" in + M.call_closure (| + M.get_struct_record_field "updated_incrementer::Incrementer" "count", + [ M.read (| self |) ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), Value.Integer Integer.U32 4 |) |) in let _ := let _ := @@ -220,10 +221,12 @@ Module Impl_updated_incrementer_Incrementer. [ Ty.path "u32" ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "updated_incrementer::Incrementer" - "count" + M.call_closure (| + M.get_struct_record_field + "updated_incrementer::Incrementer" + "count", + [ M.read (| self |) ] + |) ] |) ] @@ -252,7 +255,10 @@ Module Impl_updated_incrementer_Incrementer. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "updated_incrementer::Incrementer" "count" + M.call_closure (| + M.get_struct_record_field "updated_incrementer::Incrementer" "count", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v b/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v index 83ac65802..9b08865b4 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/trait_erc20.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -461,7 +462,12 @@ Module Impl_trait_erc20_Env. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "trait_erc20::Env" "caller" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "trait_erc20::Env" "caller", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -657,7 +663,10 @@ Module Impl_trait_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "trait_erc20::Erc20" "balances"; + M.call_closure (| + M.get_struct_record_field "trait_erc20::Erc20" "balances", + [ M.read (| self |) ] + |); M.read (| owner |) ] |) @@ -700,7 +709,10 @@ Module Impl_trait_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "trait_erc20::Erc20" "allowances"; + M.call_closure (| + M.get_struct_record_field "trait_erc20::Erc20" "allowances", + [ M.read (| self |) ] + |); M.alloc (| Value.Tuple [ M.read (| M.read (| owner |) |); M.read (| M.read (| spender |) |) ] |) @@ -792,7 +804,10 @@ Module Impl_trait_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "trait_erc20::Erc20" "balances"; + M.call_closure (| + M.get_struct_record_field "trait_erc20::Erc20" "balances", + [ M.read (| self |) ] + |); M.read (| M.read (| from |) |); BinOp.Panic.sub (| M.read (| from_balance |), M.read (| value |) |) ] @@ -820,7 +835,10 @@ Module Impl_trait_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "trait_erc20::Erc20" "balances"; + M.call_closure (| + M.get_struct_record_field "trait_erc20::Erc20" "balances", + [ M.read (| self |) ] + |); M.read (| M.read (| to |) |); BinOp.Panic.add (| M.read (| to_balance |), M.read (| value |) |) ] @@ -881,7 +899,10 @@ Module Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "trait_erc20::Erc20" "total_supply" + M.call_closure (| + M.get_struct_record_field "trait_erc20::Erc20" "total_supply", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -1010,7 +1031,10 @@ Module Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20. [] |), [ - M.get_struct_record_field (M.read (| self |)) "trait_erc20::Erc20" "allowances"; + M.call_closure (| + M.get_struct_record_field "trait_erc20::Erc20" "allowances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| owner |); M.read (| spender |) ]; M.read (| value |) ] @@ -1211,10 +1235,10 @@ Module Impl_trait_erc20_BaseErc20_for_trait_erc20_Erc20. [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "trait_erc20::Erc20" - "allowances"; + M.call_closure (| + M.get_struct_record_field "trait_erc20::Erc20" "allowances", + [ M.read (| self |) ] + |); Value.Tuple [ M.read (| from |); M.read (| caller |) ]; BinOp.Panic.sub (| M.read (| allowance |), M.read (| value |) |) ] diff --git a/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v b/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v index 429694805..60c969cba 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/trait_flipper.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Flip' *) @@ -62,10 +63,16 @@ Module Impl_trait_flipper_Flip_for_trait_flipper_Flipper. M.read (| let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "trait_flipper::Flipper" "value", + M.call_closure (| + M.get_struct_record_field "trait_flipper::Flipper" "value", + [ M.read (| self |) ] + |), UnOp.Pure.not (M.read (| - M.get_struct_record_field (M.read (| self |)) "trait_flipper::Flipper" "value" + M.call_closure (| + M.get_struct_record_field "trait_flipper::Flipper" "value", + [ M.read (| self |) ] + |) |)) |) in M.alloc (| Value.Tuple [] |) @@ -84,7 +91,10 @@ Module Impl_trait_flipper_Flip_for_trait_flipper_Flipper. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "trait_flipper::Flipper" "value" + M.call_closure (| + M.get_struct_record_field "trait_flipper::Flipper" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v b/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v index 0b814e53e..8669826d6 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/trait_incrementer.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Increment' *) @@ -47,10 +48,10 @@ Module Impl_trait_incrementer_Incrementer. M.read (| let _ := let β := - M.get_struct_record_field - (M.read (| self |)) - "trait_incrementer::Incrementer" - "value" in + M.call_closure (| + M.get_struct_record_field "trait_incrementer::Incrementer" "value", + [ M.read (| self |) ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), M.read (| delta |) |) |) in M.alloc (| Value.Tuple [] |) |))) @@ -91,7 +92,10 @@ Module Impl_trait_incrementer_Increment_for_trait_incrementer_Incrementer. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field (M.read (| self |)) "trait_incrementer::Incrementer" "value" + M.call_closure (| + M.get_struct_record_field "trait_incrementer::Incrementer" "value", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -120,10 +124,10 @@ Module Impl_trait_incrementer_Reset_for_trait_incrementer_Incrementer. M.read (| let _ := M.write (| - M.get_struct_record_field - (M.read (| self |)) - "trait_incrementer::Incrementer" - "value", + M.call_closure (| + M.get_struct_record_field "trait_incrementer::Incrementer" "value", + [ M.read (| self |) ] + |), Value.Integer Integer.U64 0 |) in M.alloc (| Value.Tuple [] |) diff --git a/CoqOfRust/examples/default/examples/ink_contracts/typed/erc20.v b/CoqOfRust/examples/default/examples/ink_contracts/typed/erc20.v new file mode 100644 index 000000000..2a4e8e890 --- /dev/null +++ b/CoqOfRust/examples/default/examples/ink_contracts/typed/erc20.v @@ -0,0 +1,123 @@ +Require Import CoqOfRust.CoqOfRust. +Require Import CoqOfRust.typed.M. +Require Import CoqOfRust.lib.typed.lib. +Require CoqOfRust.examples.default.examples.ink_contracts.erc20. + +Import M.Notations. +Import Run. + +Module Mapping. + Parameter t : Set -> Set -> Set. + + Parameter to_value : forall {K V : Set} `{ToValue K} `{ToValue V}, t K V -> Value.t. + + Global Instance IsToValue (K V : Set) `{ToValue K} `{ToValue V} : ToValue (t K V) := { + Φ := Ty.apply (Ty.path "erc20::Mapping") [Φ K; Φ V]; + φ := to_value; + }. +End Mapping. + +Module Impl_erc20_Mapping_K_V. + Parameter get : forall {K V : Set} `{ToValue K} `{ToValue V}, + Pointer.t (Mapping.t K V) -> Pointer.t K -> M (option V). + + Parameter insert : forall {K V : Set} `{ToValue K} `{ToValue V}, + Pointer.t (Mapping.t K V) -> K -> V -> M unit. +End Impl_erc20_Mapping_K_V. + +Module Balance. + Definition t : Set := u128.t. +End Balance. + +Module AccountId. + Inductive t : Set := + | Make (account_id : u128.t). + + Global Instance IsToValue : ToValue t := { + Φ := Ty.path "erc20::AccountId"; + φ '(Make x) := Value.StructTuple "erc20::AccountId" [φ x]; + }. +End AccountId. + +(* TODO: move to the right place *) +Module Pointer. + Global Instance IsToValue {T : Set} `{ToValue T} : ToValue (Pointer.t T) := { + Φ := Ty.path "erc20::Pointer"; (* TODO *) + φ x := Value.Pointer (Pointer.to_pointer x); + }. +End Pointer. + +Module Erc20. + Record t : Set := { + total_supply : Balance.t; + balances : Mapping.t AccountId.t Balance.t; + allowances : Mapping.t (AccountId.t * AccountId.t) Balance.t; + }. + + Global Instance IsToValue : ToValue t := { + Φ := Ty.path "erc20::Erc20"; + φ x := + Value.StructRecord "erc20::Erc20" [ + ("total_supply", φ x.(total_supply)); + ("balances", φ x.(balances)); + ("allowances", φ x.(allowances)) + ]; + }. + + Definition get_total_supply (self : Pointer.t t) : M (Pointer.t Balance.t) := + M.make_sub_pointer self (Pointer.Index.StructRecord "erc20::Erc20" "total_supply") + (fun x => Some x.(total_supply)) + (fun x v => Some (x <| total_supply := v |>)). + + Lemma get_total_supply_run {Address Env : Set} (env_to_value : Env -> Value.t) + (self : Pointer.t t) : + {{ Address, env_to_value | + get_struct_record_field_closure "erc20::Erc20" "total_supply" [φ self] ~ + Erc20.get_total_supply self + }}. + Proof. + destruct self, origin. + apply Run.CallPrimitiveMakeSubPointer; try reflexivity. + apply Run.Pure. + reflexivity. + Qed. +End Erc20. + +Module Impl_erc20_Erc20. + Definition Self : Set := Erc20.t. + + Definition total_supply (self : Pointer.t Self) : M Balance.t := + let* self := M.alloc self in + let* self := M.read self in + let* self_total_supply := M.call_closure Erc20.get_total_supply <[self]> in + M.read self_total_supply. + + Lemma total_supply_run {Address Env : Set} (env_to_value : Env -> Value.t) + (self : Pointer.t Self) : + {{ Address, env_to_value | + ink_contracts.erc20.Impl_erc20_Erc20.total_supply [] [φ self] ~ + total_supply self + }}. + Proof. + Opaque φ. + cbn. + apply Run.CallPrimitiveStateAlloc. + intros; cbn. + apply Run.CallPrimitiveStateRead; [reflexivity|]. + intros. + eapply Run.CallClosure; try constructor. { + apply Erc20.get_total_supply_run. + } + intros. + destruct result as [|[[] | | | | ]]; cbn; try now apply Run.Pure. + destruct t0. + apply Run.CallPrimitiveStateRead; [reflexivity|]; intros. + now apply Run.Pure. + Qed. + + (* Definition balance_of_impl (self : Pointer.t Erc20.t) (owner : Pointer.t AccountId) : + M (option Balance.t) := + let* self := M.read self in *) + + Impl_erc20_Mapping_K_V.get mapping owner. +End Impl_erc20_Erc20. diff --git a/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v b/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v index a3987925f..1fa707894 100644 --- a/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v +++ b/CoqOfRust/examples/default/examples/ink_contracts/wildcard_selector.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn decode_input() -> Result { diff --git a/CoqOfRust/examples/default/examples/monadic_transformation/example01.v b/CoqOfRust/examples/default/examples/monadic_transformation/example01.v index 818e76867..04cc74b6b 100644 --- a/CoqOfRust/examples/default/examples/monadic_transformation/example01.v +++ b/CoqOfRust/examples/default/examples/monadic_transformation/example01.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn id(x: u64) -> u64 { diff --git a/CoqOfRust/examples/default/examples/monadic_transformation/example02.v b/CoqOfRust/examples/default/examples/monadic_transformation/example02.v index 96ac96aff..c568d9cda 100644 --- a/CoqOfRust/examples/default/examples/monadic_transformation/example02.v +++ b/CoqOfRust/examples/default/examples/monadic_transformation/example02.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/monadic_transformation/example03.v b/CoqOfRust/examples/default/examples/monadic_transformation/example03.v index 23be3bce9..c8e7f6d13 100644 --- a/CoqOfRust/examples/default/examples/monadic_transformation/example03.v +++ b/CoqOfRust/examples/default/examples/monadic_transformation/example03.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/monadic_transformation/example04.v b/CoqOfRust/examples/default/examples/monadic_transformation/example04.v index 9eacefa8e..0e39a8e49 100644 --- a/CoqOfRust/examples/default/examples/monadic_transformation/example04.v +++ b/CoqOfRust/examples/default/examples/monadic_transformation/example04.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/monadic_transformation/example05.v b/CoqOfRust/examples/default/examples/monadic_transformation/example05.v index 2d94e842c..c7c6fabbf 100644 --- a/CoqOfRust/examples/default/examples/monadic_transformation/example05.v +++ b/CoqOfRust/examples/default/examples/monadic_transformation/example05.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -22,7 +23,7 @@ Module Impl_example05_Foo. ltac:(M.monadic (let self := M.alloc (| self |) in BinOp.Panic.add (| - M.read (| M.get_struct_tuple_field self "example05::Foo" 0 |), + M.read (| M.call_closure (| M.get_struct_tuple_field "example05::Foo" 0, [ self ] |) |), Value.Integer Integer.U32 1 |))) | _, _ => M.impossible diff --git a/CoqOfRust/examples/default/examples/rust_book/attributes/dead_code.v b/CoqOfRust/examples/default/examples/rust_book/attributes/dead_code.v index d22481da5..79d6f0ddf 100644 --- a/CoqOfRust/examples/default/examples/rust_book/attributes/dead_code.v +++ b/CoqOfRust/examples/default/examples/rust_book/attributes/dead_code.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn used_function() {} *) Definition used_function (τ : list Ty.t) (α : list Value.t) : M := diff --git a/CoqOfRust/examples/default/examples/rust_book/cargo/concurrent_tests.v b/CoqOfRust/examples/default/examples/rust_book/cargo/concurrent_tests.v index e450ac909..e4f9b6638 100644 --- a/CoqOfRust/examples/default/examples/rust_book/cargo/concurrent_tests.v +++ b/CoqOfRust/examples/default/examples/rust_book/cargo/concurrent_tests.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn foo(o: Option) { diff --git a/CoqOfRust/examples/default/examples/rust_book/conversion/converting_to_string.v b/CoqOfRust/examples/default/examples/rust_book/conversion/converting_to_string.v index ccf74eb74..0ddda381d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/conversion/converting_to_string.v +++ b/CoqOfRust/examples/default/examples/rust_book/conversion/converting_to_string.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -44,10 +45,10 @@ Module Impl_core_fmt_Display_for_converting_to_string_Circle. [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "converting_to_string::Circle" - "radius" + M.call_closure (| + M.get_struct_record_field "converting_to_string::Circle" "radius", + [ M.read (| self |) ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/conversion/from.v b/CoqOfRust/examples/default/examples/rust_book/conversion/from.v index 5cb59e996..247e8c365 100644 --- a/CoqOfRust/examples/default/examples/rust_book/conversion/from.v +++ b/CoqOfRust/examples/default/examples/rust_book/conversion/from.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/default/examples/rust_book/conversion/into.v b/CoqOfRust/examples/default/examples/rust_book/conversion/into.v index 40ffc727e..3a1e95aae 100644 --- a/CoqOfRust/examples/default/examples/rust_book/conversion/into.v +++ b/CoqOfRust/examples/default/examples/rust_book/conversion/into.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/default/examples/rust_book/conversion/parsing_a_string.v b/CoqOfRust/examples/default/examples/rust_book/conversion/parsing_a_string.v index 1036b97dc..831adcf38 100644 --- a/CoqOfRust/examples/default/examples/rust_book/conversion/parsing_a_string.v +++ b/CoqOfRust/examples/default/examples/rust_book/conversion/parsing_a_string.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/conversion/try_from_and_try_into.v b/CoqOfRust/examples/default/examples/rust_book/conversion/try_from_and_try_into.v index 750cce2b8..d7aee618a 100644 --- a/CoqOfRust/examples/default/examples/rust_book/conversion/try_from_and_try_into.v +++ b/CoqOfRust/examples/default/examples/rust_book/conversion/try_from_and_try_into.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -30,7 +31,10 @@ Module Impl_core_fmt_Debug_for_try_from_and_try_into_EvenNumber. (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field (M.read (| self |)) "try_from_and_try_into::EvenNumber" 0 + M.call_closure (| + M.get_struct_tuple_field "try_from_and_try_into::EvenNumber" 0, + [ M.read (| self |) ] + |) |)) ] |))) @@ -68,10 +72,16 @@ Module Impl_core_cmp_PartialEq_for_try_from_and_try_into_EvenNumber. let other := M.alloc (| other |) in BinOp.Pure.eq (M.read (| - M.get_struct_tuple_field (M.read (| self |)) "try_from_and_try_into::EvenNumber" 0 + M.call_closure (| + M.get_struct_tuple_field "try_from_and_try_into::EvenNumber" 0, + [ M.read (| self |) ] + |) |)) (M.read (| - M.get_struct_tuple_field (M.read (| other |)) "try_from_and_try_into::EvenNumber" 0 + M.call_closure (| + M.get_struct_tuple_field "try_from_and_try_into::EvenNumber" 0, + [ M.read (| other |) ] + |) |)))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/constants.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/constants.v index 99d1dc0a0..ddf9b1b88 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/constants.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/constants.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Definition value_LANGUAGE : Value.t := M.run ltac:(M.monadic (M.alloc (| Value.String "Rust" |))). diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums.v index 223b49ed0..fd337bac4 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum WebEvent diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_c_like.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_c_like.v index d4d38bacd..45a24bee7 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_c_like.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_c_like.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Number diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_testcase_linked_list.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_testcase_linked_list.v index 957a02bf0..052f7e6f7 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_testcase_linked_list.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_testcase_linked_list.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum List diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v1.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v1.v index ee6ffb86f..b3147af29 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v1.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v1.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum VeryVerboseEnumOfThingsToDoWithNumbers diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v2.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v2.v index 7f7d37ff2..0dabaf1c7 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v2.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_type_aliases_v2.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum VeryVerboseEnumOfThingsToDoWithNumbers diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_use.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_use.v index 7f142d392..5fc9793b0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_use.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/enums_use.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Status diff --git a/CoqOfRust/examples/default/examples/rust_book/custom_types/structures.v b/CoqOfRust/examples/default/examples/rust_book/custom_types/structures.v index 11986141a..e6cfbb7da 100644 --- a/CoqOfRust/examples/default/examples/rust_book/custom_types/structures.v +++ b/CoqOfRust/examples/default/examples/rust_book/custom_types/structures.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -30,12 +31,18 @@ Module Impl_core_fmt_Debug_for_structures_Person. M.read (| Value.String "name" |); (* Unsize *) M.pointer_coercion - (M.get_struct_record_field (M.read (| self |)) "structures::Person" "name"); + (M.call_closure (| + M.get_struct_record_field "structures::Person" "name", + [ M.read (| self |) ] + |)); M.read (| Value.String "age" |); (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_record_field (M.read (| self |)) "structures::Person" "age" + M.call_closure (| + M.get_struct_record_field "structures::Person" "age", + [ M.read (| self |) ] + |) |)) ] |))) @@ -232,7 +239,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "new_display", [ Ty.path "f32" ] |), - [ M.get_struct_record_field point "structures::Point" "x" ] + [ + M.call_closure (| + M.get_struct_record_field "structures::Point" "x", + [ point ] + |) + ] |); M.call_closure (| M.get_associated_function (| @@ -240,7 +252,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "new_display", [ Ty.path "f32" ] |), - [ M.get_struct_record_field point "structures::Point" "y" ] + [ + M.call_closure (| + M.get_struct_record_field "structures::Point" "y", + [ point ] + |) + ] |) ] |)) @@ -285,7 +302,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "new_display", [ Ty.path "f32" ] |), - [ M.get_struct_record_field bottom_right "structures::Point" "x" ] + [ + M.call_closure (| + M.get_struct_record_field "structures::Point" "x", + [ bottom_right ] + |) + ] |); M.call_closure (| M.get_associated_function (| @@ -293,7 +315,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "new_display", [ Ty.path "f32" ] |), - [ M.get_struct_record_field bottom_right "structures::Point" "y" ] + [ + M.call_closure (| + M.get_struct_record_field "structures::Point" "y", + [ bottom_right ] + |) + ] |) ] |)) @@ -368,7 +395,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "new_debug", [ Ty.path "i32" ] |), - [ M.get_struct_tuple_field pair_ "structures::Pair" 0 ] + [ + M.call_closure (| + M.get_struct_tuple_field "structures::Pair" 0, + [ pair_ ] + |) + ] |); M.call_closure (| M.get_associated_function (| @@ -376,7 +408,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "new_debug", [ Ty.path "f32" ] |), - [ M.get_struct_tuple_field pair_ "structures::Pair" 1 ] + [ + M.call_closure (| + M.get_struct_tuple_field "structures::Pair" 1, + [ pair_ ] + |) + ] |) ] |)) diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/aliases_for_result.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/aliases_for_result.v index 607a890a5..a6107dffc 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/aliases_for_result.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/aliases_for_result.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom AliasedResult : forall (T : Ty.t), diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/boxing_errors.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/boxing_errors.v index 64d2a1b55..5a04584ec 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/boxing_errors.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/boxing_errors.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom Result : forall (T : Ty.t), diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_and_then.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_and_then.v index 2e2f1ae54..e990ded34 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_and_then.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_and_then.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Food diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_map.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_map.v index f238761cb..e128b1b03 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_map.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/combinators_map.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Food @@ -101,7 +102,10 @@ Module Impl_core_fmt_Debug_for_combinators_map_Peeled. (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field (M.read (| self |)) "combinators_map::Peeled" 0 + M.call_closure (| + M.get_struct_tuple_field "combinators_map::Peeled" 0, + [ M.read (| self |) ] + |) |)) ] |))) @@ -145,7 +149,10 @@ Module Impl_core_fmt_Debug_for_combinators_map_Chopped. (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field (M.read (| self |)) "combinators_map::Chopped" 0 + M.call_closure (| + M.get_struct_tuple_field "combinators_map::Chopped" 0, + [ M.read (| self |) ] + |) |)) ] |))) @@ -189,7 +196,10 @@ Module Impl_core_fmt_Debug_for_combinators_map_Cooked. (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field (M.read (| self |)) "combinators_map::Cooked" 0 + M.call_closure (| + M.get_struct_tuple_field "combinators_map::Cooked" 0, + [ M.read (| self |) ] + |) |)) ] |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/defining_an_error_type.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/defining_an_error_type.v index d0a4e77d5..e7cd21c6d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/defining_an_error_type.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/defining_an_error_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/early_returns.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/early_returns.v index 75a4c1f85..6ff2fa09c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/early_returns.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/early_returns.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn multiply(first_number_str: &str, second_number_str: &str) -> Result { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark.v index c06908142..4f588b5b5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn multiply(first_number_str: &str, second_number_str: &str) -> Result { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v index d3a22ba1d..4b8cefef4 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/introducing_question_mark_is_an_replacement_for_deprecated_try.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn multiply(first_number_str: &str, second_number_str: &str) -> Result { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v index e74b6d22f..b579d97a5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v index 6e274fbff..615603eeb 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_valid_values_and_failures_via_partition_unwrapped.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v index 3427fdcf8..6f0dc3ec2 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_collect_via_map_err_and_filter_map.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v index cde460028..c4feab5cb 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_fail_entire_operation_via_collect.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_failed.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_failed.v index 1388d0414..842909e28 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_failed.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_failed.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v index 8400f305c..fae4bda74 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/iterating_over_results_handle_via_filter_map.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_combinators.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_combinators.v index c9d7f4c6b..29bcc2771 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_combinators.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_combinators.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn multiply(first_number_str: &str, second_number_str: &str) -> Result { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_match.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_match.v index 691a04e63..c4c626be1 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_match.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/map_in_result_via_match.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn multiply(first_number_str: &str, second_number_str: &str) -> Result { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/multiple_error_types.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/multiple_error_types.v index 197245c09..c27aa1878 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/multiple_error_types.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/multiple_error_types.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn double_first(vec: Vec<&str>) -> i32 { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/option_and_unwrap.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/option_and_unwrap.v index ed5cfeccc..c71c8633e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/option_and_unwrap.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/option_and_unwrap.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn give_adult(drink: Option<&str>) { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/other_uses_of_question_mark.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/other_uses_of_question_mark.v index 8c1c2d389..2e0c54109 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/other_uses_of_question_mark.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/other_uses_of_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom Result : forall (T : Ty.t), diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/panic.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/panic.v index c00a7471b..3f2a5f232 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/panic.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/panic.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn drink(beverage: &str) { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options.v index 57cca0372..8c4286ac1 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn double_first(vec: Vec<&str>) -> Option> { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v index 7d9a6581f..8a769ab0b 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/pulling_results_out_of_options_with_stop_error_processing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn double_first(vec: Vec<&str>) -> Result, ParseIntError> { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/result_use_in_main.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/result_use_in_main.v index a9e1e2b82..22dc4877c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/result_use_in_main.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/result_use_in_main.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() -> Result<(), ParseIntError> { diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v index 888ab5f75..c56978a7d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v index 016588f2a..81bf0a32f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_get_or_insert_with.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v index 15da2a247..ff2d07541 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v index cb5808d6d..fa5bae9d6 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_and_defaults_via_or_else.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Fruit diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_via_question_mark.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_via_question_mark.v index 82c196a7f..f016de79d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_via_question_mark.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/unpacking_options_via_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -130,142 +131,152 @@ Module Impl_unpacking_options_via_question_mark_Person. M.catch_return (| ltac:(M.monadic (M.read (| - M.get_struct_record_field - (M.match_operator (| - M.alloc (| - M.call_closure (| - M.get_trait_method (| - "core::ops::try_trait::Try", - Ty.apply - (Ty.path "core::option::Option") - [ Ty.path "unpacking_options_via_question_mark::PhoneNumber" ], - [], - "branch", - [] - |), - [ - M.read (| - M.get_struct_record_field - (M.match_operator (| - M.alloc (| - M.call_closure (| - M.get_trait_method (| - "core::ops::try_trait::Try", - Ty.apply - (Ty.path "core::option::Option") - [ Ty.path "unpacking_options_via_question_mark::Job" ], - [], - "branch", - [] - |), - [ - M.read (| - M.get_struct_record_field - (M.read (| self |)) - "unpacking_options_via_question_mark::Person" - "job" - |) - ] - |) - |), + M.call_closure (| + M.get_struct_record_field + "unpacking_options_via_question_mark::PhoneNumber" + "area_code", + [ + M.match_operator (| + M.alloc (| + M.call_closure (| + M.get_trait_method (| + "core::ops::try_trait::Try", + Ty.apply + (Ty.path "core::option::Option") + [ Ty.path "unpacking_options_via_question_mark::PhoneNumber" ], + [], + "branch", + [] + |), + [ + M.read (| + M.call_closure (| + M.get_struct_record_field + "unpacking_options_via_question_mark::Job" + "phone_number", [ - fun γ => - ltac:(M.monadic - (let γ0_0 := - M.get_struct_tuple_field_or_break_match (| - γ, - "core::ops::control_flow::ControlFlow::Break", - 0 - |) in - let residual := M.copy (| γ0_0 |) in - M.alloc (| - M.never_to_any (| + M.match_operator (| + M.alloc (| + M.call_closure (| + M.get_trait_method (| + "core::ops::try_trait::Try", + Ty.apply + (Ty.path "core::option::Option") + [ Ty.path "unpacking_options_via_question_mark::Job" ], + [], + "branch", + [] + |), + [ M.read (| - M.return_ (| - M.call_closure (| - M.get_trait_method (| - "core::ops::try_trait::FromResidual", - Ty.apply - (Ty.path "core::option::Option") - [ Ty.path "u8" ], - [ - Ty.apply - (Ty.path "core::option::Option") - [ Ty.path "core::convert::Infallible" ] - ], - "from_residual", - [] - |), - [ M.read (| residual |) ] - |) + M.call_closure (| + M.get_struct_record_field + "unpacking_options_via_question_mark::Person" + "job", + [ M.read (| self |) ] |) |) - |) - |))); - fun γ => - ltac:(M.monadic - (let γ0_0 := - M.get_struct_tuple_field_or_break_match (| - γ, - "core::ops::control_flow::ControlFlow::Continue", - 0 - |) in - let val := M.copy (| γ0_0 |) in - val)) - ] - |)) - "unpacking_options_via_question_mark::Job" - "phone_number" - |) - ] - |) - |), - [ - fun γ => - ltac:(M.monadic - (let γ0_0 := - M.get_struct_tuple_field_or_break_match (| - γ, - "core::ops::control_flow::ControlFlow::Break", - 0 - |) in - let residual := M.copy (| γ0_0 |) in - M.alloc (| - M.never_to_any (| - M.read (| - M.return_ (| - M.call_closure (| - M.get_trait_method (| - "core::ops::try_trait::FromResidual", - Ty.apply (Ty.path "core::option::Option") [ Ty.path "u8" ], - [ - Ty.apply - (Ty.path "core::option::Option") - [ Ty.path "core::convert::Infallible" ] - ], - "from_residual", - [] + ] + |) |), - [ M.read (| residual |) ] + [ + fun γ => + ltac:(M.monadic + (let γ0_0 := + M.get_struct_tuple_field_or_break_match (| + γ, + "core::ops::control_flow::ControlFlow::Break", + 0 + |) in + let residual := M.copy (| γ0_0 |) in + M.alloc (| + M.never_to_any (| + M.read (| + M.return_ (| + M.call_closure (| + M.get_trait_method (| + "core::ops::try_trait::FromResidual", + Ty.apply + (Ty.path "core::option::Option") + [ Ty.path "u8" ], + [ + Ty.apply + (Ty.path "core::option::Option") + [ Ty.path "core::convert::Infallible" ] + ], + "from_residual", + [] + |), + [ M.read (| residual |) ] + |) + |) + |) + |) + |))); + fun γ => + ltac:(M.monadic + (let γ0_0 := + M.get_struct_tuple_field_or_break_match (| + γ, + "core::ops::control_flow::ControlFlow::Continue", + 0 + |) in + let val := M.copy (| γ0_0 |) in + val)) + ] |) - |) + ] |) |) - |))); - fun γ => - ltac:(M.monadic - (let γ0_0 := - M.get_struct_tuple_field_or_break_match (| - γ, - "core::ops::control_flow::ControlFlow::Continue", - 0 - |) in - let val := M.copy (| γ0_0 |) in - val)) - ] - |)) - "unpacking_options_via_question_mark::PhoneNumber" - "area_code" + ] + |) + |), + [ + fun γ => + ltac:(M.monadic + (let γ0_0 := + M.get_struct_tuple_field_or_break_match (| + γ, + "core::ops::control_flow::ControlFlow::Break", + 0 + |) in + let residual := M.copy (| γ0_0 |) in + M.alloc (| + M.never_to_any (| + M.read (| + M.return_ (| + M.call_closure (| + M.get_trait_method (| + "core::ops::try_trait::FromResidual", + Ty.apply (Ty.path "core::option::Option") [ Ty.path "u8" ], + [ + Ty.apply + (Ty.path "core::option::Option") + [ Ty.path "core::convert::Infallible" ] + ], + "from_residual", + [] + |), + [ M.read (| residual |) ] + |) + |) + |) + |) + |))); + fun γ => + ltac:(M.monadic + (let γ0_0 := + M.get_struct_tuple_field_or_break_match (| + γ, + "core::ops::control_flow::ControlFlow::Continue", + 0 + |) in + let val := M.copy (| γ0_0 |) in + val)) + ] + |) + ] + |) |))) |))) | _, _ => M.impossible diff --git a/CoqOfRust/examples/default/examples/rust_book/error_handling/wrapping_errors.v b/CoqOfRust/examples/default/examples/rust_book/error_handling/wrapping_errors.v index 305461d39..c6738adbd 100644 --- a/CoqOfRust/examples/default/examples/rust_book/error_handling/wrapping_errors.v +++ b/CoqOfRust/examples/default/examples/rust_book/error_handling/wrapping_errors.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum DoubleError diff --git a/CoqOfRust/examples/default/examples/rust_book/expressions/blocks.v b/CoqOfRust/examples/default/examples/rust_book/expressions/blocks.v index ccb882c13..5c6dad917 100644 --- a/CoqOfRust/examples/default/examples/rust_book/expressions/blocks.v +++ b/CoqOfRust/examples/default/examples/rust_book/expressions/blocks.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/expressions/const_underscore_expression.v b/CoqOfRust/examples/default/examples/rust_book/expressions/const_underscore_expression.v index 94a9475a6..20208bf31 100644 --- a/CoqOfRust/examples/default/examples/rust_book/expressions/const_underscore_expression.v +++ b/CoqOfRust/examples/default/examples/rust_book/expressions/const_underscore_expression.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module underscore. (* StructRecord @@ -21,7 +22,12 @@ Module underscore. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field self "const_underscore_expression::Bar" "test" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "const_underscore_expression::Bar" "test", + [ self ] + |) + |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/rust_book/expressions/statement.v b/CoqOfRust/examples/default/examples/rust_book/expressions/statement.v index d8689eab8..4c7b90ba4 100644 --- a/CoqOfRust/examples/default/examples/rust_book/expressions/statement.v +++ b/CoqOfRust/examples/default/examples/rust_book/expressions/statement.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/expressions/variable_binding_and_expression.v b/CoqOfRust/examples/default/examples/rust_book/expressions/variable_binding_and_expression.v index cd02af4df..8ffbc277c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/expressions/variable_binding_and_expression.v +++ b/CoqOfRust/examples/default/examples/rust_book/expressions/variable_binding_and_expression.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v index 4a13d3739..b737a7d58 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_into_iter.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter.v index 00e48f430..d3aa5ea27 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v index 65dbf3821..8971f0107 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_iterators_iter_mut.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v index 41e3c9c86..15f602f5f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_completely_inclusive.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v index bcaf99f8a..d052fb59d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/for_and_range_inclusive_to_exclusive.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_else.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_else.v index a40877035..95a78fefb 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_else.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_else.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let.v index 4641fe3fb..7a762ac8a 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_challenge.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_challenge.v index 2ef138a17..5a9ef788e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_challenge.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_challenge.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Foo diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_dont_use_match.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_dont_use_match.v index 464afe81e..dac9d279d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_dont_use_match.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_dont_use_match.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_match_enum_values.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_match_enum_values.v index 6b6084c2d..d49a0e9ba 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_match_enum_values.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/if_let_match_enum_values.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Foo diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/infinite_loop.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/infinite_loop.v index 4403b3f19..1b1254cc3 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/infinite_loop.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/infinite_loop.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_nesting_and_labels.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_nesting_and_labels.v index 25ba47f8f..df9a8fea9 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_nesting_and_labels.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_nesting_and_labels.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_returning_from_loops.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_returning_from_loops.v index f7bbd27d6..4048cf5d6 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_returning_from_loops.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/loop_returning_from_loops.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match.v index d32a2aac2..9688a09c9 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding.v index 1827a8fd2..a8d694daa 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn age() -> u32 { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v index f6ea204b2..1eab464bf 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_binding_destructure_enum_variants.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn some_number() -> Option { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v index 88dd9b9ac..1fa6c85df 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_arrays_slices.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_enums.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_enums.v index b9d076b9a..79019262d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_enums.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_enums.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Color diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v index df857d5e8..43e02a3c3 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_pointers_ref.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_structs.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_structs.v index 7711017ba..fd664372f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_structs.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_structs.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples.v index 60b0edf6c..7ac9dbca9 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v index 0f0d57579..ebc0e1f15 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_destructuring_tuples_fixed.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards.v index b01623435..f55c5abf7 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Temperature diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards_unreachable.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards_unreachable.v index 15dccd799..4b7560477 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards_unreachable.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/match_guards_unreachable.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while.v index b7e607a0f..d84f3cfa5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let.v index ea7d10719..4d3cc6701 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let_match_is_weird.v b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let_match_is_weird.v index fe9dfa6a7..e2e4a9592 100644 --- a/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let_match_is_weird.v +++ b/CoqOfRust/examples/default/examples/rust_book/flow_of_control/while_let_match_is_weird.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/associated_functions_and_methods.v b/CoqOfRust/examples/default/examples/rust_book/functions/associated_functions_and_methods.v index 1ea9563a8..3ed3dab94 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/associated_functions_and_methods.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/associated_functions_and_methods.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -73,10 +74,10 @@ Module Impl_associated_functions_and_methods_Rectangle. ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p1" + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p1", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -101,10 +102,10 @@ Module Impl_associated_functions_and_methods_Rectangle. (let self := M.alloc (| self |) in M.read (| M.match_operator (| - M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p1", + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p1", + [ M.read (| self |) ] + |), [ fun γ => ltac:(M.monadic @@ -123,10 +124,10 @@ Module Impl_associated_functions_and_methods_Rectangle. let x1 := M.copy (| γ0_0 |) in let y1 := M.copy (| γ0_1 |) in M.match_operator (| - M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p2", + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p2", + [ M.read (| self |) ] + |), [ fun γ => ltac:(M.monadic @@ -180,10 +181,10 @@ Module Impl_associated_functions_and_methods_Rectangle. (let self := M.alloc (| self |) in M.read (| M.match_operator (| - M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p1", + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p1", + [ M.read (| self |) ] + |), [ fun γ => ltac:(M.monadic @@ -202,10 +203,10 @@ Module Impl_associated_functions_and_methods_Rectangle. let x1 := M.copy (| γ0_0 |) in let y1 := M.copy (| γ0_1 |) in M.match_operator (| - M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p2", + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p2", + [ M.read (| self |) ] + |), [ fun γ => ltac:(M.monadic @@ -267,43 +268,51 @@ Module Impl_associated_functions_and_methods_Rectangle. M.read (| let _ := let β := - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p1") - "associated_functions_and_methods::Point" - "x" in + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Point" "x", + [ + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p1", + [ M.read (| self |) ] + |) + ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), M.read (| x |) |) |) in let _ := let β := - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p2") - "associated_functions_and_methods::Point" - "x" in + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Point" "x", + [ + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p2", + [ M.read (| self |) ] + |) + ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), M.read (| x |) |) |) in let _ := let β := - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p1") - "associated_functions_and_methods::Point" - "y" in + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Point" "y", + [ + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p1", + [ M.read (| self |) ] + |) + ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), M.read (| y |) |) |) in let _ := let β := - M.get_struct_record_field - (M.get_struct_record_field - (M.read (| self |)) - "associated_functions_and_methods::Rectangle" - "p2") - "associated_functions_and_methods::Point" - "y" in + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Point" "y", + [ + M.call_closure (| + M.get_struct_record_field "associated_functions_and_methods::Rectangle" "p2", + [ M.read (| self |) ] + |) + ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), M.read (| y |) |) |) in M.alloc (| Value.Tuple [] |) |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions.v b/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions.v index 94169526c..7198a4021 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v b/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v index bc10c94c8..9399800d4 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_example_sum_odd_numbers.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v b/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v index b53ffdba7..ceb78c28a 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/diverging_functions_no_info_in_return_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn some_fn() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions.v index d1abdeeb3..95042b4de 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn is_divisible_by(lhs: u32, rhs: u32) -> bool { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures.v index 22cb16400..12e4984fc 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_input_parameters.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_input_parameters.v index 05be82b05..b397640c3 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_input_parameters.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_input_parameters.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn apply(f: F) diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_output_parameters.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_output_parameters.v index e18ae03df..2963d1aab 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_output_parameters.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_as_output_parameters.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn create_fn() -> impl Fn() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_capturing.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_capturing.v index 620a0cba7..e34d0837f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_capturing.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_capturing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_Iterator_any.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_Iterator_any.v index a7ef66946..921d0bfcc 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_Iterator_any.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_Iterator_any.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v index 492c32eed..e175c0788 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_find.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v index f1482fff5..60be25b7d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_example_searching_through_iterators_Iterator_position.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v index 5b029fc05..180414422 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_forced_capturing_with_move.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_input_functions.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_input_functions.v index c75ff23fa..f7dadbf4b 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_input_functions.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_input_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn call_me(f: F) { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define.v index 6db32a3aa..b6a6f9a8e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v index abd7a42ad..806988940 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_closures_type_anonymity_define_and_use.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn apply(f: F) diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/functions_order.v b/CoqOfRust/examples/default/examples/rust_book/functions/functions_order.v index 7e421b5a9..607d7b9bb 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/functions_order.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/functions_order.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/functions/higher_order_functions.v b/CoqOfRust/examples/default/examples/rust_book/functions/higher_order_functions.v index 28906b1df..124816384 100644 --- a/CoqOfRust/examples/default/examples/rust_book/functions/higher_order_functions.v +++ b/CoqOfRust/examples/default/examples/rust_book/functions/higher_order_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn is_odd(n: u32) -> bool { diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics.v index c1c1d919e..4e1115a52 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_problem.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_problem.v index 432227132..31231cb5c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_problem.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_problem.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -37,10 +38,10 @@ Module Impl_generics_associated_types_problem_Contains_i32_i32_for_generics_asso |), [ M.alloc (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_problem::Container" - 0 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_problem::Container" 0, + [ M.read (| self |) ] + |) |); number_1 ] @@ -56,10 +57,10 @@ Module Impl_generics_associated_types_problem_Contains_i32_i32_for_generics_asso |), [ M.alloc (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_problem::Container" - 1 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_problem::Container" 1, + [ M.read (| self |) ] + |) |); number_2 ] @@ -79,10 +80,10 @@ Module Impl_generics_associated_types_problem_Contains_i32_i32_for_generics_asso ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_problem::Container" - 0 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_problem::Container" 0, + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -98,10 +99,10 @@ Module Impl_generics_associated_types_problem_Contains_i32_i32_for_generics_asso ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_problem::Container" - 1 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_problem::Container" 1, + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_solution.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_solution.v index c3812e585..6b062150c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_solution.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_associated_types_solution.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -43,10 +44,10 @@ Module Impl_generics_associated_types_solution_Contains_for_generics_associated_ |), [ M.alloc (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_solution::Container" - 0 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_solution::Container" 0, + [ M.read (| self |) ] + |) |); number_1 ] @@ -62,10 +63,10 @@ Module Impl_generics_associated_types_solution_Contains_for_generics_associated_ |), [ M.alloc (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_solution::Container" - 1 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_solution::Container" 1, + [ M.read (| self |) ] + |) |); number_2 ] @@ -85,10 +86,10 @@ Module Impl_generics_associated_types_solution_Contains_for_generics_associated_ ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_solution::Container" - 0 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_solution::Container" 0, + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -104,10 +105,10 @@ Module Impl_generics_associated_types_solution_Contains_for_generics_associated_ ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_solution::Container" - 1 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_solution::Container" 1, + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. @@ -123,10 +124,10 @@ Module Impl_generics_associated_types_solution_Contains_for_generics_associated_ ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_associated_types_solution::Container" - 0 + M.call_closure (| + M.get_struct_tuple_field "generics_associated_types_solution::Container" 0, + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds.v index 13878f2f7..1d0789aeb 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'HasArea' *) @@ -33,12 +34,18 @@ Module Impl_core_fmt_Debug_for_generics_bounds_Rectangle. M.read (| Value.String "length" |); (* Unsize *) M.pointer_coercion - (M.get_struct_record_field (M.read (| self |)) "generics_bounds::Rectangle" "length"); + (M.call_closure (| + M.get_struct_record_field "generics_bounds::Rectangle" "length", + [ M.read (| self |) ] + |)); M.read (| Value.String "height" |); (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_record_field (M.read (| self |)) "generics_bounds::Rectangle" "height" + M.call_closure (| + M.get_struct_record_field "generics_bounds::Rectangle" "height", + [ M.read (| self |) ] + |) |)) ] |))) @@ -75,10 +82,16 @@ Module Impl_generics_bounds_HasArea_for_generics_bounds_Rectangle. (let self := M.alloc (| self |) in BinOp.Panic.mul (| M.read (| - M.get_struct_record_field (M.read (| self |)) "generics_bounds::Rectangle" "length" + M.call_closure (| + M.get_struct_record_field "generics_bounds::Rectangle" "length", + [ M.read (| self |) ] + |) |), M.read (| - M.get_struct_record_field (M.read (| self |)) "generics_bounds::Rectangle" "height" + M.call_closure (| + M.get_struct_record_field "generics_bounds::Rectangle" "height", + [ M.read (| self |) ] + |) |) |))) | _, _ => M.impossible diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v index 77e19dcdb..68078ccb0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_bounds_test_case_empty_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_functions.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_functions.v index 1e0ad887b..590b0df8d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_functions.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_implementation.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_implementation.v index 7c7ae6ddc..56de6c931 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_implementation.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_implementation.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -28,7 +29,10 @@ Module Impl_generics_implementation_Val. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.get_struct_record_field (M.read (| self |)) "generics_implementation::Val" "val")) + M.call_closure (| + M.get_struct_record_field "generics_implementation::Val" "val", + [ M.read (| self |) ] + |))) | _, _ => M.impossible end. @@ -49,7 +53,10 @@ Module Impl_generics_implementation_GenVal_T. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.get_struct_record_field (M.read (| self |)) "generics_implementation::GenVal" "gen_val")) + M.call_closure (| + M.get_struct_record_field "generics_implementation::GenVal" "gen_val", + [ M.read (| self |) ] + |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_multiple_bounds.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_multiple_bounds.v index b1b597946..eb5f151f5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_multiple_bounds.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_multiple_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn compare_prints(t: &T) { diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom.v index 0a309d6cb..065ff0448 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -33,7 +34,10 @@ Module Impl_generics_new_type_idiom_Years. [ BinOp.Panic.mul (| M.read (| - M.get_struct_tuple_field (M.read (| self |)) "generics_new_type_idiom::Years" 0 + M.call_closure (| + M.get_struct_tuple_field "generics_new_type_idiom::Years" 0, + [ M.read (| self |) ] + |) |), Value.Integer Integer.I64 365 |) @@ -62,7 +66,10 @@ Module Impl_generics_new_type_idiom_Days. [ BinOp.Panic.div (| M.read (| - M.get_struct_tuple_field (M.read (| self |)) "generics_new_type_idiom::Days" 0 + M.call_closure (| + M.get_struct_tuple_field "generics_new_type_idiom::Days" 0, + [ M.read (| self |) ] + |) |), Value.Integer Integer.I64 365 |) @@ -85,7 +92,10 @@ Definition old_enough (τ : list Ty.t) (α : list Value.t) : M := (let age := M.alloc (| age |) in BinOp.Pure.ge (M.read (| - M.get_struct_tuple_field (M.read (| age |)) "generics_new_type_idiom::Years" 0 + M.call_closure (| + M.get_struct_tuple_field "generics_new_type_idiom::Years" 0, + [ M.read (| age |) ] + |) |)) (Value.Integer Integer.I64 18))) | _, _ => M.impossible diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v index 49eb3433f..a5b6c79ee 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_new_type_idiom_as_base_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -28,7 +29,10 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := |) in let years_as_primitive_1 := M.copy (| - M.get_struct_tuple_field years "generics_new_type_idiom_as_base_type::Years" 0 + M.call_closure (| + M.get_struct_tuple_field "generics_new_type_idiom_as_base_type::Years" 0, + [ years ] + |) |) in M.match_operator (| years, diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type.v index a6b54ef1e..4b6694a57 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -37,8 +38,14 @@ Module Impl_core_cmp_PartialEq_where_core_cmp_PartialEq_A_where_core_cmp_Partial M.call_closure (| M.get_trait_method (| "core::cmp::PartialEq", A, [ A ], "eq", [] |), [ - M.get_struct_tuple_field (M.read (| self |)) "generics_phantom_type::PhantomTuple" 0; - M.get_struct_tuple_field (M.read (| other |)) "generics_phantom_type::PhantomTuple" 0 + M.call_closure (| + M.get_struct_tuple_field "generics_phantom_type::PhantomTuple" 0, + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_tuple_field "generics_phantom_type::PhantomTuple" 0, + [ M.read (| other |) ] + |) ] |), ltac:(M.monadic @@ -51,14 +58,14 @@ Module Impl_core_cmp_PartialEq_where_core_cmp_PartialEq_A_where_core_cmp_Partial [] |), [ - M.get_struct_tuple_field - (M.read (| self |)) - "generics_phantom_type::PhantomTuple" - 1; - M.get_struct_tuple_field - (M.read (| other |)) - "generics_phantom_type::PhantomTuple" - 1 + M.call_closure (| + M.get_struct_tuple_field "generics_phantom_type::PhantomTuple" 1, + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_tuple_field "generics_phantom_type::PhantomTuple" 1, + [ M.read (| other |) ] + |) ] |))) |))) @@ -110,14 +117,14 @@ Module Impl_core_cmp_PartialEq_where_core_cmp_PartialEq_A_where_core_cmp_Partial M.call_closure (| M.get_trait_method (| "core::cmp::PartialEq", A, [ A ], "eq", [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "generics_phantom_type::PhantomStruct" - "first"; - M.get_struct_record_field - (M.read (| other |)) - "generics_phantom_type::PhantomStruct" - "first" + M.call_closure (| + M.get_struct_record_field "generics_phantom_type::PhantomStruct" "first", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "generics_phantom_type::PhantomStruct" "first", + [ M.read (| other |) ] + |) ] |), ltac:(M.monadic @@ -130,14 +137,14 @@ Module Impl_core_cmp_PartialEq_where_core_cmp_PartialEq_A_where_core_cmp_Partial [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "generics_phantom_type::PhantomStruct" - "phantom"; - M.get_struct_record_field - (M.read (| other |)) - "generics_phantom_type::PhantomStruct" - "phantom" + M.call_closure (| + M.get_struct_record_field "generics_phantom_type::PhantomStruct" "phantom", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "generics_phantom_type::PhantomStruct" "phantom", + [ M.read (| other |) ] + |) ] |))) |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v index 9104c797f..339ed0cd0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_phantom_type_test_case_unit_clarification.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Enum Inch @@ -147,17 +148,21 @@ Module Impl_core_fmt_Debug_where_core_fmt_Debug_Unit_for_generics_phantom_type_t M.read (| Value.String "Length" |); (* Unsize *) M.pointer_coercion - (M.get_struct_tuple_field - (M.read (| self |)) - "generics_phantom_type_test_case_unit_clarification::Length" - 0); + (M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 0, + [ M.read (| self |) ] + |)); (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field - (M.read (| self |)) - "generics_phantom_type_test_case_unit_clarification::Length" - 1 + M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 1, + [ M.read (| self |) ] + |) |)) ] |))) @@ -190,10 +195,12 @@ Module Impl_core_clone_Clone_where_core_clone_Clone_Unit_for_generics_phantom_ty M.call_closure (| M.get_trait_method (| "core::clone::Clone", Ty.path "f64", [], "clone", [] |), [ - M.get_struct_tuple_field - (M.read (| self |)) - "generics_phantom_type_test_case_unit_clarification::Length" - 0 + M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 0, + [ M.read (| self |) ] + |) ] |); M.call_closure (| @@ -205,10 +212,12 @@ Module Impl_core_clone_Clone_where_core_clone_Clone_Unit_for_generics_phantom_ty [] |), [ - M.get_struct_tuple_field - (M.read (| self |)) - "generics_phantom_type_test_case_unit_clarification::Length" - 1 + M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 1, + [ M.read (| self |) ] + |) ] |) ])) @@ -263,16 +272,20 @@ Module Impl_core_ops_arith_Add_for_generics_phantom_type_test_case_unit_clarific [ BinOp.Panic.add (| M.read (| - M.get_struct_tuple_field - self - "generics_phantom_type_test_case_unit_clarification::Length" - 0 + M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 0, + [ self ] + |) |), M.read (| - M.get_struct_tuple_field - rhs - "generics_phantom_type_test_case_unit_clarification::Length" - 0 + M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 0, + [ rhs ] + |) |) |); Value.StructTuple "core::marker::PhantomData" [] @@ -399,10 +412,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "f64" ] |), [ - M.get_struct_tuple_field - two_feet - "generics_phantom_type_test_case_unit_clarification::Length" - 0 + M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 0, + [ two_feet ] + |) ] |) ] @@ -444,10 +459,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "f64" ] |), [ - M.get_struct_tuple_field - two_meters - "generics_phantom_type_test_case_unit_clarification::Length" - 0 + M.call_closure (| + M.get_struct_tuple_field + "generics_phantom_type_test_case_unit_clarification::Length" + 0, + [ two_meters ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_traits.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_traits.v index 02e4a197e..5b5e0fd8b 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_traits.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/generics/generics_where_clauses.v b/CoqOfRust/examples/default/examples/rust_book/generics/generics_where_clauses.v index 7001d5512..e18a4d5b8 100644 --- a/CoqOfRust/examples/default/examples/rust_book/generics/generics_where_clauses.v +++ b/CoqOfRust/examples/default/examples/rust_book/generics/generics_where_clauses.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'PrintInOption' *) diff --git a/CoqOfRust/examples/default/examples/rust_book/guessing_game/guessing_game.v b/CoqOfRust/examples/default/examples/rust_book/guessing_game/guessing_game.v index cf46fe332..537186e96 100644 --- a/CoqOfRust/examples/default/examples/rust_book/guessing_game/guessing_game.v +++ b/CoqOfRust/examples/default/examples/rust_book/guessing_game/guessing_game.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn gen_range() -> u32 { diff --git a/CoqOfRust/examples/default/examples/rust_book/hello_world/formatted_print.v b/CoqOfRust/examples/default/examples/rust_book/hello_world/formatted_print.v index bf6c68c66..da28204b0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/hello_world/formatted_print.v +++ b/CoqOfRust/examples/default/examples/rust_book/hello_world/formatted_print.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/hello_world/hello_world.v b/CoqOfRust/examples/default/examples/rust_book/hello_world/hello_world.v index d3ea4451c..ab0c4924c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/hello_world/hello_world.v +++ b/CoqOfRust/examples/default/examples/rust_book/hello_world/hello_world.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_example.v b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_example.v index 4b3c55e46..260981f04 100644 --- a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_example.v +++ b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_example.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_designators.v b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_designators.v index 5b3ebfa1b..9db726cc4 100644 --- a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_designators.v +++ b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_designators.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn $func_name() { diff --git a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_dsl.v b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_dsl.v index effe126ee..6e6d953cd 100644 --- a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_dsl.v +++ b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_dsl.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_overload.v b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_overload.v index 8aa0dba54..aef998694 100644 --- a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_overload.v +++ b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_overload.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_repeat.v b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_repeat.v index 46c916959..a33781f37 100644 --- a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_repeat.v +++ b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_repeat.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v index 2d375a672..c943a129d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v +++ b/CoqOfRust/examples/default/examples/rust_book/macro_rules/macro_rules_variadic_interfaces.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/modules/struct_visibility.v b/CoqOfRust/examples/default/examples/rust_book/modules/struct_visibility.v index a0b53ea27..2b688f8bf 100644 --- a/CoqOfRust/examples/default/examples/rust_book/modules/struct_visibility.v +++ b/CoqOfRust/examples/default/examples/rust_book/modules/struct_visibility.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module my. (* StructRecord @@ -108,10 +109,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - open_box - "struct_visibility::my::OpenBox" - "contents" + M.call_closure (| + M.get_struct_record_field + "struct_visibility::my::OpenBox" + "contents", + [ open_box ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/modules/super_and_self.v b/CoqOfRust/examples/default/examples/rust_book/modules/super_and_self.v index dab788279..460616390 100644 --- a/CoqOfRust/examples/default/examples/rust_book/modules/super_and_self.v +++ b/CoqOfRust/examples/default/examples/rust_book/modules/super_and_self.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn function() { diff --git a/CoqOfRust/examples/default/examples/rust_book/modules/the_use_as_declaration.v b/CoqOfRust/examples/default/examples/rust_book/modules/the_use_as_declaration.v index 76f4daa94..5df1a85d5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/modules/the_use_as_declaration.v +++ b/CoqOfRust/examples/default/examples/rust_book/modules/the_use_as_declaration.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn function() { diff --git a/CoqOfRust/examples/default/examples/rust_book/modules/visibility.v b/CoqOfRust/examples/default/examples/rust_book/modules/visibility.v index 809ca35a8..7f498a603 100644 --- a/CoqOfRust/examples/default/examples/rust_book/modules/visibility.v +++ b/CoqOfRust/examples/default/examples/rust_book/modules/visibility.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module my_mod. (* diff --git a/CoqOfRust/examples/default/examples/rust_book/primitives/arrays_and_slices.v b/CoqOfRust/examples/default/examples/rust_book/primitives/arrays_and_slices.v index 93a0d96b5..768e37051 100644 --- a/CoqOfRust/examples/default/examples/rust_book/primitives/arrays_and_slices.v +++ b/CoqOfRust/examples/default/examples/rust_book/primitives/arrays_and_slices.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn analyze_slice(slice: &[i32]) { diff --git a/CoqOfRust/examples/default/examples/rust_book/primitives/compound_types.v b/CoqOfRust/examples/default/examples/rust_book/primitives/compound_types.v index bfc813093..3ee41f354 100644 --- a/CoqOfRust/examples/default/examples/rust_book/primitives/compound_types.v +++ b/CoqOfRust/examples/default/examples/rust_book/primitives/compound_types.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/primitives/literals_operators.v b/CoqOfRust/examples/default/examples/rust_book/primitives/literals_operators.v index eb394456f..c81e2d182 100644 --- a/CoqOfRust/examples/default/examples/rust_book/primitives/literals_operators.v +++ b/CoqOfRust/examples/default/examples/rust_book/primitives/literals_operators.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/primitives/tuples.v b/CoqOfRust/examples/default/examples/rust_book/primitives/tuples.v index c2cc84144..51246f9ba 100644 --- a/CoqOfRust/examples/default/examples/rust_book/primitives/tuples.v +++ b/CoqOfRust/examples/default/examples/rust_book/primitives/tuples.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn reverse(pair: (i32, bool)) -> (bool, i32) { @@ -58,14 +59,31 @@ Module Impl_core_fmt_Debug_for_tuples_Matrix. M.read (| f |); M.read (| Value.String "Matrix" |); (* Unsize *) - M.pointer_coercion (M.get_struct_tuple_field (M.read (| self |)) "tuples::Matrix" 0); + M.pointer_coercion + (M.call_closure (| + M.get_struct_tuple_field "tuples::Matrix" 0, + [ M.read (| self |) ] + |)); (* Unsize *) - M.pointer_coercion (M.get_struct_tuple_field (M.read (| self |)) "tuples::Matrix" 1); + M.pointer_coercion + (M.call_closure (| + M.get_struct_tuple_field "tuples::Matrix" 1, + [ M.read (| self |) ] + |)); (* Unsize *) - M.pointer_coercion (M.get_struct_tuple_field (M.read (| self |)) "tuples::Matrix" 2); + M.pointer_coercion + (M.call_closure (| + M.get_struct_tuple_field "tuples::Matrix" 2, + [ M.read (| self |) ] + |)); (* Unsize *) M.pointer_coercion - (M.alloc (| M.get_struct_tuple_field (M.read (| self |)) "tuples::Matrix" 3 |)) + (M.alloc (| + M.call_closure (| + M.get_struct_tuple_field "tuples::Matrix" 3, + [ M.read (| self |) ] + |) + |)) ] |))) | _, _ => M.impossible diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing.v index dc871cf99..9c6f7b7f1 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn eat_box_i32(boxed_i32: Box) { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v index 654e9f033..a878061db 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_aliasing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -115,10 +116,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| borrowed_point |)) - "scoping_rules_borrowing_aliasing::Point" - "x" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "x", + [ M.read (| borrowed_point |) ] + |) ] |); M.call_closure (| @@ -128,10 +131,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| another_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "y" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "y", + [ M.read (| another_borrow |) ] + |) ] |); M.call_closure (| @@ -141,10 +146,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - point - "scoping_rules_borrowing_aliasing::Point" - "z" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "z", + [ point ] + |) ] |) ] @@ -188,10 +195,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| borrowed_point |)) - "scoping_rules_borrowing_aliasing::Point" - "x" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "x", + [ M.read (| borrowed_point |) ] + |) ] |); M.call_closure (| @@ -201,10 +210,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| another_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "y" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "y", + [ M.read (| another_borrow |) ] + |) ] |); M.call_closure (| @@ -214,10 +225,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - point - "scoping_rules_borrowing_aliasing::Point" - "z" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "z", + [ point ] + |) ] |) ] @@ -231,26 +244,26 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := let mutable_borrow := M.alloc (| point |) in let _ := M.write (| - M.get_struct_record_field - (M.read (| mutable_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "x", + M.call_closure (| + M.get_struct_record_field "scoping_rules_borrowing_aliasing::Point" "x", + [ M.read (| mutable_borrow |) ] + |), Value.Integer Integer.I32 5 |) in let _ := M.write (| - M.get_struct_record_field - (M.read (| mutable_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "y", + M.call_closure (| + M.get_struct_record_field "scoping_rules_borrowing_aliasing::Point" "y", + [ M.read (| mutable_borrow |) ] + |), Value.Integer Integer.I32 2 |) in let _ := M.write (| - M.get_struct_record_field - (M.read (| mutable_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "z", + M.call_closure (| + M.get_struct_record_field "scoping_rules_borrowing_aliasing::Point" "z", + [ M.read (| mutable_borrow |) ] + |), Value.Integer Integer.I32 1 |) in let _ := @@ -286,10 +299,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| mutable_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "x" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "x", + [ M.read (| mutable_borrow |) ] + |) ] |); M.call_closure (| @@ -299,10 +314,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| mutable_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "y" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "y", + [ M.read (| mutable_borrow |) ] + |) ] |); M.call_closure (| @@ -312,10 +329,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| mutable_borrow |)) - "scoping_rules_borrowing_aliasing::Point" - "z" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "z", + [ M.read (| mutable_borrow |) ] + |) ] |) ] @@ -360,10 +379,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| new_borrowed_point |)) - "scoping_rules_borrowing_aliasing::Point" - "x" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "x", + [ M.read (| new_borrowed_point |) ] + |) ] |); M.call_closure (| @@ -373,10 +394,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| new_borrowed_point |)) - "scoping_rules_borrowing_aliasing::Point" - "y" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "y", + [ M.read (| new_borrowed_point |) ] + |) ] |); M.call_closure (| @@ -386,10 +409,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - (M.read (| new_borrowed_point |)) - "scoping_rules_borrowing_aliasing::Point" - "z" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_aliasing::Point" + "z", + [ M.read (| new_borrowed_point |) ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v index 404088bc0..e7cd00044 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_mutablity.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -106,10 +107,12 @@ Definition borrow_book (τ : list Ty.t) (α : list Value.t) : M := [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - (M.read (| book |)) - "scoping_rules_borrowing_mutablity::Book" - "title" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_mutablity::Book" + "title", + [ M.read (| book |) ] + |) ] |); M.call_closure (| @@ -119,10 +122,12 @@ Definition borrow_book (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "u32" ] |), [ - M.get_struct_record_field - (M.read (| book |)) - "scoping_rules_borrowing_mutablity::Book" - "year" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_mutablity::Book" + "year", + [ M.read (| book |) ] + |) ] |) ] @@ -152,10 +157,10 @@ Definition new_edition (τ : list Ty.t) (α : list Value.t) : M := M.read (| let _ := M.write (| - M.get_struct_record_field - (M.read (| book |)) - "scoping_rules_borrowing_mutablity::Book" - "year", + M.call_closure (| + M.get_struct_record_field "scoping_rules_borrowing_mutablity::Book" "year", + [ M.read (| book |) ] + |), Value.Integer Integer.U32 2014 |) in let _ := @@ -190,10 +195,12 @@ Definition new_edition (τ : list Ty.t) (α : list Value.t) : M := [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - (M.read (| book |)) - "scoping_rules_borrowing_mutablity::Book" - "title" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_mutablity::Book" + "title", + [ M.read (| book |) ] + |) ] |); M.call_closure (| @@ -203,10 +210,12 @@ Definition new_edition (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "u32" ] |), [ - M.get_struct_record_field - (M.read (| book |)) - "scoping_rules_borrowing_mutablity::Book" - "year" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_mutablity::Book" + "year", + [ M.read (| book |) ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v index cdb930b8f..49e228ed3 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_borrowing_the_ref_pattern.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -252,10 +253,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - point - "scoping_rules_borrowing_the_ref_pattern::Point" - "x" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_the_ref_pattern::Point" + "x", + [ point ] + |) ] |); M.call_closure (| @@ -265,10 +268,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - point - "scoping_rules_borrowing_the_ref_pattern::Point" - "y" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_the_ref_pattern::Point" + "y", + [ point ] + |) ] |) ] @@ -315,10 +320,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - mutable_point - "scoping_rules_borrowing_the_ref_pattern::Point" - "x" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_the_ref_pattern::Point" + "x", + [ mutable_point ] + |) ] |); M.call_closure (| @@ -328,10 +335,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := [ Ty.path "i32" ] |), [ - M.get_struct_record_field - mutable_point - "scoping_rules_borrowing_the_ref_pattern::Point" - "y" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_borrowing_the_ref_pattern::Point" + "y", + [ mutable_point ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v index 1f61baf74..ed924c8e0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v index 9468629af..4e228e0f8 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_bounds.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -32,7 +33,10 @@ Module Impl_core_fmt_Debug_where_core_fmt_Debug_T_for_scoping_rules_lifetimes_bo (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field (M.read (| self |)) "scoping_rules_lifetimes_bounds::Ref" 0 + M.call_closure (| + M.get_struct_tuple_field "scoping_rules_lifetimes_bounds::Ref" 0, + [ M.read (| self |) ] + |) |)) ] |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v index f888ab960..af56cbcf0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_coercion.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn multiply<'a>(first: &'a i32, second: &'a i32) -> i32 { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v index 11bbd6c8c..aa314f172 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_elision.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn elided_input(x: &i32) { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v index f4ce2f686..82cba5e7f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn print_one<'a>(x: &'a i32) { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v index 189574b93..4ff6ab085 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_methods.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -24,10 +25,10 @@ Module Impl_scoping_rules_lifetimes_methods_Owner. M.read (| let _ := let β := - M.get_struct_tuple_field - (M.read (| self |)) - "scoping_rules_lifetimes_methods::Owner" - 0 in + M.call_closure (| + M.get_struct_tuple_field "scoping_rules_lifetimes_methods::Owner" 0, + [ M.read (| self |) ] + |) in M.write (| β, BinOp.Panic.add (| M.read (| β |), Value.Integer Integer.I32 1 |) |) in M.alloc (| Value.Tuple [] |) |))) @@ -76,10 +77,12 @@ Module Impl_scoping_rules_lifetimes_methods_Owner. [ Ty.path "i32" ] |), [ - M.get_struct_tuple_field - (M.read (| self |)) - "scoping_rules_lifetimes_methods::Owner" - 0 + M.call_closure (| + M.get_struct_tuple_field + "scoping_rules_lifetimes_methods::Owner" + 0, + [ M.read (| self |) ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v index 21f08ca4a..59655947a 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_reference_lifetime_static.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Definition value_NUM : Value.t := M.run ltac:(M.monadic (M.alloc (| M.alloc (| Value.Integer Integer.I32 18 |) |))). diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v index 4679506d7..9f392271f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_structs.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -30,10 +31,10 @@ Module Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_Borrowed. (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_tuple_field - (M.read (| self |)) - "scoping_rules_lifetimes_structs::Borrowed" - 0 + M.call_closure (| + M.get_struct_tuple_field "scoping_rules_lifetimes_structs::Borrowed" 0, + [ M.read (| self |) ] + |) |)) ] |))) @@ -81,18 +82,18 @@ Module Impl_core_fmt_Debug_for_scoping_rules_lifetimes_structs_NamedBorrowed. M.read (| Value.String "x" |); (* Unsize *) M.pointer_coercion - (M.get_struct_record_field - (M.read (| self |)) - "scoping_rules_lifetimes_structs::NamedBorrowed" - "x"); + (M.call_closure (| + M.get_struct_record_field "scoping_rules_lifetimes_structs::NamedBorrowed" "x", + [ M.read (| self |) ] + |)); M.read (| Value.String "y" |); (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_record_field - (M.read (| self |)) - "scoping_rules_lifetimes_structs::NamedBorrowed" - "y" + M.call_closure (| + M.get_struct_record_field "scoping_rules_lifetimes_structs::NamedBorrowed" "y", + [ M.read (| self |) ] + |) |)) ] |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v index 5de59a34e..13a5ce60e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_lifetimes_traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -31,10 +32,10 @@ Module Impl_core_fmt_Debug_for_scoping_rules_lifetimes_traits_Borrowed. (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_record_field - (M.read (| self |)) - "scoping_rules_lifetimes_traits::Borrowed" - "x" + M.call_closure (| + M.get_struct_record_field "scoping_rules_lifetimes_traits::Borrowed" "x", + [ M.read (| self |) ] + |) |)) ] |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v index abfb69b56..4fe1929d8 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn destroy_box(c: Box) { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v index bca0f51ca..9f02d3b5b 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_mutablity.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v index a8c54c493..83616528d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_ownership_and_rules_partial_moves.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { @@ -218,10 +219,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := ] |), [ - M.get_struct_record_field - person - "scoping_rules_ownership_and_rules_partial_moves::main::Person" - "age" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_ownership_and_rules_partial_moves::main::Person" + "age", + [ person ] + |) ] |) ] @@ -275,18 +278,22 @@ Module main. M.read (| Value.String "name" |); (* Unsize *) M.pointer_coercion - (M.get_struct_record_field - (M.read (| self |)) - "scoping_rules_ownership_and_rules_partial_moves::main::Person" - "name"); + (M.call_closure (| + M.get_struct_record_field + "scoping_rules_ownership_and_rules_partial_moves::main::Person" + "name", + [ M.read (| self |) ] + |)); M.read (| Value.String "age" |); (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_record_field - (M.read (| self |)) - "scoping_rules_ownership_and_rules_partial_moves::main::Person" - "age" + M.call_closure (| + M.get_struct_record_field + "scoping_rules_ownership_and_rules_partial_moves::main::Person" + "age", + [ M.read (| self |) ] + |) |)) ] |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii.v index 1a9542ee9..31da9edf6 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn create_box() { diff --git a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v index c60115168..93278ee8e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v +++ b/CoqOfRust/examples/default/examples/rust_book/scoping_rules/scoping_rules_raii_desctructor.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/arc.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/arc.v index adc61a47f..679e4093c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/arc.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/arc.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/box_stack_heap.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/box_stack_heap.v index 32b572c65..5ffbc8361 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/box_stack_heap.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/box_stack_heap.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -30,12 +31,18 @@ Module Impl_core_fmt_Debug_for_box_stack_heap_Point. M.read (| Value.String "x" |); (* Unsize *) M.pointer_coercion - (M.get_struct_record_field (M.read (| self |)) "box_stack_heap::Point" "x"); + (M.call_closure (| + M.get_struct_record_field "box_stack_heap::Point" "x", + [ M.read (| self |) ] + |)); M.read (| Value.String "y" |); (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_record_field (M.read (| self |)) "box_stack_heap::Point" "y" + M.call_closure (| + M.get_struct_record_field "box_stack_heap::Point" "y", + [ M.read (| self |) ] + |) |)) ] |))) diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map.v index 823185f3a..09afd159b 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn call(number: &str) -> &str { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v index 4810c8601..80533d85d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_alternate_or_custom_key_types.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -43,14 +44,18 @@ Module Impl_core_cmp_PartialEq_for_hash_map_alternate_or_custom_key_types_Accoun [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "hash_map_alternate_or_custom_key_types::Account" - "username"; - M.get_struct_record_field - (M.read (| other |)) - "hash_map_alternate_or_custom_key_types::Account" - "username" + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::Account" + "username", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::Account" + "username", + [ M.read (| other |) ] + |) ] |), ltac:(M.monadic @@ -63,14 +68,18 @@ Module Impl_core_cmp_PartialEq_for_hash_map_alternate_or_custom_key_types_Accoun [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "hash_map_alternate_or_custom_key_types::Account" - "password"; - M.get_struct_record_field - (M.read (| other |)) - "hash_map_alternate_or_custom_key_types::Account" - "password" + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::Account" + "password", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::Account" + "password", + [ M.read (| other |) ] + |) ] |))) |))) @@ -152,10 +161,12 @@ Module Impl_core_hash_Hash_for_hash_map_alternate_or_custom_key_types_Account. [ __H ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "hash_map_alternate_or_custom_key_types::Account" - "username"; + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::Account" + "username", + [ M.read (| self |) ] + |); M.read (| state |) ] |) @@ -170,10 +181,12 @@ Module Impl_core_hash_Hash_for_hash_map_alternate_or_custom_key_types_Account. [ __H ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "hash_map_alternate_or_custom_key_types::Account" - "password"; + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::Account" + "password", + [ M.read (| self |) ] + |); M.read (| state |) ] |) @@ -427,10 +440,12 @@ Definition try_logon (τ : list Ty.t) (α : list Value.t) : M := [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - (M.read (| account_info |)) - "hash_map_alternate_or_custom_key_types::AccountInfo" - "name" + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::AccountInfo" + "name", + [ M.read (| account_info |) ] + |) ] |) ] @@ -476,10 +491,12 @@ Definition try_logon (τ : list Ty.t) (α : list Value.t) : M := [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - (M.read (| account_info |)) - "hash_map_alternate_or_custom_key_types::AccountInfo" - "email" + M.call_closure (| + M.get_struct_record_field + "hash_map_alternate_or_custom_key_types::AccountInfo" + "email", + [ M.read (| account_info |) ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_hash_set.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_hash_set.v index 4c3f207ab..dc3c33fce 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_hash_set.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/hash_map_hash_set.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/option.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/option.v index 7eb66c878..97dc7e516 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/option.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/option.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn checked_division(dividend: i32, divisor: i32) -> Option { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/panic.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/panic.v index 334493da9..bb123694c 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/panic.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/panic.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn division(dividend: i32, divisor: i32) -> i32 { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/rc.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/rc.v index 254aff09f..789a9854e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/rc.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/rc.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/result.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/result.v index d129d020a..816a00dc5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/result.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/result.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module checked. (* diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/result_chaining_with_question_mark.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/result_chaining_with_question_mark.v index f939941cc..82b5f6be0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/result_chaining_with_question_mark.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/result_chaining_with_question_mark.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Module checked. (* diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings.v index 0ace87b51..612f3b5d5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v index a4e80ff64..1dab9d956 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_byte_strings_as_non_utf8.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_literals_and_escapes.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_literals_and_escapes.v index 8b738961e..a7129384a 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_literals_and_escapes.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_literals_and_escapes.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_raw_string_literals.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_raw_string_literals.v index 5da747534..57736ef46 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_raw_string_literals.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/strings_raw_string_literals.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_library_types/vectors.v b/CoqOfRust/examples/default/examples/rust_book/std_library_types/vectors.v index 9eb90a808..150aa7e90 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_library_types/vectors.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_library_types/vectors.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/channels.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/channels.v index ab1bde6a1..1bbf79e04 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/channels.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/channels.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Definition value_NTHREADS : Value.t := M.run ltac:(M.monadic (M.alloc (| M.alloc (| Value.Integer Integer.I32 3 |) |))). diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes.v index 21731bb2e..5763a0d15 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { @@ -137,7 +138,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "success", [] |), - [ M.get_struct_record_field output "std::process::Output" "status" ] + [ + M.call_closure (| + M.get_struct_record_field "std::process::Output" "status", + [ output ] + |) + ] |) |)) in let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in @@ -160,7 +166,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "deref", [] |), - [ M.get_struct_record_field output "std::process::Output" "stdout" ] + [ + M.call_closure (| + M.get_struct_record_field "std::process::Output" "stdout", + [ output ] + |) + ] |) ] |) @@ -232,7 +243,12 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "deref", [] |), - [ M.get_struct_record_field output "std::process::Output" "stderr" ] + [ + M.call_closure (| + M.get_struct_record_field "std::process::Output" "stderr", + [ output ] + |) + ] |) ] |) diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_pipes.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_pipes.v index ab585c5bf..388f008be 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_pipes.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_pipes.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Definition value_PANGRAM : Value.t := M.run @@ -182,7 +183,13 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "unwrap", [] |), - [ M.read (| M.get_struct_record_field process "std::process::Child" "stdin" |) + [ + M.read (| + M.call_closure (| + M.get_struct_record_field "std::process::Child" "stdin", + [ process ] + |) + |) ] |) |); @@ -307,7 +314,13 @@ Definition main (τ : list Ty.t) (α : list Value.t) : M := "unwrap", [] |), - [ M.read (| M.get_struct_record_field process "std::process::Child" "stdout" |) + [ + M.read (| + M.call_closure (| + M.get_struct_record_field "std::process::Child" "stdout", + [ process ] + |) + |) ] |) |); diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_wait.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_wait.v index 893438178..eb8efb7d7 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_wait.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/child_processes_wait.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_create.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_create.v index 853780e74..537572972 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_create.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_create.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Definition value_LOREM_IPSUM : Value.t := M.run diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_open.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_open.v index de4f53491..6516b90c4 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_open.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_open.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines.v index 92eebf085..3876c26e2 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn read_lines(filename: String) -> io::Lines> { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v index a792122d7..50c86a7b0 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/file_io_read_lines_efficient_method.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn read_lines

(filename: P) -> io::Result>> diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/filesystem_operations.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/filesystem_operations.v index ca851c403..1d16cdc54 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/filesystem_operations.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/filesystem_operations.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn cat(path: &Path) -> io::Result { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/foreign_function_interface.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/foreign_function_interface.v index de51e2c71..ca8e9073d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/foreign_function_interface.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/foreign_function_interface.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Unhandled foreign module here *) @@ -231,10 +232,10 @@ Module Impl_core_fmt_Debug_for_foreign_function_interface_Complex. (M.alloc (| BinOp.Pure.lt (M.read (| - M.get_struct_record_field - (M.read (| self |)) - "foreign_function_interface::Complex" - "im" + M.call_closure (| + M.get_struct_record_field "foreign_function_interface::Complex" "im", + [ M.read (| self |) ] + |) |)) (M.read (| UnsupportedLiteral |)) |)) in @@ -277,10 +278,12 @@ Module Impl_core_fmt_Debug_for_foreign_function_interface_Complex. [ Ty.path "f32" ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "foreign_function_interface::Complex" - "re" + M.call_closure (| + M.get_struct_record_field + "foreign_function_interface::Complex" + "re", + [ M.read (| self |) ] + |) ] |); M.call_closure (| @@ -293,10 +296,12 @@ Module Impl_core_fmt_Debug_for_foreign_function_interface_Complex. M.alloc (| UnOp.Panic.neg (| M.read (| - M.get_struct_record_field - (M.read (| self |)) - "foreign_function_interface::Complex" - "im" + M.call_closure (| + M.get_struct_record_field + "foreign_function_interface::Complex" + "im", + [ M.read (| self |) ] + |) |) |) |) @@ -349,10 +354,12 @@ Module Impl_core_fmt_Debug_for_foreign_function_interface_Complex. [ Ty.path "f32" ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "foreign_function_interface::Complex" - "re" + M.call_closure (| + M.get_struct_record_field + "foreign_function_interface::Complex" + "re", + [ M.read (| self |) ] + |) ] |); M.call_closure (| @@ -362,10 +369,12 @@ Module Impl_core_fmt_Debug_for_foreign_function_interface_Complex. [ Ty.path "f32" ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "foreign_function_interface::Complex" - "im" + M.call_closure (| + M.get_struct_record_field + "foreign_function_interface::Complex" + "im", + [ M.read (| self |) ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/path.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/path.v index c636dcda8..1eee7b0a4 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/path.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/path.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments.v index 96acd0902..c13c99818 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments_parsing.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments_parsing.v index 3a8f435f5..4b28691a7 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments_parsing.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/program_arguments_parsing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn increase(number: i32) { diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/threads.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/threads.v index e39c4e739..9331a6728 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/threads.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/threads.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Definition value_NTHREADS : Value.t := M.run ltac:(M.monadic (M.alloc (| Value.Integer Integer.U32 10 |))). diff --git a/CoqOfRust/examples/default/examples/rust_book/std_misc/threads_test_case_map_reduce.v b/CoqOfRust/examples/default/examples/rust_book/std_misc/threads_test_case_map_reduce.v index 5f4cfae9a..88ee516d8 100644 --- a/CoqOfRust/examples/default/examples/rust_book/std_misc/threads_test_case_map_reduce.v +++ b/CoqOfRust/examples/default/examples/rust_book/std_misc/threads_test_case_map_reduce.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/testing/documentation_testing.v b/CoqOfRust/examples/default/examples/rust_book/testing/documentation_testing.v index 388b5926e..5eb79c5d9 100644 --- a/CoqOfRust/examples/default/examples/rust_book/testing/documentation_testing.v +++ b/CoqOfRust/examples/default/examples/rust_book/testing/documentation_testing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* pub fn add(a: i32, b: i32) -> i32 { diff --git a/CoqOfRust/examples/default/examples/rust_book/testing/unit_testing.v b/CoqOfRust/examples/default/examples/rust_book/testing/unit_testing.v index 011c0ea31..b6f7661fd 100644 --- a/CoqOfRust/examples/default/examples/rust_book/testing/unit_testing.v +++ b/CoqOfRust/examples/default/examples/rust_book/testing/unit_testing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* pub fn add(a: i32, b: i32) -> i32 { diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/clone.v b/CoqOfRust/examples/default/examples/rust_book/traits/clone.v index 11abc4d4a..c7615bae5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/clone.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/clone.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -94,7 +95,8 @@ Module Impl_core_clone_Clone_for_clone_Pair. "clone", [] |), - [ M.get_struct_tuple_field (M.read (| self |)) "clone::Pair" 0 ] + [ M.call_closure (| M.get_struct_tuple_field "clone::Pair" 0, [ M.read (| self |) ] |) + ] |); M.call_closure (| M.get_trait_method (| @@ -106,7 +108,8 @@ Module Impl_core_clone_Clone_for_clone_Pair. "clone", [] |), - [ M.get_struct_tuple_field (M.read (| self |)) "clone::Pair" 1 ] + [ M.call_closure (| M.get_struct_tuple_field "clone::Pair" 1, [ M.read (| self |) ] |) + ] |) ])) | _, _ => M.impossible @@ -140,10 +143,16 @@ Module Impl_core_fmt_Debug_for_clone_Pair. M.read (| f |); M.read (| Value.String "Pair" |); (* Unsize *) - M.pointer_coercion (M.get_struct_tuple_field (M.read (| self |)) "clone::Pair" 0); + M.pointer_coercion + (M.call_closure (| + M.get_struct_tuple_field "clone::Pair" 0, + [ M.read (| self |) ] + |)); (* Unsize *) M.pointer_coercion - (M.alloc (| M.get_struct_tuple_field (M.read (| self |)) "clone::Pair" 1 |)) + (M.alloc (| + M.call_closure (| M.get_struct_tuple_field "clone::Pair" 1, [ M.read (| self |) ] |) + |)) ] |))) | _, _ => M.impossible diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/derive.v b/CoqOfRust/examples/default/examples/rust_book/traits/derive.v index 640c4ad3a..3a402b537 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/derive.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/derive.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -30,8 +31,18 @@ Module Impl_core_cmp_PartialEq_for_derive_Centimeters. (let self := M.alloc (| self |) in let other := M.alloc (| other |) in BinOp.Pure.eq - (M.read (| M.get_struct_tuple_field (M.read (| self |)) "derive::Centimeters" 0 |)) - (M.read (| M.get_struct_tuple_field (M.read (| other |)) "derive::Centimeters" 0 |)))) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "derive::Centimeters" 0, + [ M.read (| self |) ] + |) + |)) + (M.read (| + M.call_closure (| + M.get_struct_tuple_field "derive::Centimeters" 0, + [ M.read (| other |) ] + |) + |)))) | _, _ => M.impossible end. @@ -62,8 +73,14 @@ Module Impl_core_cmp_PartialOrd_for_derive_Centimeters. [] |), [ - M.get_struct_tuple_field (M.read (| self |)) "derive::Centimeters" 0; - M.get_struct_tuple_field (M.read (| other |)) "derive::Centimeters" 0 + M.call_closure (| + M.get_struct_tuple_field "derive::Centimeters" 0, + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_tuple_field "derive::Centimeters" 0, + [ M.read (| other |) ] + |) ] |))) | _, _ => M.impossible @@ -105,7 +122,12 @@ Module Impl_core_fmt_Debug_for_derive_Inches. M.read (| Value.String "Inches" |); (* Unsize *) M.pointer_coercion - (M.alloc (| M.get_struct_tuple_field (M.read (| self |)) "derive::Inches" 0 |)) + (M.alloc (| + M.call_closure (| + M.get_struct_tuple_field "derive::Inches" 0, + [ M.read (| self |) ] + |) + |)) ] |))) | _, _ => M.impossible diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/disambiguating_overlapping_traits.v b/CoqOfRust/examples/default/examples/rust_book/traits/disambiguating_overlapping_traits.v index 73adee82b..c597f4a64 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/disambiguating_overlapping_traits.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/disambiguating_overlapping_traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'UsernameWidget' *) @@ -36,10 +37,10 @@ Module Impl_disambiguating_overlapping_traits_UsernameWidget_for_disambiguating_ [] |), [ - M.get_struct_record_field - (M.read (| self |)) - "disambiguating_overlapping_traits::Form" - "username" + M.call_closure (| + M.get_struct_record_field "disambiguating_overlapping_traits::Form" "username", + [ M.read (| self |) ] + |) ] |))) | _, _ => M.impossible @@ -67,10 +68,10 @@ Module Impl_disambiguating_overlapping_traits_AgeWidget_for_disambiguating_overl ltac:(M.monadic (let self := M.alloc (| self |) in M.read (| - M.get_struct_record_field - (M.read (| self |)) - "disambiguating_overlapping_traits::Form" - "age" + M.call_closure (| + M.get_struct_record_field "disambiguating_overlapping_traits::Form" "age", + [ M.read (| self |) ] + |) |))) | _, _ => M.impossible end. diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/drop.v b/CoqOfRust/examples/default/examples/rust_book/traits/drop.v index 9f9d464ad..40f2b717b 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/drop.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/drop.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -53,10 +54,10 @@ Module Impl_core_ops_drop_Drop_for_drop_Droppable. [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "drop::Droppable" - "name" + M.call_closure (| + M.get_struct_record_field "drop::Droppable" "name", + [ M.read (| self |) ] + |) ] |) ] diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/hash.v b/CoqOfRust/examples/default/examples/rust_book/traits/hash.v index 0dbae73ec..2f8a72480 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/hash.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/hash.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -26,7 +27,10 @@ Module Impl_core_hash_Hash_for_hash_Person. M.call_closure (| M.get_trait_method (| "core::hash::Hash", Ty.path "u32", [], "hash", [ __H ] |), [ - M.get_struct_record_field (M.read (| self |)) "hash::Person" "id"; + M.call_closure (| + M.get_struct_record_field "hash::Person" "id", + [ M.read (| self |) ] + |); M.read (| state |) ] |) @@ -42,7 +46,10 @@ Module Impl_core_hash_Hash_for_hash_Person. [ __H ] |), [ - M.get_struct_record_field (M.read (| self |)) "hash::Person" "name"; + M.call_closure (| + M.get_struct_record_field "hash::Person" "name", + [ M.read (| self |) ] + |); M.read (| state |) ] |) @@ -51,7 +58,10 @@ Module Impl_core_hash_Hash_for_hash_Person. M.call_closure (| M.get_trait_method (| "core::hash::Hash", Ty.path "u64", [], "hash", [ __H ] |), [ - M.get_struct_record_field (M.read (| self |)) "hash::Person" "phone"; + M.call_closure (| + M.get_struct_record_field "hash::Person" "phone", + [ M.read (| self |) ] + |); M.read (| state |) ] |) diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/impl_trait_as_return_type.v b/CoqOfRust/examples/default/examples/rust_book/traits/impl_trait_as_return_type.v index c5bc0ddec..373f8b107 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/impl_trait_as_return_type.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/impl_trait_as_return_type.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn combine_vecs_explicit_return_type( diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/iterators.v b/CoqOfRust/examples/default/examples/rust_book/traits/iterators.v index fdbb07763..17e00ea13 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/iterators.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/iterators.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -34,22 +35,37 @@ Module Impl_core_iter_traits_iterator_Iterator_for_iterators_Fibonacci. M.read (| let current := M.copy (| - M.get_struct_record_field (M.read (| self |)) "iterators::Fibonacci" "curr" + M.call_closure (| + M.get_struct_record_field "iterators::Fibonacci" "curr", + [ M.read (| self |) ] + |) |) in let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "iterators::Fibonacci" "curr", + M.call_closure (| + M.get_struct_record_field "iterators::Fibonacci" "curr", + [ M.read (| self |) ] + |), M.read (| - M.get_struct_record_field (M.read (| self |)) "iterators::Fibonacci" "next" + M.call_closure (| + M.get_struct_record_field "iterators::Fibonacci" "next", + [ M.read (| self |) ] + |) |) |) in let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "iterators::Fibonacci" "next", + M.call_closure (| + M.get_struct_record_field "iterators::Fibonacci" "next", + [ M.read (| self |) ] + |), BinOp.Panic.add (| M.read (| current |), M.read (| - M.get_struct_record_field (M.read (| self |)) "iterators::Fibonacci" "next" + M.call_closure (| + M.get_struct_record_field "iterators::Fibonacci" "next", + [ M.read (| self |) ] + |) |) |) |) in diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/operator_overloading.v b/CoqOfRust/examples/default/examples/rust_book/traits/operator_overloading.v index c668642c4..2a72f17af 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/operator_overloading.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/operator_overloading.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/returning_traits_with_dyn.v b/CoqOfRust/examples/default/examples/rust_book/traits/returning_traits_with_dyn.v index f12147188..67f6bb151 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/returning_traits_with_dyn.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/returning_traits_with_dyn.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/supertraits.v b/CoqOfRust/examples/default/examples/rust_book/traits/supertraits.v index a4471c40c..9f22b7198 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/supertraits.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/supertraits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Person' *) diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/traits.v b/CoqOfRust/examples/default/examples/rust_book/traits/traits.v index 6b966e81f..694304674 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/traits.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/traits.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructRecord { @@ -112,7 +113,12 @@ Module Impl_traits_Sheep. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "traits::Sheep" "naked" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "traits::Sheep" "naked", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -244,10 +250,10 @@ Module Impl_traits_Sheep. [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "traits::Sheep" - "name" + M.call_closure (| + M.get_struct_record_field "traits::Sheep" "name", + [ M.read (| self |) ] + |) ] |) ] @@ -260,7 +266,10 @@ Module Impl_traits_Sheep. M.alloc (| Value.Tuple [] |) in let _ := M.write (| - M.get_struct_record_field (M.read (| self |)) "traits::Sheep" "naked", + M.call_closure (| + M.get_struct_record_field "traits::Sheep" "naked", + [ M.read (| self |) ] + |), Value.Bool true |) in M.alloc (| Value.Tuple [] |))) @@ -305,7 +314,12 @@ Module Impl_traits_Animal_for_traits_Sheep. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "traits::Sheep" "name" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "traits::Sheep" "name", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -390,10 +404,10 @@ Module Impl_traits_Animal_for_traits_Sheep. [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ] |), [ - M.get_struct_record_field - (M.read (| self |)) - "traits::Sheep" - "name" + M.call_closure (| + M.get_struct_record_field "traits::Sheep" "name", + [ M.read (| self |) ] + |) ] |); M.call_closure (| diff --git a/CoqOfRust/examples/default/examples/rust_book/traits/traits_parms.v b/CoqOfRust/examples/default/examples/rust_book/traits/traits_parms.v index 69d70dcad..55ebc12c8 100644 --- a/CoqOfRust/examples/default/examples/rust_book/traits/traits_parms.v +++ b/CoqOfRust/examples/default/examples/rust_book/traits/traits_parms.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* Trait *) (* Empty module 'Foo' *) diff --git a/CoqOfRust/examples/default/examples/rust_book/types/aliasing.v b/CoqOfRust/examples/default/examples/rust_book/types/aliasing.v index e8476395b..7e187516d 100644 --- a/CoqOfRust/examples/default/examples/rust_book/types/aliasing.v +++ b/CoqOfRust/examples/default/examples/rust_book/types/aliasing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. Axiom NanoSecond : (Ty.path "aliasing::NanoSecond") = (Ty.path "u64"). diff --git a/CoqOfRust/examples/default/examples/rust_book/types/casting.v b/CoqOfRust/examples/default/examples/rust_book/types/casting.v index 693041862..bcd63dad2 100644 --- a/CoqOfRust/examples/default/examples/rust_book/types/casting.v +++ b/CoqOfRust/examples/default/examples/rust_book/types/casting.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/types/inference.v b/CoqOfRust/examples/default/examples/rust_book/types/inference.v index f2fd95a2d..f5658aa06 100644 --- a/CoqOfRust/examples/default/examples/rust_book/types/inference.v +++ b/CoqOfRust/examples/default/examples/rust_book/types/inference.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/types/literals.v b/CoqOfRust/examples/default/examples/rust_book/types/literals.v index 24439cb22..e8a800184 100644 --- a/CoqOfRust/examples/default/examples/rust_book/types/literals.v +++ b/CoqOfRust/examples/default/examples/rust_book/types/literals.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/calling_unsafe_functions.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/calling_unsafe_functions.v index b088ae23d..bff0d5e6f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/calling_unsafe_functions.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/calling_unsafe_functions.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly.v index 858ce2035..1e6d39e09 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v index 0f8377644..d7dcbea23 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_clobbered_registers.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v index 456a311ff..e0da008f5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_explicit_register_operands.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v index 8ff325782..ce30a7eb8 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_implemented.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v index ec2a3759b..9741b5439 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_case_non_used.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v index 9b58e0445..1dc3e5c36 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inlateout_mul.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inout.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inout.v index c0bbad186..9f5518527 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inout.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inout.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v index 179eef422..f20550bcb 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v index 830fa868b..e83140af6 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v index dfe380cae..e004cf2e6 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_inputs_and_outputs_another_example_without_mov.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_labels.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_labels.v index ac7a95f5b..1ce6024ad 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_labels.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_labels.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v index d3b9d31fd..6f14933cf 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_memory_address_operands.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_options.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_options.v index 4c995e79f..a4e700e91 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_options.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_options.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v index 1c2519a9b..bdfd7d514 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_register_template_modifiers.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v index f02179803..98982b47e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_scratch_register.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v index a8df505be..b81650550 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/inline_assembly_symbol_operands_and_abi_clobbers.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/raw_pointers.v b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/raw_pointers.v index b4c03af1e..67800b88f 100644 --- a/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/raw_pointers.v +++ b/CoqOfRust/examples/default/examples/rust_book/unsafe_operations/raw_pointers.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/declare_first.v b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/declare_first.v index 0900821cb..78d506d07 100644 --- a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/declare_first.v +++ b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/declare_first.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/freezing.v b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/freezing.v index 452c0ae6a..5c4aa0cf3 100644 --- a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/freezing.v +++ b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/freezing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/mutability.v b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/mutability.v index c205c2e63..2f970fe4e 100644 --- a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/mutability.v +++ b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/mutability.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/scope.v b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/scope.v index 8ddf0306c..d014d02ed 100644 --- a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/scope.v +++ b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/scope.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_bindings.v b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_bindings.v index eaf8144a8..c4aa20578 100644 --- a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_bindings.v +++ b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_bindings.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_shadowing.v b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_shadowing.v index befc19127..fa0ba90b5 100644 --- a/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_shadowing.v +++ b/CoqOfRust/examples/default/examples/rust_book/variable_bindings/variable_shadowing.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* fn main() { diff --git a/CoqOfRust/examples/default/examples/subtle.v b/CoqOfRust/examples/default/examples/subtle.v index df28c0f62..7e4a9d372 100644 --- a/CoqOfRust/examples/default/examples/subtle.v +++ b/CoqOfRust/examples/default/examples/subtle.v @@ -1,5 +1,6 @@ (* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. (* StructTuple { @@ -62,7 +63,12 @@ Module Impl_core_fmt_Debug_for_subtle_Choice. M.read (| Value.String "Choice" |); (* Unsize *) M.pointer_coercion - (M.alloc (| M.get_struct_tuple_field (M.read (| self |)) "subtle::Choice" 0 |)) + (M.alloc (| + M.call_closure (| + M.get_struct_tuple_field "subtle::Choice" 0, + [ M.read (| self |) ] + |) + |)) ] |))) | _, _ => M.impossible @@ -89,7 +95,9 @@ Module Impl_subtle_Choice. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_tuple_field (M.read (| self |)) "subtle::Choice" 0 |))) + M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ M.read (| self |) ] |) + |))) | _, _ => M.impossible end. @@ -132,12 +140,18 @@ Module Impl_core_convert_From_subtle_Choice_for_bool. (BinOp.Pure.bit_or (BinOp.Pure.eq (M.read (| - M.get_struct_tuple_field source "subtle::Choice" 0 + M.call_closure (| + M.get_struct_tuple_field "subtle::Choice" 0, + [ source ] + |) |)) (Value.Integer Integer.U8 0)) (BinOp.Pure.eq (M.read (| - M.get_struct_tuple_field source "subtle::Choice" 0 + M.call_closure (| + M.get_struct_tuple_field "subtle::Choice" 0, + [ source ] + |) |)) (Value.Integer Integer.U8 1))) |)) in @@ -168,7 +182,9 @@ Module Impl_core_convert_From_subtle_Choice_for_bool. |) in M.alloc (| BinOp.Pure.ne - (M.read (| M.get_struct_tuple_field source "subtle::Choice" 0 |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ source ] |) + |)) (Value.Integer Integer.U8 0) |) |))) @@ -210,8 +226,12 @@ Module Impl_core_ops_bit_BitAnd_for_subtle_Choice. |), [ BinOp.Pure.bit_and - (M.read (| M.get_struct_tuple_field self "subtle::Choice" 0 |)) - (M.read (| M.get_struct_tuple_field rhs "subtle::Choice" 0 |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ self ] |) + |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ rhs ] |) + |)) ] |))) | _, _ => M.impossible @@ -295,8 +315,12 @@ Module Impl_core_ops_bit_BitOr_for_subtle_Choice. |), [ BinOp.Pure.bit_or - (M.read (| M.get_struct_tuple_field self "subtle::Choice" 0 |)) - (M.read (| M.get_struct_tuple_field rhs "subtle::Choice" 0 |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ self ] |) + |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ rhs ] |) + |)) ] |))) | _, _ => M.impossible @@ -380,8 +404,12 @@ Module Impl_core_ops_bit_BitXor_for_subtle_Choice. |), [ BinOp.Pure.bit_xor - (M.read (| M.get_struct_tuple_field self "subtle::Choice" 0 |)) - (M.read (| M.get_struct_tuple_field rhs "subtle::Choice" 0 |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ self ] |) + |)) + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ rhs ] |) + |)) ] |))) | _, _ => M.impossible @@ -465,7 +493,10 @@ Module Impl_core_ops_bit_Not_for_subtle_Choice. [ BinOp.Pure.bit_and (Value.Integer Integer.U8 1) - (UnOp.Pure.not (M.read (| M.get_struct_tuple_field self "subtle::Choice" 0 |))) + (UnOp.Pure.not + (M.read (| + M.call_closure (| M.get_struct_tuple_field "subtle::Choice" 0, [ self ] |) + |))) ] |))) | _, _ => M.impossible @@ -2887,8 +2918,14 @@ Module Impl_subtle_ConditionallySelectable_for_subtle_Choice. [] |), [ - M.get_struct_tuple_field (M.read (| a |)) "subtle::Choice" 0; - M.get_struct_tuple_field (M.read (| b |)) "subtle::Choice" 0; + M.call_closure (| + M.get_struct_tuple_field "subtle::Choice" 0, + [ M.read (| a |) ] + |); + M.call_closure (| + M.get_struct_tuple_field "subtle::Choice" 0, + [ M.read (| b |) ] + |); M.read (| choice |) ] |) @@ -2988,7 +3025,12 @@ Module Impl_core_clone_Clone_where_core_clone_Clone_T_for_subtle_CtOption_T. ("value", M.call_closure (| M.get_trait_method (| "core::clone::Clone", T, [], "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "subtle::CtOption" "value" ] + [ + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ M.read (| self |) ] + |) + ] |)); ("is_some", M.call_closure (| @@ -2999,7 +3041,12 @@ Module Impl_core_clone_Clone_where_core_clone_Clone_T_for_subtle_CtOption_T. "clone", [] |), - [ M.get_struct_record_field (M.read (| self |)) "subtle::CtOption" "is_some" ] + [ + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ M.read (| self |) ] + |) + ] |)) ])) | _, _ => M.impossible @@ -3049,12 +3096,18 @@ Module Impl_core_fmt_Debug_where_core_fmt_Debug_T_for_subtle_CtOption_T. M.read (| Value.String "value" |); (* Unsize *) M.pointer_coercion - (M.get_struct_record_field (M.read (| self |)) "subtle::CtOption" "value"); + (M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ M.read (| self |) ] + |)); M.read (| Value.String "is_some" |); (* Unsize *) M.pointer_coercion (M.alloc (| - M.get_struct_record_field (M.read (| self |)) "subtle::CtOption" "is_some" + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ M.read (| self |) ] + |) |)) ] |))) @@ -3123,7 +3176,14 @@ Module Impl_core_convert_From_subtle_CtOption_T_for_core_option_Option_T. M.alloc (| Value.StructTuple "core::option::Option::Some" - [ M.read (| M.get_struct_record_field source "subtle::CtOption" "value" |) ] + [ + M.read (| + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ source ] + |) + |) + ] |))); fun γ => ltac:(M.monadic (M.alloc (| Value.StructTuple "core::option::Option::None" [] |))) @@ -3191,7 +3251,12 @@ Module Impl_subtle_CtOption_T. M.alloc (| M.call_closure (| M.get_associated_function (| Ty.path "subtle::Choice", "unwrap_u8", [] |), - [ M.get_struct_record_field self "subtle::CtOption" "is_some" ] + [ + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ self ] + |) + ] |) |); M.alloc (| Value.Integer Integer.U8 1 |) @@ -3284,7 +3349,7 @@ Module Impl_subtle_CtOption_T. |))) ] |) in - M.get_struct_record_field self "subtle::CtOption" "value" + M.call_closure (| M.get_struct_record_field "subtle::CtOption" "value", [ self ] |) |))) | _, _ => M.impossible end. @@ -3315,7 +3380,12 @@ Module Impl_subtle_CtOption_T. M.alloc (| M.call_closure (| M.get_associated_function (| Ty.path "subtle::Choice", "unwrap_u8", [] |), - [ M.get_struct_record_field self "subtle::CtOption" "is_some" ] + [ + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ self ] + |) + ] |) |); M.alloc (| Value.Integer Integer.U8 1 |) @@ -3372,7 +3442,7 @@ Module Impl_subtle_CtOption_T. |))) ] |) in - M.get_struct_record_field self "subtle::CtOption" "value" + M.call_closure (| M.get_struct_record_field "subtle::CtOption" "value", [ self ] |) |))) | _, _ => M.impossible end. @@ -3406,8 +3476,10 @@ Module Impl_subtle_CtOption_T. |), [ def; - M.get_struct_record_field self "subtle::CtOption" "value"; - M.read (| M.get_struct_record_field self "subtle::CtOption" "is_some" |) + M.call_closure (| M.get_struct_record_field "subtle::CtOption" "value", [ self ] |); + M.read (| + M.call_closure (| M.get_struct_record_field "subtle::CtOption" "is_some", [ self ] |) + |) ] |))) | _, _ => M.impossible @@ -3454,8 +3526,10 @@ Module Impl_subtle_CtOption_T. [ M.read (| f |); Value.Tuple [] ] |) |); - M.get_struct_record_field self "subtle::CtOption" "value"; - M.read (| M.get_struct_record_field self "subtle::CtOption" "is_some" |) + M.call_closure (| M.get_struct_record_field "subtle::CtOption" "value", [ self ] |); + M.read (| + M.call_closure (| M.get_struct_record_field "subtle::CtOption" "is_some", [ self ] |) + |) ] |))) | _, _ => M.impossible @@ -3476,7 +3550,12 @@ Module Impl_subtle_CtOption_T. | [], [ self ] => ltac:(M.monadic (let self := M.alloc (| self |) in - M.read (| M.get_struct_record_field (M.read (| self |)) "subtle::CtOption" "is_some" |))) + M.read (| + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ M.read (| self |) ] + |) + |))) | _, _ => M.impossible end. @@ -3497,7 +3576,13 @@ Module Impl_subtle_CtOption_T. (let self := M.alloc (| self |) in M.call_closure (| M.get_trait_method (| "core::ops::bit::Not", Ty.path "subtle::Choice", [], "not", [] |), - [ M.read (| M.get_struct_record_field (M.read (| self |)) "subtle::CtOption" "is_some" |) + [ + M.read (| + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ M.read (| self |) ] + |) + |) ] |))) | _, _ => M.impossible @@ -3560,14 +3645,24 @@ Module Impl_subtle_CtOption_T. [] |) |); - M.get_struct_record_field self "subtle::CtOption" "value"; - M.read (| M.get_struct_record_field self "subtle::CtOption" "is_some" |) + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ self ] + |); + M.read (| + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ self ] + |) + |) ] |) ] ] |); - M.read (| M.get_struct_record_field self "subtle::CtOption" "is_some" |) + M.read (| + M.call_closure (| M.get_struct_record_field "subtle::CtOption" "is_some", [ self ] |) + |) ] |))) | _, _ => M.impossible @@ -3634,8 +3729,16 @@ Module Impl_subtle_CtOption_T. [] |) |); - M.get_struct_record_field self "subtle::CtOption" "value"; - M.read (| M.get_struct_record_field self "subtle::CtOption" "is_some" |) + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ self ] + |); + M.read (| + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ self ] + |) + |) ] |) ] @@ -3653,8 +3756,16 @@ Module Impl_subtle_CtOption_T. [] |), [ - M.get_struct_record_field tmp "subtle::CtOption" "is_some"; - M.read (| M.get_struct_record_field self "subtle::CtOption" "is_some" |) + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ tmp ] + |); + M.read (| + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ self ] + |) + |) ] |) |) in @@ -3763,8 +3874,14 @@ Module Impl_subtle_ConditionallySelectable_where_subtle_ConditionallySelectable_ [] |), [ - M.get_struct_record_field (M.read (| a |)) "subtle::CtOption" "value"; - M.get_struct_record_field (M.read (| b |)) "subtle::CtOption" "value"; + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ M.read (| a |) ] + |); + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ M.read (| b |) ] + |); M.read (| choice |) ] |); @@ -3777,8 +3894,14 @@ Module Impl_subtle_ConditionallySelectable_where_subtle_ConditionallySelectable_ [] |), [ - M.get_struct_record_field (M.read (| a |)) "subtle::CtOption" "is_some"; - M.get_struct_record_field (M.read (| b |)) "subtle::CtOption" "is_some"; + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ M.read (| a |) ] + |); + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "is_some", + [ M.read (| b |) ] + |); M.read (| choice |) ] |) @@ -3869,8 +3992,14 @@ Module Impl_subtle_ConstantTimeEq_where_subtle_ConstantTimeEq_T_for_subtle_CtOpt M.call_closure (| M.get_trait_method (| "subtle::ConstantTimeEq", T, [], "ct_eq", [] |), [ - M.get_struct_record_field (M.read (| self |)) "subtle::CtOption" "value"; - M.get_struct_record_field (M.read (| rhs |)) "subtle::CtOption" "value" + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ M.read (| self |) ] + |); + M.call_closure (| + M.get_struct_record_field "subtle::CtOption" "value", + [ M.read (| rhs |) ] + |) ] |) ] diff --git a/CoqOfRust/lib/lib.v b/CoqOfRust/lib/lib.v index 65abab2cf..33de9a1de 100644 --- a/CoqOfRust/lib/lib.v +++ b/CoqOfRust/lib/lib.v @@ -14,7 +14,7 @@ Global Open Scope type_scope. Export List.ListNotations. Require Export CoqOfRust.M. -Export M.Notations. +Import M.Notations. Module List. (** Check the equality of two lists. *) @@ -26,20 +26,13 @@ Module List. end. End List. -Definition assign (target : Value.t) (source : Value.t) : M := - let* _ := M.write target source in - M.alloc (Value.Tuple []). +(** A value with an address of type `ref str`. *) +Definition mk_str (s : string) : M := + let* p := M.alloc (Value.String s) in + alloc p. (** ** Integer types *) -(** A value with an address of type `ref str`. *) -Definition mk_str (s : string) : Value.t := - Value.Pointer (Pointer.Immediate ( - Value.Pointer (Pointer.Immediate ( - Value.String s - )) - )). - Module IntegerDescription. Class C (Self : M.Integer.t) : Set := { (** Apply the modulo operation in case of overflows. *) diff --git a/CoqOfRust/lib/simulations/lib.v b/CoqOfRust/lib/typed/lib.v similarity index 97% rename from CoqOfRust/lib/simulations/lib.v rename to CoqOfRust/lib/typed/lib.v index 79bbbc209..a6bfd141d 100644 --- a/CoqOfRust/lib/simulations/lib.v +++ b/CoqOfRust/lib/typed/lib.v @@ -1,7 +1,5 @@ Require Import CoqOfRust.CoqOfRust. -Require Import CoqOfRust.simulations.M. - -Import simulations.M.Notations. +Require Import CoqOfRust.typed.M. Module u8. Inductive t : Set := diff --git a/CoqOfRust/simulations/M.v b/CoqOfRust/simulations/M.v index 9db88bab9..70ff3f857 100644 --- a/CoqOfRust/simulations/M.v +++ b/CoqOfRust/simulations/M.v @@ -1,102 +1,5 @@ Require Import CoqOfRust.CoqOfRust. -Class ToValue (A : Set) : Set := { - Φ : Ty.t; - φ : A -> Value.t; -}. -Arguments Φ _ {_}. - -(** For tuples we provide a canonical way to convert to values. *) -Module TupleIsToValue. - Global Instance I0 : ToValue unit := { - Φ := Ty.tuple []; - φ 'tt := Value.Tuple []; - }. - - Global Instance I2 (A1 A2 : Set) - (_ : ToValue A1) - (_ : ToValue A2) : - ToValue (A1 * A2) := { - Φ := Ty.tuple [Φ A1; Φ A2]; - φ '(x1, x2) := Value.Tuple [φ x1; φ x2]; - }. - - Global Instance I3 (A1 A2 A3 : Set) - (_ : ToValue A1) - (_ : ToValue A2) - (_ : ToValue A3) : - ToValue (A1 * A2 * A3) := { - Φ := Ty.tuple [Φ A1; Φ A2; Φ A3]; - φ '(x1, x2, x3) := - Value.Tuple [φ x1; φ x2; φ x3]; - }. - - Global Instance I4 (A1 A2 A3 A4 : Set) - (_ : ToValue A1) - (_ : ToValue A2) - (_ : ToValue A3) - (_ : ToValue A4) : - ToValue (A1 * A2 * A3 * A4) := { - Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4]; - φ '(x1, x2, x3, x4) := - Value.Tuple [φ x1; φ x2; φ x3; φ x4]; - }. - - Global Instance I5 (A1 A2 A3 A4 A5 : Set) - (_ : ToValue A1) - (_ : ToValue A2) - (_ : ToValue A3) - (_ : ToValue A4) - (_ : ToValue A5) : - ToValue (A1 * A2 * A3 * A4 * A5) := { - Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5]; - φ '(x1, x2, x3, x4, x5) := - Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5]; - }. - - Global Instance I6 (A1 A2 A3 A4 A5 A6 : Set) - (_ : ToValue A1) - (_ : ToValue A2) - (_ : ToValue A3) - (_ : ToValue A4) - (_ : ToValue A5) - (_ : ToValue A6) : - ToValue (A1 * A2 * A3 * A4 * A5 * A6) := { - Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5; Φ A6]; - φ '(x1, x2, x3, x4, x5, x6) := - Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5; φ x6]; - }. - - Global Instance I7 (A1 A2 A3 A4 A5 A6 A7 : Set) - (_ : ToValue A1) - (_ : ToValue A2) - (_ : ToValue A3) - (_ : ToValue A4) - (_ : ToValue A5) - (_ : ToValue A6) - (_ : ToValue A7) : - ToValue (A1 * A2 * A3 * A4 * A5 * A6 * A7) := { - Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5; Φ A6; Φ A7]; - φ '(x1, x2, x3, x4, x5, x6, x7) := - Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5; φ x6; φ x7]; - }. - - Global Instance I8 (A1 A2 A3 A4 A5 A6 A7 A8 : Set) - (_ : ToValue A1) - (_ : ToValue A2) - (_ : ToValue A3) - (_ : ToValue A4) - (_ : ToValue A5) - (_ : ToValue A6) - (_ : ToValue A7) - (_ : ToValue A8) : - ToValue (A1 * A2 * A3 * A4 * A5 * A6 * A7 * A8) := { - Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5; Φ A6; Φ A7; Φ A8]; - φ '(x1, x2, x3, x4, x5, x6, x7, x8) := - Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5; φ x6; φ x7; φ x8]; - }. -End TupleIsToValue. - (** ** Monads that are useful for the definition of simulations. *) Module Error. diff --git a/CoqOfRust/typed/M.v b/CoqOfRust/typed/M.v new file mode 100644 index 000000000..9054db5a4 --- /dev/null +++ b/CoqOfRust/typed/M.v @@ -0,0 +1,739 @@ +(** * The definition of a Rust monad with high-level types, for the simulations. *) +Require Import CoqOfRust.CoqOfRust. +Require Import CoqOfRust.simulations.M. + +Import List.ListNotations. + +Local Open Scope list. + +(** ** Translation from a high-level type to a value. *) + +Class ToValue (A : Set) : Set := { + Φ : Ty.t; + φ : A -> Value.t; +}. +Arguments Φ _ {_}. + +Module Empty_setIsToValue. + Global Instance I : ToValue Empty_set := { + Φ := Ty.path "never"; + φ v := match v with end; + }. +End Empty_setIsToValue. + +Module StringIsToValue. + Global Instance I : ToValue string := { + Φ := Ty.path "str"; + φ v := Value.String v; + }. +End StringIsToValue. + +(** For tuples we provide a canonical way to convert to values. *) +Module TupleIsToValue. + Global Instance I0 : ToValue unit := { + Φ := Ty.tuple []; + φ 'tt := Value.Tuple []; + }. + + Global Instance I2 (A1 A2 : Set) + (_ : ToValue A1) + (_ : ToValue A2) : + ToValue (A1 * A2) := { + Φ := Ty.tuple [Φ A1; Φ A2]; + φ '(x1, x2) := Value.Tuple [φ x1; φ x2]; + }. + + Global Instance I3 (A1 A2 A3 : Set) + (_ : ToValue A1) + (_ : ToValue A2) + (_ : ToValue A3) : + ToValue (A1 * A2 * A3) := { + Φ := Ty.tuple [Φ A1; Φ A2; Φ A3]; + φ '(x1, x2, x3) := + Value.Tuple [φ x1; φ x2; φ x3]; + }. + + Global Instance I4 (A1 A2 A3 A4 : Set) + (_ : ToValue A1) + (_ : ToValue A2) + (_ : ToValue A3) + (_ : ToValue A4) : + ToValue (A1 * A2 * A3 * A4) := { + Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4]; + φ '(x1, x2, x3, x4) := + Value.Tuple [φ x1; φ x2; φ x3; φ x4]; + }. + + Global Instance I5 (A1 A2 A3 A4 A5 : Set) + (_ : ToValue A1) + (_ : ToValue A2) + (_ : ToValue A3) + (_ : ToValue A4) + (_ : ToValue A5) : + ToValue (A1 * A2 * A3 * A4 * A5) := { + Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5]; + φ '(x1, x2, x3, x4, x5) := + Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5]; + }. + + Global Instance I6 (A1 A2 A3 A4 A5 A6 : Set) + (_ : ToValue A1) + (_ : ToValue A2) + (_ : ToValue A3) + (_ : ToValue A4) + (_ : ToValue A5) + (_ : ToValue A6) : + ToValue (A1 * A2 * A3 * A4 * A5 * A6) := { + Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5; Φ A6]; + φ '(x1, x2, x3, x4, x5, x6) := + Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5; φ x6]; + }. + + Global Instance I7 (A1 A2 A3 A4 A5 A6 A7 : Set) + (_ : ToValue A1) + (_ : ToValue A2) + (_ : ToValue A3) + (_ : ToValue A4) + (_ : ToValue A5) + (_ : ToValue A6) + (_ : ToValue A7) : + ToValue (A1 * A2 * A3 * A4 * A5 * A6 * A7) := { + Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5; Φ A6; Φ A7]; + φ '(x1, x2, x3, x4, x5, x6, x7) := + Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5; φ x6; φ x7]; + }. + + Global Instance I8 (A1 A2 A3 A4 A5 A6 A7 A8 : Set) + (_ : ToValue A1) + (_ : ToValue A2) + (_ : ToValue A3) + (_ : ToValue A4) + (_ : ToValue A5) + (_ : ToValue A6) + (_ : ToValue A7) + (_ : ToValue A8) : + ToValue (A1 * A2 * A3 * A4 * A5 * A6 * A7 * A8) := { + Φ := Ty.tuple [Φ A1; Φ A2; Φ A3; Φ A4; Φ A5; Φ A6; Φ A7; Φ A8]; + φ '(x1, x2, x3, x4, x5, x6, x7, x8) := + Value.Tuple [φ x1; φ x2; φ x3; φ x4; φ x5; φ x6; φ x7; φ x8]; + }. +End TupleIsToValue. + +Module Pointer. + Module Address. + Inductive t (A : Set) : Set := + | Null + | Immediate (value : A) + | Mutable {Address : Set} (address : Address). + Arguments Null {_}. + Arguments Immediate {_}. + Arguments Mutable {_ _}. + + Definition to_address {A : Set} (to_value : A -> Value.t) (address : t A) : + CoqOfRust.M.Pointer.Address.t Value.t := + match address with + | Null => CoqOfRust.M.Pointer.Address.Null + | Immediate v => CoqOfRust.M.Pointer.Address.Immediate (to_value v) + | Mutable address => CoqOfRust.M.Pointer.Address.Mutable address + end. + + Definition map {A A' : Set} (projection : A -> option A') (address : t A) : t A' := + match address with + | Null => Null + | Immediate v => + match projection v with + | Some v' => Immediate v' + | None => Null (* This is where the null addresses can be created *) + end + | Mutable address => Mutable address + end. + End Address. + + (** Information about the origin of the pointer in case of sub-pointer. *) + Module Origin. + Inductive t (A : Set) : Set := + | Make {Big_A : Set} + (big_to_value : Big_A -> Value.t) + (projection : Big_A -> option A) + (injection : Big_A -> A -> option Big_A). + Arguments Make {_ _}. + End Origin. + + Inductive t (A : Set) `{ToValue A} : Set := + | Make + (origin : Origin.t A) + (address : Address.t A) + (path : Pointer.Path.t). + Arguments Make {_ _}. + + Definition to_pointer {A : Set} `{ToValue A} (pointer : t A) : CoqOfRust.M.Pointer.t Value.t := + let 'Make origin address path := pointer in + let 'Origin.Make big_to_value projection injection := origin in + CoqOfRust.M.Pointer.Make + big_to_value + φ + projection + injection + (Address.to_address φ address) + path. + + (* Definition map {Big Small : Set} + (pointer : t Big) + (index : Pointer.Index.t) + (to_value : Small -> Value.t) + (projection : Big -> option Small) + (injection : Big -> Small -> option Big) : + t Small := + let 'Make big_to_value to_value projection' injection' address path := pointer in + Make + big_to_value + to_value + address + (path ++ [index]) + (fun big_big => + match projection' big_big with + | Some big => projection big + | None => None + end + ) + (fun big_big small => + match projection' big_big with + | Some big => + match injection big small with + | Some big' => injection' big_big big' + | None => None + end + | None => None + end + ). *) + + (* Definition to_value_pointer {A : Set} (pointer : t A) : CoqOfRust.M.Pointer.t Value.t := + let 'Make address projection injection := pointer in + let address := + match address with + | Address.Immediate v => CoqOfRust.M.Pointer.Address.Immediate (to_value v) + | Address.Mutable address => CoqOfRust.M.Pointer.Address.Mutable address + end in + {| + CoqOfRust.M.Pointer.address := address; + CoqOfRust.M.Pointer.path := path; + |}. *) +End Pointer. + +Module Primitive. + Inductive t : Set -> Set := + | StateAlloc {A : Set} `{ToValue A} (value : A) : t (Pointer.t A) + | StateRead {A : Set} `{ToValue A} (pointer : Pointer.t A) : t A + | StateWrite {A : Set} `{ToValue A} (pointer : Pointer.t A) (update : A) : t unit + | MakeSubPointer {A A' : Set} `{ToValue A} `{ToValue A'} + (pointer : Pointer.t A) + (index : Pointer.Index.t) + (projection : A -> option A') + (injection : A -> A' -> option A) : + t (Pointer.t A') + | EnvRead {A : Set} : t A. +End Primitive. + +Module Exception. + Inductive t (R : Set) : Set := + (** exceptions for Rust's `return` *) + | Return (value : R) + (** exceptions for Rust's `continue` *) + | Continue + (** exceptions for Rust's `break` *) + | Break + (** escape from a match branch once we know that it is not valid *) + | BreakMatch + | Panic (message : string). + Arguments Return {_}. + Arguments Continue {_}. + Arguments Break {_}. + Arguments BreakMatch {_}. + Arguments Panic {_}. +End Exception. + +Module ClosureParams. + Inductive t : Set := + | Empty + | Cons {A : Set} `{ToValue A} (param : A) (params : t). + + Fixpoint to_value (params : t) : list Value.t := + match params with + | Empty => [] + | Cons param params => φ param :: to_value params + end. + + Module HasSetValue. + Inductive t : ClosureParams.t -> forall {A : Set}, A -> Prop := + | Empty : t ClosureParams.Empty tt + | Single {A : Set} `{ToValue A} (value : A) : + t (ClosureParams.Cons value ClosureParams.Empty) value + | Cons {A As : Set} `{ToValue A} (value : A) (params : ClosureParams.t) (values : As) : + t params values -> + t (ClosureParams.Cons value params) (value, values). + End HasSetValue. +End ClosureParams. + +Module LowM. + Inductive t (A : Set) : Set := + | Pure (value : A) + | CallPrimitive {B : Set} (primitive : Primitive.t B) (k : B -> t A) + | CallClosure {B Params : Set} `{ToValue B} + (closure : Params -> t (B + Exception.t Empty_set)) + (params : ClosureParams.t) + (k : (B + Exception.t Empty_set) -> t A) + | Impossible. + Arguments Pure {_}. + Arguments CallPrimitive {_ _}. + Arguments CallClosure {_ _ _ _}. + Arguments Impossible {_}. + + Fixpoint let_ {A B : Set} (e1 : t A) (e2 : A -> t B) : t B := + match e1 with + | Pure v => e2 v + | CallPrimitive primitive k => + CallPrimitive primitive (fun v => let_ (k v) e2) + | CallClosure params body k => + CallClosure params body (fun v => let_ (k v) e2) + | Impossible => Impossible + end. +End LowM. + +(** In the body of a function we can have a type for the parameter of the `return` keyword. *) +Definition MBody (A R : Set) : Set := + LowM.t (A + Exception.t R). + +(** For the whole type of a function, the potential `return` that appear in the body are already + handled. *) +Definition M (A : Set) : Set := + MBody A Empty_set. + +Definition pure {A R : Set} (v : A) : MBody A R := + LowM.Pure (inl v). + +Definition let_ {A B R : Set} (e1 : MBody A R) (e2 : A -> MBody B R) : MBody B R := + LowM.let_ e1 (fun v1 => + match v1 with + | inl v1 => e2 v1 + | inr error => LowM.Pure (inr error) + end). + +Definition result_to_value {A R : Set} `{ToValue R} + (to_value : A -> Value.t) (result : A + Exception.t R) : + Value.t + CoqOfRust.M.Exception.t := + match result with + | inl v => inl (to_value v) + | inr exception => + inr match exception with + | Exception.Return r => CoqOfRust.M.Exception.Return (φ r) + | Exception.Continue => CoqOfRust.M.Exception.Continue + | Exception.Break => CoqOfRust.M.Exception.Break + | Exception.BreakMatch => CoqOfRust.M.Exception.BreakMatch + | Exception.Panic message => CoqOfRust.M.Exception.Panic message + end + end. + +(** This parameter is used as a marker to allow a monadic notation + without naming all intermediate results. Computation represented using + this markers can be translated to a regular monadic computation using + [M.monadic] tactic. *) +Parameter run : forall {A R : Set}, MBody A R -> A. + +Module Notations. + Notation "'let-' a := b 'in' c" := + (LowM.let_ b (fun a => c)) + (at level 200, b at level 100, a name). + + Notation "'let*' a := b 'in' c" := + (let_ b (fun a => c)) + (at level 200, b at level 100, a name). + + Notation "'let*' ' a ':=' b 'in' c" := + (let_ b (fun a => c)) + (at level 200, a pattern, b at level 100, c at level 200). + + Notation "e (| e1 , .. , en |)" := + (run ((.. (e e1) ..) en)) + (at level 100). + + Notation "e (||)" := + (run e) + (at level 100). + + Notation "<[ ]>" := ClosureParams.Empty. + Notation "<[ x ; .. ; y ]>" := + (ClosureParams.Cons x .. (ClosureParams.Cons y ClosureParams.Empty) ..). +End Notations. +Import Notations. + +(** A tactic that replaces all [M.run] markers with a bind operation. + This allows to represent Rust programs without introducing + explicit names for all intermediate computation results. *) +Ltac monadic e := + lazymatch e with + | context ctxt [let v : _ := ?x in @?f v] => + refine (let_ _ _); + [ monadic x + | let v' := fresh v in + intro v'; + let y := (eval cbn beta in (f v')) in + lazymatch context ctxt [let v := x in y] with + | let _ := x in y => monadic y + | _ => + refine (let_ _ _); + [ monadic y + | let w := fresh "v" in + intro w; + let z := context ctxt [w] in + monadic z + ] + end + ] + | context ctxt [run ?x] => + lazymatch context ctxt [run x] with + | run x => monadic x + | _ => + refine (let_ _ _); + [ monadic x + | let v := fresh "v" in + intro v; + let y := context ctxt [v] in + monadic y + ] + end + | _ => + lazymatch type of e with + | MBody _ _ => exact e + | _ => exact (pure e) + end + end. + +Definition raise {A R : Set} (exception : Exception.t R) : MBody A R := + LowM.Pure (inr exception). + +Definition return_ {R : Set} (value : R) : MBody R R := + raise (Exception.Return value). + +Definition continue {R : Set} : MBody unit R := + raise Exception.Continue. + +Definition break {R : Set} : MBody unit R := + raise Exception.Break. + +Definition break_match {R : Set} : MBody unit R := + raise Exception.BreakMatch. + +Definition panic {A R : Set} (message : string) : MBody A R := + raise (Exception.Panic message). + +Definition impossible {A R : Set} : MBody A R := + LowM.Impossible. + +Definition call_primitive {A R : Set} (primitive : Primitive.t A) : MBody A R := + LowM.CallPrimitive primitive (fun result => + LowM.Pure (inl result)). + +Definition alloc {A R : Set} `{ToValue A} (value : A) : MBody (Pointer.t A) R := + call_primitive (Primitive.StateAlloc value). + +Definition read {A R : Set} `{ToValue A} (pointer : Pointer.t A) : MBody A R := + call_primitive (Primitive.StateRead pointer). + +Definition write {A R : Set} `{ToValue A} (pointer : Pointer.t A) (update : A) : MBody unit R := + call_primitive (Primitive.StateWrite pointer update). + +Definition make_sub_pointer {A A' R : Set} `{ToValue A} `{ToValue A'} + (pointer : Pointer.t A) (index : Pointer.Index.t) + (projection : A -> option A') (injection : A -> A' -> option A) : + MBody (Pointer.t A') R := + call_primitive (Primitive.MakeSubPointer pointer index projection injection). + +Definition copy {A R : Set} `{ToValue A} (p : Pointer.t A) : MBody (Pointer.t A) R := + let* v := read p in + alloc v. + +Definition catch {A R R' : Set} (body : MBody A R) (handler : Exception.t R -> MBody A R') : + MBody A R' := + let- result := body in + match result with + | inl v => LowM.Pure (inl v) + | inr exception => handler exception + end. + +Definition catch_return {R : Set} (body : MBody R R) : M R := + catch (R' := Empty_set) + body + (fun exception => + match exception with + | Exception.Return r => pure r + | Exception.Continue => raise Exception.Continue + | Exception.Break => raise Exception.Break + | Exception.BreakMatch => raise Exception.BreakMatch + | Exception.Panic message => raise (Exception.Panic message) + end + ). + +Definition catch_continue {R : Set} (body : MBody (Pointer.t unit) R) : MBody (Pointer.t unit) R := + catch + body + (fun exception => + match exception with + | Exception.Continue => alloc tt + | _ => raise exception + end + ). + +Definition catch_break {R : Set} (body : MBody (Pointer.t unit) R) : MBody (Pointer.t unit) R := + catch + body + (fun exception => + match exception with + | Exception.Break => alloc tt + | _ => raise exception + end + ). + +Definition call_closure {Params A R : Set} `{ToValue A} + (body : Params -> M A) + (params : ClosureParams.t) : + MBody A R := + catch (LowM.CallClosure body params LowM.Pure) (fun exception => + match exception with + | Exception.Return r => match r with end + | Exception.Continue => raise Exception.Continue + | Exception.Break => raise Exception.Break + | Exception.BreakMatch => raise Exception.BreakMatch + | Exception.Panic message => raise (Exception.Panic message) + end + ). + +Definition read_env {A R : Set} : MBody A R := + call_primitive Primitive.EnvRead. + +Module Run. + Reserved Notation "{{ Address , env_to_value | e ~ result }}". + + Inductive t (Address : Set) {Env : Set} (env_to_value : Env -> Value.t) + {A R : Set} `{ToValue A} `{ToValue R} : + CoqOfRust.M.M -> MBody A R -> Prop := + | Pure + (result : A + Exception.t R) + (result' : Value.t + CoqOfRust.M.Exception.t) : + result' = result_to_value φ result -> + {{ Address, env_to_value | + CoqOfRust.M.LowM.Pure result' ~ + LowM.Pure result + }} + | CallPrimitiveStateAlloc {B : Set} `{ToValue B} + (value : B) + (k' : Value.t -> CoqOfRust.M.M) + (k : Pointer.t B -> MBody A R) : + (forall (address : Pointer.Address.t B), + let pointer := + Pointer.Make + (Pointer.Origin.Make φ (fun x => Some x) (fun _ x => Some x)) + address + [] in + {{ Address, env_to_value | + k' (Value.Pointer (Pointer.to_pointer pointer)) ~ + k pointer + }} + ) -> + {{ Address, env_to_value | + CoqOfRust.M.LowM.CallPrimitive (CoqOfRust.M.Primitive.StateAlloc (φ value)) k' ~ + LowM.CallPrimitive (Primitive.StateAlloc value) k + }} + | CallPrimitiveStateRead {B : Set} `{ToValue B} + origin address path + pointer' + (k' : Value.t -> CoqOfRust.M.M) + (k : B -> MBody A R) : + let pointer : Pointer.t B := Pointer.Make origin address path in + pointer' = Pointer.to_pointer pointer -> + (forall (value : B), + {{ Address, env_to_value | + k' (φ value) ~ + k value + }} + ) -> + {{ Address, env_to_value | + CoqOfRust.M.LowM.CallPrimitive + (CoqOfRust.M.Primitive.StateRead pointer') + k' ~ + LowM.CallPrimitive (Primitive.StateRead pointer) k + }} + | CallPrimitiveStateWrite {B : Set} `{ToValue B} + origin address path + (update : B) + (k' : Value.t -> CoqOfRust.M.M) + (k : unit -> MBody A R) : + let pointer : Pointer.t B := Pointer.Make origin address path in + {{ Address, env_to_value | + k' (Value.Tuple []) ~ + k tt + }} -> + {{ Address, env_to_value | + CoqOfRust.M.LowM.CallPrimitive + (CoqOfRust.M.Primitive.StateWrite + (Pointer.to_pointer pointer) + (φ update) + ) + k' ~ + LowM.CallPrimitive (Primitive.StateWrite pointer update) k + }} + | CallPrimitiveMakeSubPointer {Big_B B Sub_B : Set} `{ToValue B} `{ToValue Sub_B} + (big_to_value : Big_B -> Value.t) projection injection + address path + index sub_projection sub_injection + pointer' + (k' : Value.t -> CoqOfRust.M.M) + (k : Pointer.t Sub_B -> MBody A R) : + let origin : Pointer.Origin.t B := Pointer.Origin.Make big_to_value projection injection in + let pointer : Pointer.t B := Pointer.Make origin address path in + let sub_origin : Pointer.Origin.t Sub_B := + Pointer.Origin.Make + big_to_value + (fun big_b => + match projection big_b with + | Some b => sub_projection b + | None => None + end) + (fun big_b new_sub_b => + match projection big_b with + | Some b => + match sub_injection b new_sub_b with + | Some new_b => injection big_b new_b + | None => None + end + | None => None + end) in + let sub_pointer : Pointer.t Sub_B := + Pointer.Make + sub_origin + (Pointer.Address.map sub_projection address) + (path ++ [index]) in + pointer' = Pointer.to_pointer pointer -> + (* Communtativity of the read *) + (forall (b : B), + Option.map (sub_projection b) φ = + Value.read_path (φ b) [index] + ) -> + (* Communtativity of the write *) + (forall (b : B) (sub_b : Sub_B), + Option.map (sub_injection b sub_b) φ = + Value.write_value (φ b) [index] (φ sub_b) + ) -> + {{ Address, env_to_value | + k' (Value.Pointer (Pointer.to_pointer sub_pointer)) ~ + k sub_pointer + }} -> + {{ Address, env_to_value | + CoqOfRust.M.LowM.CallPrimitive + (CoqOfRust.M.Primitive.MakeSubPointer + pointer' + index + ) + k' ~ + LowM.CallPrimitive (Primitive.MakeSubPointer pointer index sub_projection sub_injection) k + }} + | CallPrimitiveEnvRead + (k' : Value.t -> CoqOfRust.M.M) + (k : Env -> MBody A R) : + (forall (env : Env), + {{ Address, env_to_value | + k' (env_to_value env) ~ + k env + }} + ) -> + {{ Address, env_to_value | + CoqOfRust.M.LowM.CallPrimitive CoqOfRust.M.Primitive.EnvRead k' ~ + LowM.CallPrimitive Primitive.EnvRead k + }} + | CallClosure {B Params : Set} `{ToValue B} + (closure : Params -> M B) + (params : ClosureParams.t) + (params_set_value : Params) + (closure' : Value.t) + (closure_content' : list Value.t -> CoqOfRust.M.M) + params' + (k' : Value.t + CoqOfRust.M.Exception.t -> CoqOfRust.M.M) + (k : B + Exception.t Empty_set -> MBody A R) : + closure' = M.closure closure_content' -> + params' = ClosureParams.to_value params -> + ClosureParams.HasSetValue.t params params_set_value -> + {{ Address, env_to_value | + closure_content' params' ~ + closure params_set_value + }} -> + (forall (result : B + Exception.t Empty_set), + {{ Address, env_to_value | + k' (result_to_value φ result) ~ + k result + }} + ) -> + {{ Address, env_to_value | + CoqOfRust.M.LowM.CallClosure closure' params' k' ~ + LowM.CallClosure closure params k + }} + + where "{{ Address , env_to_value | untyped ~ typed }}" := + (t Address env_to_value untyped typed). +End Run. + +Import Run. + +Ltac run_symbolic_state_read := + match goal with + | |- {{ ?Address, ?env_to_value | + CoqOfRust.M.LowM.CallPrimitive + (CoqOfRust.M.Primitive.StateRead ?pointer') + ?k' ~ + LowM.CallPrimitive (Primitive.StateRead (Pointer.Make ?origin ?address ?path)) ?k + }} => + let H := fresh "H" in + pose proof (H := + Run.CallPrimitiveStateRead Address env_to_value origin address path k' k + ); + apply H; + clear H + end. + +(* Ltac run_symbolic_state_read := + match goal with + | |- Run.t _ _ _ (LowM.CallPrimitive (Primitive.StateRead ?address) _) _ => + let H := fresh "H" in + epose proof (H := Run.CallPrimitiveStateRead _ _ _ address); + eapply H; [reflexivity|]; + clear H + end. + +Ltac run_symbolic_state_write := + match goal with + | |- Run.t ?env ?result ?state' + (LowM.CallPrimitive (Primitive.StateWrite ?address ?value) ?k) + ?state => + let H := fresh "H" in + epose proof (H := + Run.CallPrimitiveStateWrite + env result state' address value state _ k); + apply H; [reflexivity|]; + clear H + end. + +Ltac run_symbolic_one_step := + match goal with + | |- Run.t _ _ _ _ _ => + (* We do not use [Run.CallClosure] and intentionally let the user use existing lemma for this + case. *) + apply Run.Pure || + apply Run.CallPrimitiveStateAllocNone || + apply Run.CallPrimitiveEnvRead || + run_symbolic_state_read || + run_symbolic_state_write + end. + +Ltac run_symbolic := + repeat ( + cbn || + run_symbolic_one_step + ). *) diff --git a/lib/src/header.rs b/lib/src/header.rs index 9402daf03..a19a4604b 100644 --- a/lib/src/header.rs +++ b/lib/src/header.rs @@ -1,4 +1,5 @@ pub const HEADER: &str = "(* Generated by coq-of-rust *) Require Import CoqOfRust.CoqOfRust. +Import M.Notations. "; diff --git a/lib/src/path.rs b/lib/src/path.rs index 473477df6..58b0f05b0 100644 --- a/lib/src/path.rs +++ b/lib/src/path.rs @@ -106,13 +106,10 @@ pub(crate) fn compile_path(env: &Env, path: &rustc_hir::Path) -> Path { pub(crate) fn compile_qpath(env: &Env, hir_id: HirId, qpath: &QPath) -> Path { let type_check_results = rustc_middle::ty::TypeckResults::new(hir_id.owner); - compile_def_id( - env, - type_check_results - .qpath_res(qpath, hir_id) - .opt_def_id() - .unwrap(), - ) + match type_check_results.qpath_res(qpath, hir_id).opt_def_id() { + Some(def_id) => compile_def_id(env, def_id), + None => Path::new(&["QPath", "without_def_id"]), + } } #[derive(Eq, PartialEq)] diff --git a/lib/src/thir_expression.rs b/lib/src/thir_expression.rs index c5252c0ca..196fcfbc2 100644 --- a/lib/src/thir_expression.rs +++ b/lib/src/thir_expression.rs @@ -691,9 +691,13 @@ pub(crate) fn compile_expr<'a>( }; Rc::new(Expr::Call { - func: Expr::local_var(getter_name), - args: vec![base, constructor, index], - kind: CallKind::Pure, + func: Rc::new(Expr::Call { + func: Expr::local_var(getter_name), + args: vec![constructor, index], + kind: CallKind::Pure, + }), + args: vec![base], + kind: CallKind::Closure, }) } None => {