(* Generated by coq-of-rust *)
Require Import CoqOfRust.CoqOfRust.

Module language_storage.
  Definition value_CODE_TAG : Value.t :=
    M.run ltac:(M.monadic (M.alloc (| Value.Integer IntegerKind.U8 0 |))).
  
  Definition value_RESOURCE_TAG : Value.t :=
    M.run ltac:(M.monadic (M.alloc (| Value.Integer IntegerKind.U8 1 |))).
  
  Definition value_CORE_CODE_ADDRESS : Value.t :=
    M.run ltac:(M.monadic (M.get_constant (| "move_core_types::account_address::ONE" |))).
  
  Definition value_TYPETAG_ENUM_ABSTRACT_SIZE : Value.t :=
    M.run
      ltac:(M.monadic
        (M.alloc (|
          M.alloc (|
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "once_cell::sync::Lazy")
                  []
                  [
                    Ty.apply
                      (Ty.path "move_core_types::gas_algebra::GasQuantity")
                      []
                      [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ];
                    Ty.function
                      []
                      (Ty.apply
                        (Ty.path "move_core_types::gas_algebra::GasQuantity")
                        []
                        [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ])
                  ],
                "new",
                []
              |),
              [
                (* ClosureFnPointer(Safe) *)
                M.pointer_coercion
                  (M.closure
                    (fun γ =>
                      ltac:(M.monadic
                        match γ with
                        | [ α0 ] =>
                          ltac:(M.monadic
                            (M.match_operator (|
                              M.alloc (| α0 |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::arith::Add",
                                        Ty.apply
                                          (Ty.path "move_core_types::gas_algebra::GasQuantity")
                                          []
                                          [
                                            Ty.path
                                              "move_core_types::gas_algebra::AbstractMemoryUnit"
                                          ],
                                        [
                                          Ty.apply
                                            (Ty.path "move_core_types::gas_algebra::GasQuantity")
                                            []
                                            [
                                              Ty.path
                                                "move_core_types::gas_algebra::AbstractMemoryUnit"
                                            ]
                                        ],
                                        "add",
                                        []
                                      |),
                                      [
                                        M.read (|
                                          M.get_constant (|
                                            "move_core_types::gas_algebra::ENUM_BASE_ABSTRACT_SIZE"
                                          |)
                                        |);
                                        M.read (|
                                          M.get_constant (|
                                            "move_core_types::gas_algebra::BOX_ABSTRACT_SIZE"
                                          |)
                                        |)
                                      ]
                                    |)))
                              ]
                            |)))
                        | _ => M.impossible "wrong number of arguments"
                        end)))
              ]
            |)
          |)
        |))).
  
  (*
  Enum TypeTag
  {
    const_params := [];
    ty_params := [];
    variants :=
      [
        {
          name := "Bool";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "U8";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "U64";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "U128";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "Address";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "Signer";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "Vector";
          item :=
            StructTuple
              [
                Ty.apply
                  (Ty.path "alloc::boxed::Box")
                  []
                  [
                    Ty.path "move_core_types::language_storage::TypeTag";
                    Ty.path "alloc::alloc::Global"
                  ]
              ];
          discriminant := None;
        };
        {
          name := "Struct";
          item :=
            StructTuple
              [
                Ty.apply
                  (Ty.path "alloc::boxed::Box")
                  []
                  [
                    Ty.path "move_core_types::language_storage::StructTag";
                    Ty.path "alloc::alloc::Global"
                  ]
              ];
          discriminant := None;
        };
        {
          name := "U16";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "U32";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "U256";
          item := StructTuple [];
          discriminant := None;
        }
      ];
  }
  *)
  
  Module underscore.
    Module Impl_serde_ser_Serialize_for_move_core_types_language_storage_TypeTag.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
      
      (* Serialize *)
      Definition serialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __S ], [ self; __serializer ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let __serializer := M.alloc (| __serializer |) in
            M.read (|
              M.match_operator (|
                M.read (| self |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::Bool"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 0;
                            M.read (| Value.String "bool" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::U8"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 1;
                            M.read (| Value.String "u8" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::U64"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 2;
                            M.read (| Value.String "u64" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::U128"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 3;
                            M.read (| Value.String "u128" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::Address"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 4;
                            M.read (| Value.String "address" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::Signer"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 5;
                            M.read (| Value.String "signer" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "move_core_types::language_storage::TypeTag::Vector",
                          0
                        |) in
                      let __field0 := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_newtype_variant",
                            [
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                []
                                [
                                  Ty.path "move_core_types::language_storage::TypeTag";
                                  Ty.path "alloc::alloc::Global"
                                ]
                            ]
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 6;
                            M.read (| Value.String "vector" |);
                            M.read (| __field0 |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "move_core_types::language_storage::TypeTag::Struct",
                          0
                        |) in
                      let __field0 := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_newtype_variant",
                            [
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                []
                                [
                                  Ty.path "move_core_types::language_storage::StructTag";
                                  Ty.path "alloc::alloc::Global"
                                ]
                            ]
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 7;
                            M.read (| Value.String "struct" |);
                            M.read (| __field0 |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::U16"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 8;
                            M.read (| Value.String "u16" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::U32"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 9;
                            M.read (| Value.String "u32" |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "move_core_types::language_storage::TypeTag::U256"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::Serializer",
                            __S,
                            [],
                            "serialize_unit_variant",
                            []
                          |),
                          [
                            M.read (| __serializer |);
                            M.read (| Value.String "TypeTag" |);
                            Value.Integer IntegerKind.U32 10;
                            M.read (| Value.String "u256" |)
                          ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::ser::Serialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("serialize", InstanceField.Method serialize) ].
    End Impl_serde_ser_Serialize_for_move_core_types_language_storage_TypeTag.
    Module Impl_serde_de_Deserialize_for_move_core_types_language_storage_TypeTag.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
      
      (* Deserialize *)
      Definition deserialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __D ], [ __deserializer ] =>
          ltac:(M.monadic
            (let __deserializer := M.alloc (| __deserializer |) in
            M.call_closure (|
              M.get_trait_method (|
                "serde::de::Deserializer",
                __D,
                [],
                "deserialize_enum",
                [ Ty.path "move_core_types::language_storage::_'1::deserialize::__Visitor" ]
              |),
              [
                M.read (| __deserializer |);
                M.read (| Value.String "TypeTag" |);
                M.read (|
                  M.get_constant (|
                    "move_core_types::language_storage::_'1::deserialize::VARIANTS"
                  |)
                |);
                Value.StructRecord
                  "move_core_types::language_storage::_'1::deserialize::__Visitor"
                  [
                    ("marker", Value.StructTuple "core::marker::PhantomData" []);
                    ("lifetime", Value.StructTuple "core::marker::PhantomData" [])
                  ]
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::de::Deserialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("deserialize", InstanceField.Method deserialize) ].
    End Impl_serde_de_Deserialize_for_move_core_types_language_storage_TypeTag.
    Module Impl_serde_ser_Serialize_for_move_core_types_language_storage_StructTag.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
      
      (* Serialize *)
      Definition serialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __S ], [ self; __serializer ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let __serializer := M.alloc (| __serializer |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ __serde_state :=
                    M.copy (|
                      M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "serde::ser::Serializer",
                              __S,
                              [],
                              "serialize_struct",
                              []
                            |),
                            [
                              M.read (| __serializer |);
                              M.read (| Value.String "StructTag" |);
                              BinOp.Wrap.add (|
                                BinOp.Wrap.add (|
                                  BinOp.Wrap.add (|
                                    BinOp.Wrap.add (|
                                      M.rust_cast (Value.Bool false),
                                      Value.Integer IntegerKind.Usize 1
                                    |),
                                    Value.Integer IntegerKind.Usize 1
                                  |),
                                  Value.Integer IntegerKind.Usize 1
                                |),
                                Value.Integer IntegerKind.Usize 1
                              |)
                            ]
                          |)
                        |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::result::Result::Ok",
                                  0
                                |) in
                              let __val := M.copy (| γ0_0 |) in
                              __val));
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::result::Result::Err",
                                  0
                                |) in
                              let __err := M.copy (| γ0_0 |) in
                              M.alloc (|
                                M.never_to_any (|
                                  M.read (|
                                    M.return_ (|
                                      Value.StructTuple
                                        "core::result::Result::Err"
                                        [ M.read (| __err |) ]
                                    |)
                                  |)
                                |)
                              |)))
                        ]
                      |)
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [ Ty.path "move_core_types::account_address::AccountAddress" ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "address" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "address"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [ Ty.path "move_core_types::identifier::Identifier" ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "module" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "module"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [ Ty.path "move_core_types::identifier::Identifier" ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "name" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "name"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [
                                  Ty.path "move_core_types::language_storage::TypeTag";
                                  Ty.path "alloc::alloc::Global"
                                ]
                            ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "type_args" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "type_params"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "serde::ser::SerializeStruct",
                        Ty.associated,
                        [],
                        "end",
                        []
                      |),
                      [ M.read (| __serde_state |) ]
                    |)
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::ser::Serialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("serialize", InstanceField.Method serialize) ].
    End Impl_serde_ser_Serialize_for_move_core_types_language_storage_StructTag.
    Module Impl_serde_de_Deserialize_for_move_core_types_language_storage_StructTag.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
      
      (* Deserialize *)
      Definition deserialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __D ], [ __deserializer ] =>
          ltac:(M.monadic
            (let __deserializer := M.alloc (| __deserializer |) in
            M.call_closure (|
              M.get_trait_method (|
                "serde::de::Deserializer",
                __D,
                [],
                "deserialize_struct",
                [ Ty.path "move_core_types::language_storage::_'3::deserialize::__Visitor" ]
              |),
              [
                M.read (| __deserializer |);
                M.read (| Value.String "StructTag" |);
                M.read (|
                  M.get_constant (| "move_core_types::language_storage::_'3::deserialize::FIELDS" |)
                |);
                Value.StructRecord
                  "move_core_types::language_storage::_'3::deserialize::__Visitor"
                  [
                    ("marker", Value.StructTuple "core::marker::PhantomData" []);
                    ("lifetime", Value.StructTuple "core::marker::PhantomData" [])
                  ]
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::de::Deserialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("deserialize", InstanceField.Method deserialize) ].
    End Impl_serde_de_Deserialize_for_move_core_types_language_storage_StructTag.
    Module Impl_serde_ser_Serialize_for_move_core_types_language_storage_ResourceKey.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
      
      (* Serialize *)
      Definition serialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __S ], [ self; __serializer ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let __serializer := M.alloc (| __serializer |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ __serde_state :=
                    M.copy (|
                      M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "serde::ser::Serializer",
                              __S,
                              [],
                              "serialize_struct",
                              []
                            |),
                            [
                              M.read (| __serializer |);
                              M.read (| Value.String "ResourceKey" |);
                              BinOp.Wrap.add (|
                                BinOp.Wrap.add (|
                                  M.rust_cast (Value.Bool false),
                                  Value.Integer IntegerKind.Usize 1
                                |),
                                Value.Integer IntegerKind.Usize 1
                              |)
                            ]
                          |)
                        |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::result::Result::Ok",
                                  0
                                |) in
                              let __val := M.copy (| γ0_0 |) in
                              __val));
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::result::Result::Err",
                                  0
                                |) in
                              let __err := M.copy (| γ0_0 |) in
                              M.alloc (|
                                M.never_to_any (|
                                  M.read (|
                                    M.return_ (|
                                      Value.StructTuple
                                        "core::result::Result::Err"
                                        [ M.read (| __err |) ]
                                    |)
                                  |)
                                |)
                              |)))
                        ]
                      |)
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [ Ty.path "move_core_types::account_address::AccountAddress" ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "address" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::ResourceKey",
                              "address"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [ Ty.path "move_core_types::language_storage::StructTag" ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "type_" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::ResourceKey",
                              "type_"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "serde::ser::SerializeStruct",
                        Ty.associated,
                        [],
                        "end",
                        []
                      |),
                      [ M.read (| __serde_state |) ]
                    |)
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::ser::Serialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("serialize", InstanceField.Method serialize) ].
    End Impl_serde_ser_Serialize_for_move_core_types_language_storage_ResourceKey.
    Module Impl_serde_de_Deserialize_for_move_core_types_language_storage_ResourceKey.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
      
      (* Deserialize *)
      Definition deserialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __D ], [ __deserializer ] =>
          ltac:(M.monadic
            (let __deserializer := M.alloc (| __deserializer |) in
            M.call_closure (|
              M.get_trait_method (|
                "serde::de::Deserializer",
                __D,
                [],
                "deserialize_struct",
                [ Ty.path "move_core_types::language_storage::_'5::deserialize::__Visitor" ]
              |),
              [
                M.read (| __deserializer |);
                M.read (| Value.String "ResourceKey" |);
                M.read (|
                  M.get_constant (| "move_core_types::language_storage::_'5::deserialize::FIELDS" |)
                |);
                Value.StructRecord
                  "move_core_types::language_storage::_'5::deserialize::__Visitor"
                  [
                    ("marker", Value.StructTuple "core::marker::PhantomData" []);
                    ("lifetime", Value.StructTuple "core::marker::PhantomData" [])
                  ]
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::de::Deserialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("deserialize", InstanceField.Method deserialize) ].
    End Impl_serde_de_Deserialize_for_move_core_types_language_storage_ResourceKey.
    Module Impl_serde_ser_Serialize_for_move_core_types_language_storage_ModuleId.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
      
      (* Serialize *)
      Definition serialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __S ], [ self; __serializer ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let __serializer := M.alloc (| __serializer |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ __serde_state :=
                    M.copy (|
                      M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "serde::ser::Serializer",
                              __S,
                              [],
                              "serialize_struct",
                              []
                            |),
                            [
                              M.read (| __serializer |);
                              M.read (| Value.String "ModuleId" |);
                              BinOp.Wrap.add (|
                                BinOp.Wrap.add (|
                                  M.rust_cast (Value.Bool false),
                                  Value.Integer IntegerKind.Usize 1
                                |),
                                Value.Integer IntegerKind.Usize 1
                              |)
                            ]
                          |)
                        |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::result::Result::Ok",
                                  0
                                |) in
                              let __val := M.copy (| γ0_0 |) in
                              __val));
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::result::Result::Err",
                                  0
                                |) in
                              let __err := M.copy (| γ0_0 |) in
                              M.alloc (|
                                M.never_to_any (|
                                  M.read (|
                                    M.return_ (|
                                      Value.StructTuple
                                        "core::result::Result::Err"
                                        [ M.read (| __err |) ]
                                    |)
                                  |)
                                |)
                              |)))
                        ]
                      |)
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [ Ty.path "move_core_types::account_address::AccountAddress" ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "address" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::ModuleId",
                              "address"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "serde::ser::SerializeStruct",
                            Ty.associated,
                            [],
                            "serialize_field",
                            [ Ty.path "move_core_types::identifier::Identifier" ]
                          |),
                          [
                            __serde_state;
                            M.read (| Value.String "name" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::ModuleId",
                              "name"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Ok",
                                0
                              |) in
                            let __val := M.copy (| γ0_0 |) in
                            __val));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::result::Result::Err",
                                0
                              |) in
                            let __err := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [ M.read (| __err |) ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |) in
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "serde::ser::SerializeStruct",
                        Ty.associated,
                        [],
                        "end",
                        []
                      |),
                      [ M.read (| __serde_state |) ]
                    |)
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::ser::Serialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("serialize", InstanceField.Method serialize) ].
    End Impl_serde_ser_Serialize_for_move_core_types_language_storage_ModuleId.
    Module Impl_serde_de_Deserialize_for_move_core_types_language_storage_ModuleId.
      Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
      
      (* Deserialize *)
      Definition deserialize (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __D ], [ __deserializer ] =>
          ltac:(M.monadic
            (let __deserializer := M.alloc (| __deserializer |) in
            M.call_closure (|
              M.get_trait_method (|
                "serde::de::Deserializer",
                __D,
                [],
                "deserialize_struct",
                [ Ty.path "move_core_types::language_storage::_'7::deserialize::__Visitor" ]
              |),
              [
                M.read (| __deserializer |);
                M.read (| Value.String "ModuleId" |);
                M.read (|
                  M.get_constant (| "move_core_types::language_storage::_'7::deserialize::FIELDS" |)
                |);
                Value.StructRecord
                  "move_core_types::language_storage::_'7::deserialize::__Visitor"
                  [
                    ("marker", Value.StructTuple "core::marker::PhantomData" []);
                    ("lifetime", Value.StructTuple "core::marker::PhantomData" [])
                  ]
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "serde::de::Deserialize"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("deserialize", InstanceField.Method deserialize) ].
    End Impl_serde_de_Deserialize_for_move_core_types_language_storage_ModuleId.
  End underscore.
  
  
  Module Impl_core_fmt_Debug_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (* Debug *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.read (|
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Bool"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Bool" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (| γ, "move_core_types::language_storage::TypeTag::U8" |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "U8" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U64"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "U64" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U128"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "U128" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Address"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Address" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Signer"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Signer" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Vector",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple_field1_finish",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Vector" |); __self_0 ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Struct",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple_field1_finish",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Struct" |); __self_0 ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U16"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "U16" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U32"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "U32" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U256"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "U256" |) ]
                      |)
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Debug"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Debug_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    Axiom Implements :
      M.IsTraitInstance
        "core::marker::StructuralPartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [].
  End Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_cmp_PartialEq_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (* PartialEq *)
    Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            let~ __self_discr :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "move_core_types::language_storage::TypeTag" ]
                  |),
                  [ M.read (| self |) ]
                |)
              |) in
            let~ __arg1_discr :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "move_core_types::language_storage::TypeTag" ]
                  |),
                  [ M.read (| other |) ]
                |)
              |) in
            M.alloc (|
              LogicalOp.and (|
                BinOp.eq (| M.read (| __self_discr |), M.read (| __arg1_discr |) |),
                ltac:(M.monadic
                  (M.read (|
                    M.match_operator (|
                      M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_0,
                                "move_core_types::language_storage::TypeTag::Vector",
                                0
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_1,
                                "move_core_types::language_storage::TypeTag::Vector",
                                0
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.apply
                                    (Ty.path "&")
                                    []
                                    [
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        []
                                        [
                                          Ty.path "move_core_types::language_storage::TypeTag";
                                          Ty.path "alloc::alloc::Global"
                                        ]
                                    ],
                                  [
                                    Ty.apply
                                      (Ty.path "&")
                                      []
                                      [
                                        Ty.apply
                                          (Ty.path "alloc::boxed::Box")
                                          []
                                          [
                                            Ty.path "move_core_types::language_storage::TypeTag";
                                            Ty.path "alloc::alloc::Global"
                                          ]
                                      ]
                                  ],
                                  "eq",
                                  []
                                |),
                                [ __self_0; __arg1_0 ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_0,
                                "move_core_types::language_storage::TypeTag::Struct",
                                0
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_1,
                                "move_core_types::language_storage::TypeTag::Struct",
                                0
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.apply
                                    (Ty.path "&")
                                    []
                                    [
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        []
                                        [
                                          Ty.path "move_core_types::language_storage::StructTag";
                                          Ty.path "alloc::alloc::Global"
                                        ]
                                    ],
                                  [
                                    Ty.apply
                                      (Ty.path "&")
                                      []
                                      [
                                        Ty.apply
                                          (Ty.path "alloc::boxed::Box")
                                          []
                                          [
                                            Ty.path "move_core_types::language_storage::StructTag";
                                            Ty.path "alloc::alloc::Global"
                                          ]
                                      ]
                                  ],
                                  "eq",
                                  []
                                |),
                                [ __self_0; __arg1_0 ]
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Bool true |)))
                      ]
                    |)
                  |)))
              |)
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("eq", InstanceField.Method eq) ].
  End Impl_core_cmp_PartialEq_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_hash_Hash_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (* Hash *)
    Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [ __H ], [ self; state ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let state := M.alloc (| state |) in
          M.read (|
            let~ __self_discr :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "move_core_types::language_storage::TypeTag" ]
                  |),
                  [ M.read (| self |) ]
                |)
              |) in
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (| "core::hash::Hash", Ty.path "isize", [], "hash", [ __H ] |),
                  [ __self_discr; M.read (| state |) ]
                |)
              |) in
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Vector",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::hash::Hash",
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.path "move_core_types::language_storage::TypeTag";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [],
                          "hash",
                          [ __H ]
                        |),
                        [ M.read (| __self_0 |); M.read (| state |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Struct",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::hash::Hash",
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.path "move_core_types::language_storage::StructTag";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [],
                          "hash",
                          [ __H ]
                        |),
                        [ M.read (| __self_0 |); M.read (| state |) ]
                      |)
                    |)));
                fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::hash::Hash"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("hash", InstanceField.Method hash) ].
  End Impl_core_hash_Hash_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_cmp_Eq_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (* Eq *)
    Definition assert_receiver_is_total_eq
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              Value.DeclaredButUndefined,
              [
                fun γ =>
                  ltac:(M.monadic
                    (M.match_operator (|
                      Value.DeclaredButUndefined,
                      [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |))) ]
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Eq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *)
        [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
  End Impl_core_cmp_Eq_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_clone_Clone_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (* Clone *)
    Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Bool"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::Bool" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (| γ, "move_core_types::language_storage::TypeTag::U8" |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::U8" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U64"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::U64" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U128"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::U128" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Address"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::Address" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Signer"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::Signer" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Vector",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructTuple
                        "move_core_types::language_storage::TypeTag::Vector"
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::clone::Clone",
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                []
                                [
                                  Ty.path "move_core_types::language_storage::TypeTag";
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "clone",
                              []
                            |),
                            [ M.read (| __self_0 |) ]
                          |)
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Struct",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructTuple
                        "move_core_types::language_storage::TypeTag::Struct"
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::clone::Clone",
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                []
                                [
                                  Ty.path "move_core_types::language_storage::StructTag";
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "clone",
                              []
                            |),
                            [ M.read (| __self_0 |) ]
                          |)
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U16"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::U16" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U32"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::U32" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U256"
                      |) in
                    M.alloc (|
                      Value.StructTuple "move_core_types::language_storage::TypeTag::U256" []
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::clone::Clone"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("clone", InstanceField.Method clone) ].
  End Impl_core_clone_Clone_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (* PartialOrd *)
    Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            let~ __self_discr :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "move_core_types::language_storage::TypeTag" ]
                  |),
                  [ M.read (| self |) ]
                |)
              |) in
            let~ __arg1_discr :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "move_core_types::language_storage::TypeTag" ]
                  |),
                  [ M.read (| other |) ]
                |)
              |) in
            M.match_operator (|
              M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                    let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                    let γ0_0 := M.read (| γ0_0 |) in
                    let γ2_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ0_0,
                        "move_core_types::language_storage::TypeTag::Vector",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ2_0 |) in
                    let γ0_1 := M.read (| γ0_1 |) in
                    let γ2_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ0_1,
                        "move_core_types::language_storage::TypeTag::Vector",
                        0
                      |) in
                    let __arg1_0 := M.alloc (| γ2_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialOrd",
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.path "move_core_types::language_storage::TypeTag";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [
                            Ty.apply
                              (Ty.path "alloc::boxed::Box")
                              []
                              [
                                Ty.path "move_core_types::language_storage::TypeTag";
                                Ty.path "alloc::alloc::Global"
                              ]
                          ],
                          "partial_cmp",
                          []
                        |),
                        [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                    let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                    let γ0_0 := M.read (| γ0_0 |) in
                    let γ2_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ0_0,
                        "move_core_types::language_storage::TypeTag::Struct",
                        0
                      |) in
                    let __self_0 := M.alloc (| γ2_0 |) in
                    let γ0_1 := M.read (| γ0_1 |) in
                    let γ2_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ0_1,
                        "move_core_types::language_storage::TypeTag::Struct",
                        0
                      |) in
                    let __arg1_0 := M.alloc (| γ2_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialOrd",
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.path "move_core_types::language_storage::StructTag";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [
                            Ty.apply
                              (Ty.path "alloc::boxed::Box")
                              []
                              [
                                Ty.path "move_core_types::language_storage::StructTag";
                                Ty.path "alloc::alloc::Global"
                              ]
                          ],
                          "partial_cmp",
                          []
                        |),
                        [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialOrd",
                          Ty.path "isize",
                          [ Ty.path "isize" ],
                          "partial_cmp",
                          []
                        |),
                        [ __self_discr; __arg1_discr ]
                      |)
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialOrd"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
  End Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_cmp_Ord_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (* Ord *)
    Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            let~ __self_discr :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "move_core_types::language_storage::TypeTag" ]
                  |),
                  [ M.read (| self |) ]
                |)
              |) in
            let~ __arg1_discr :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "move_core_types::language_storage::TypeTag" ]
                  |),
                  [ M.read (| other |) ]
                |)
              |) in
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (| "core::cmp::Ord", Ty.path "isize", [], "cmp", [] |),
                  [ __self_discr; __arg1_discr ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                    M.match_operator (|
                      M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_0,
                                "move_core_types::language_storage::TypeTag::Vector",
                                0
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_1,
                                "move_core_types::language_storage::TypeTag::Vector",
                                0
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::Ord",
                                  Ty.apply
                                    (Ty.path "alloc::boxed::Box")
                                    []
                                    [
                                      Ty.path "move_core_types::language_storage::TypeTag";
                                      Ty.path "alloc::alloc::Global"
                                    ],
                                  [],
                                  "cmp",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_0,
                                "move_core_types::language_storage::TypeTag::Struct",
                                0
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ0_1,
                                "move_core_types::language_storage::TypeTag::Struct",
                                0
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::Ord",
                                  Ty.apply
                                    (Ty.path "alloc::boxed::Box")
                                    []
                                    [
                                      Ty.path "move_core_types::language_storage::StructTag";
                                      Ty.path "alloc::alloc::Global"
                                    ],
                                  [],
                                  "cmp",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (M.alloc (| Value.StructTuple "core::cmp::Ordering::Equal" [] |)))
                      ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let cmp := M.copy (| γ |) in
                    cmp))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Ord"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
  End Impl_core_cmp_Ord_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (*
        pub fn to_canonical_string(&self, with_prefix: bool) -> String {
            self.to_canonical_display(with_prefix).to_string()
        }
    *)
    Definition to_canonical_string (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; with_prefix ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let with_prefix := M.alloc (| with_prefix |) in
          M.call_closure (|
            M.get_trait_method (| "alloc::string::ToString", Ty.associated, [], "to_string", [] |),
            [
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "move_core_types::language_storage::TypeTag",
                    "to_canonical_display",
                    []
                  |),
                  [ M.read (| self |); M.read (| with_prefix |) ]
                |)
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_to_canonical_string :
      M.IsAssociatedFunction Self "to_canonical_string" to_canonical_string.
    
    (*
        pub fn to_canonical_display(&self, with_prefix: bool) -> impl std::fmt::Display + '_ {
            struct CanonicalDisplay<'a> {
                data: &'a TypeTag,
                with_prefix: bool,
            }
    
            impl std::fmt::Display for CanonicalDisplay<'_> {
                fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
                    match self.data {
                        TypeTag::Bool => write!(f, "bool"),
                        TypeTag::U8 => write!(f, "u8"),
                        TypeTag::U16 => write!(f, "u16"),
                        TypeTag::U32 => write!(f, "u32"),
                        TypeTag::U64 => write!(f, "u64"),
                        TypeTag::U128 => write!(f, "u128"),
                        TypeTag::U256 => write!(f, "u256"),
                        TypeTag::Address => write!(f, "address"),
                        TypeTag::Signer => write!(f, "signer"),
                        TypeTag::Vector(t) => {
                            write!(f, "vector<{}>", t.to_canonical_display(self.with_prefix))
                        }
                        TypeTag::Struct(s) => write!(f, "{}", s.to_canonical_display(self.with_prefix)),
                    }
                }
            }
    
            CanonicalDisplay {
                data: self,
                with_prefix,
            }
        }
    *)
    Definition to_canonical_display (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; with_prefix ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let with_prefix := M.alloc (| with_prefix |) in
          Value.StructRecord
            "move_core_types::language_storage::to_canonical_display::CanonicalDisplay"
            [ ("data", M.read (| self |)); ("with_prefix", M.read (| with_prefix |)) ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_to_canonical_display :
      M.IsAssociatedFunction Self "to_canonical_display" to_canonical_display.
    
    (*
        pub fn abstract_size_for_gas_metering(&self) -> AbstractMemorySize {
            *TYPETAG_ENUM_ABSTRACT_SIZE
                + match self {
                    TypeTag::Bool
                    | TypeTag::U8
                    | TypeTag::U64
                    | TypeTag::U128
                    | TypeTag::Address
                    | TypeTag::Signer
                    | TypeTag::U16
                    | TypeTag::U32
                    | TypeTag::U256 => AbstractMemorySize::new(0),
                    TypeTag::Vector(x) => x.abstract_size_for_gas_metering(),
                    TypeTag::Struct(y) => y.abstract_size_for_gas_metering(),
                }
        }
    *)
    Definition abstract_size_for_gas_metering
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.call_closure (|
            M.get_trait_method (|
              "core::ops::arith::Add",
              Ty.apply
                (Ty.path "move_core_types::gas_algebra::GasQuantity")
                []
                [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ],
              [
                Ty.apply
                  (Ty.path "move_core_types::gas_algebra::GasQuantity")
                  []
                  [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ]
              ],
              "add",
              []
            |),
            [
              M.read (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::ops::deref::Deref",
                    Ty.apply
                      (Ty.path "once_cell::sync::Lazy")
                      []
                      [
                        Ty.apply
                          (Ty.path "move_core_types::gas_algebra::GasQuantity")
                          []
                          [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ];
                        Ty.function
                          []
                          (Ty.apply
                            (Ty.path "move_core_types::gas_algebra::GasQuantity")
                            []
                            [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ])
                      ],
                    [],
                    "deref",
                    []
                  |),
                  [
                    M.read (|
                      M.get_constant (|
                        "move_core_types::language_storage::TYPETAG_ENUM_ABSTRACT_SIZE"
                      |)
                    |)
                  ]
                |)
              |);
              M.read (|
                M.match_operator (|
                  self,
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (M.find_or_pattern (|
                          γ,
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::Bool"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::U8"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::U64"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::U128"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::Address"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::Signer"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::U16"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::U32"
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_core_types::language_storage::TypeTag::U256"
                                  |) in
                                Value.Tuple []))
                          ],
                          M.closure
                            (fun γ =>
                              ltac:(M.monadic
                                match γ with
                                | [] =>
                                  ltac:(M.monadic
                                    (M.alloc (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.apply
                                            (Ty.path "move_core_types::gas_algebra::GasQuantity")
                                            []
                                            [
                                              Ty.path
                                                "move_core_types::gas_algebra::AbstractMemoryUnit"
                                            ],
                                          "new",
                                          []
                                        |),
                                        [ Value.Integer IntegerKind.U64 0 ]
                                      |)
                                    |)))
                                | _ => M.impossible "wrong number of arguments"
                                end))
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        let γ1_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "move_core_types::language_storage::TypeTag::Vector",
                            0
                          |) in
                        let x := M.alloc (| γ1_0 |) in
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_core_types::language_storage::TypeTag",
                              "abstract_size_for_gas_metering",
                              []
                            |),
                            [ M.read (| M.read (| x |) |) ]
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        let γ1_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "move_core_types::language_storage::TypeTag::Struct",
                            0
                          |) in
                        let y := M.alloc (| γ1_0 |) in
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_core_types::language_storage::StructTag",
                              "abstract_size_for_gas_metering",
                              []
                            |),
                            [ M.read (| M.read (| y |) |) ]
                          |)
                        |)))
                  ]
                |)
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_abstract_size_for_gas_metering :
      M.IsAssociatedFunction Self "abstract_size_for_gas_metering" abstract_size_for_gas_metering.
  End Impl_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_str_traits_FromStr_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (*     type Err = anyhow::Error; *)
    Definition _Err : Ty.t := Ty.path "anyhow::Error".
    
    (*
        fn from_str(s: &str) -> Result<Self, Self::Err> {
            parse_type_tag(s)
        }
    *)
    Definition from_str (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ s ] =>
        ltac:(M.monadic
          (let s := M.alloc (| s |) in
          M.call_closure (|
            M.get_function (| "move_core_types::parser::parse_type_tag", [] |),
            [ M.read (| s |) ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::str::traits::FromStr"
        Self
        (* Trait polymorphic types *) []
        (* Instance *)
        [ ("Err", InstanceField.Ty _Err); ("from_str", InstanceField.Method from_str) ].
  End Impl_core_str_traits_FromStr_for_move_core_types_language_storage_TypeTag.
  
  (* StructRecord
    {
      name := "StructTag";
      const_params := [];
      ty_params := [];
      fields :=
        [
          ("address", Ty.path "move_core_types::account_address::AccountAddress");
          ("module", Ty.path "move_core_types::identifier::Identifier");
          ("name", Ty.path "move_core_types::identifier::Identifier");
          ("type_params",
            Ty.apply
              (Ty.path "alloc::vec::Vec")
              []
              [ Ty.path "move_core_types::language_storage::TypeTag"; Ty.path "alloc::alloc::Global"
              ])
        ];
    } *)
  
  
  
  Module Impl_core_fmt_Debug_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (* Debug *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.call_closure (|
            M.get_associated_function (|
              Ty.path "core::fmt::Formatter",
              "debug_struct_field4_finish",
              []
            |),
            [
              M.read (| f |);
              M.read (| Value.String "StructTag" |);
              M.read (| Value.String "address" |);
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "move_core_types::language_storage::StructTag",
                "address"
              |);
              M.read (| Value.String "module" |);
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "move_core_types::language_storage::StructTag",
                "module"
              |);
              M.read (| Value.String "name" |);
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "move_core_types::language_storage::StructTag",
                "name"
              |);
              M.read (| Value.String "type_params" |);
              M.alloc (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "move_core_types::language_storage::StructTag",
                  "type_params"
                |)
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Debug"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Debug_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    Axiom Implements :
      M.IsTraitInstance
        "core::marker::StructuralPartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [].
  End Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_cmp_PartialEq_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (* PartialEq *)
    Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          LogicalOp.and (|
            LogicalOp.and (|
              LogicalOp.and (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [ Ty.path "move_core_types::account_address::AccountAddress" ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |)
                  ]
                |),
                ltac:(M.monadic
                  (M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::PartialEq",
                      Ty.path "move_core_types::identifier::Identifier",
                      [ Ty.path "move_core_types::identifier::Identifier" ],
                      "eq",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "move_core_types::language_storage::StructTag",
                        "module"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "move_core_types::language_storage::StructTag",
                        "module"
                      |)
                    ]
                  |)))
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "move_core_types::identifier::Identifier",
                    [ Ty.path "move_core_types::identifier::Identifier" ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "name"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::StructTag",
                      "name"
                    |)
                  ]
                |)))
            |),
            ltac:(M.monadic
              (M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.apply
                    (Ty.path "alloc::vec::Vec")
                    []
                    [
                      Ty.path "move_core_types::language_storage::TypeTag";
                      Ty.path "alloc::alloc::Global"
                    ],
                  [
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [
                        Ty.path "move_core_types::language_storage::TypeTag";
                        Ty.path "alloc::alloc::Global"
                      ]
                  ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::StructTag",
                    "type_params"
                  |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| other |),
                    "move_core_types::language_storage::StructTag",
                    "type_params"
                  |)
                ]
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("eq", InstanceField.Method eq) ].
  End Impl_core_cmp_PartialEq_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_hash_Hash_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (* Hash *)
    Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [ __H ], [ self; state ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let state := M.alloc (| state |) in
          M.read (|
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::hash::Hash",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "hash",
                    [ __H ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |);
                    M.read (| state |)
                  ]
                |)
              |) in
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::hash::Hash",
                    Ty.path "move_core_types::identifier::Identifier",
                    [],
                    "hash",
                    [ __H ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "module"
                    |);
                    M.read (| state |)
                  ]
                |)
              |) in
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::hash::Hash",
                    Ty.path "move_core_types::identifier::Identifier",
                    [],
                    "hash",
                    [ __H ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "name"
                    |);
                    M.read (| state |)
                  ]
                |)
              |) in
            M.alloc (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::hash::Hash",
                  Ty.apply
                    (Ty.path "alloc::vec::Vec")
                    []
                    [
                      Ty.path "move_core_types::language_storage::TypeTag";
                      Ty.path "alloc::alloc::Global"
                    ],
                  [],
                  "hash",
                  [ __H ]
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::StructTag",
                    "type_params"
                  |);
                  M.read (| state |)
                ]
              |)
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::hash::Hash"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("hash", InstanceField.Method hash) ].
  End Impl_core_hash_Hash_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_cmp_Eq_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (* Eq *)
    Definition assert_receiver_is_total_eq
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              Value.DeclaredButUndefined,
              [
                fun γ =>
                  ltac:(M.monadic
                    (M.match_operator (|
                      Value.DeclaredButUndefined,
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (M.match_operator (|
                              Value.DeclaredButUndefined,
                              [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |))) ]
                            |)))
                      ]
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Eq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *)
        [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
  End Impl_core_cmp_Eq_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_clone_Clone_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (* Clone *)
    Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          Value.StructRecord
            "move_core_types::language_storage::StructTag"
            [
              ("address",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |)
                  ]
                |));
              ("module",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "move_core_types::identifier::Identifier",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "module"
                    |)
                  ]
                |));
              ("name",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "move_core_types::identifier::Identifier",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "name"
                    |)
                  ]
                |));
              ("type_params",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [
                        Ty.path "move_core_types::language_storage::TypeTag";
                        Ty.path "alloc::alloc::Global"
                      ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "type_params"
                    |)
                  ]
                |))
            ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::clone::Clone"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("clone", InstanceField.Method clone) ].
  End Impl_core_clone_Clone_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (* PartialOrd *)
    Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialOrd",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [ Ty.path "move_core_types::account_address::AccountAddress" ],
                    "partial_cmp",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |)
                  ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "core::option::Option::Some",
                        0
                      |) in
                    let _ := M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialOrd",
                            Ty.path "move_core_types::identifier::Identifier",
                            [ Ty.path "move_core_types::identifier::Identifier" ],
                            "partial_cmp",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "module"
                            |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| other |),
                              "move_core_types::language_storage::StructTag",
                              "module"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::option::Option::Some",
                                0
                              |) in
                            let _ := M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                            M.match_operator (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialOrd",
                                    Ty.path "move_core_types::identifier::Identifier",
                                    [ Ty.path "move_core_types::identifier::Identifier" ],
                                    "partial_cmp",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_core_types::language_storage::StructTag",
                                      "name"
                                    |);
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| other |),
                                      "move_core_types::language_storage::StructTag",
                                      "name"
                                    |)
                                  ]
                                |)
                              |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "core::option::Option::Some",
                                        0
                                      |) in
                                    let _ :=
                                      M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::cmp::PartialOrd",
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.path "move_core_types::language_storage::TypeTag";
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          [
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.path
                                                  "move_core_types::language_storage::TypeTag";
                                                Ty.path "alloc::alloc::Global"
                                              ]
                                          ],
                                          "partial_cmp",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "move_core_types::language_storage::StructTag",
                                            "type_params"
                                          |);
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| other |),
                                            "move_core_types::language_storage::StructTag",
                                            "type_params"
                                          |)
                                        ]
                                      |)
                                    |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (let cmp := M.copy (| γ |) in
                                    cmp))
                              ]
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let cmp := M.copy (| γ |) in
                            cmp))
                      ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let cmp := M.copy (| γ |) in
                    cmp))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialOrd"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
  End Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_cmp_Ord_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (* Ord *)
    Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::Ord",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "cmp",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::StructTag",
                      "address"
                    |)
                  ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::Ord",
                            Ty.path "move_core_types::identifier::Identifier",
                            [],
                            "cmp",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "module"
                            |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| other |),
                              "move_core_types::language_storage::StructTag",
                              "module"
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                            M.match_operator (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::Ord",
                                    Ty.path "move_core_types::identifier::Identifier",
                                    [],
                                    "cmp",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_core_types::language_storage::StructTag",
                                      "name"
                                    |);
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| other |),
                                      "move_core_types::language_storage::StructTag",
                                      "name"
                                    |)
                                  ]
                                |)
                              |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let _ :=
                                      M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::cmp::Ord",
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.path "move_core_types::language_storage::TypeTag";
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          [],
                                          "cmp",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "move_core_types::language_storage::StructTag",
                                            "type_params"
                                          |);
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| other |),
                                            "move_core_types::language_storage::StructTag",
                                            "type_params"
                                          |)
                                        ]
                                      |)
                                    |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (let cmp := M.copy (| γ |) in
                                    cmp))
                              ]
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let cmp := M.copy (| γ |) in
                            cmp))
                      ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let cmp := M.copy (| γ |) in
                    cmp))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Ord"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
  End Impl_core_cmp_Ord_for_move_core_types_language_storage_StructTag.
  
  Module Impl_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (*
        pub fn access_vector(&self) -> Vec<u8> {
            let mut key = vec![RESOURCE_TAG];
            key.append(&mut bcs::to_bytes(self).unwrap());
            key
        }
    *)
    Definition access_vector (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            let~ key :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                    "into_vec",
                    [ Ty.path "alloc::alloc::Global" ]
                  |),
                  [
                    M.read (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.apply
                                (Ty.path "array")
                                [ Value.Integer IntegerKind.Usize 1 ]
                                [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "new",
                          []
                        |),
                        [
                          M.alloc (|
                            Value.Array
                              [
                                M.read (|
                                  M.get_constant (|
                                    "move_core_types::language_storage::RESOURCE_TAG"
                                  |)
                                |)
                              ]
                          |)
                        ]
                      |)
                    |)
                  ]
                |)
              |) in
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                    "append",
                    []
                  |),
                  [
                    key;
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ];
                              Ty.path "bcs::error::Error"
                            ],
                          "unwrap",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "bcs::ser::to_bytes",
                              [ Ty.path "move_core_types::language_storage::StructTag" ]
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |)
                  ]
                |)
              |) in
            key
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_access_vector :
      M.IsAssociatedFunction Self "access_vector" access_vector.
    
    (*
        pub fn is_ascii_string(&self, move_std_addr: &AccountAddress) -> bool {
            self.address == *move_std_addr
                && self.module.as_str().eq("ascii")
                && self.name.as_str().eq("String")
        }
    *)
    Definition is_ascii_string (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; move_std_addr ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let move_std_addr := M.alloc (| move_std_addr |) in
          LogicalOp.and (|
            LogicalOp.and (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "move_core_types::account_address::AccountAddress",
                  [ Ty.path "move_core_types::account_address::AccountAddress" ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::StructTag",
                    "address"
                  |);
                  M.read (| move_std_addr |)
                ]
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "str",
                    [ Ty.path "str" ],
                    "eq",
                    []
                  |),
                  [
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "move_core_types::identifier::IdentStr",
                        "as_str",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::deref::Deref",
                            Ty.path "move_core_types::identifier::Identifier",
                            [],
                            "deref",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "module"
                            |)
                          ]
                        |)
                      ]
                    |);
                    M.read (| Value.String "ascii" |)
                  ]
                |)))
            |),
            ltac:(M.monadic
              (M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "str",
                  [ Ty.path "str" ],
                  "eq",
                  []
                |),
                [
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "move_core_types::identifier::IdentStr",
                      "as_str",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::deref::Deref",
                          Ty.path "move_core_types::identifier::Identifier",
                          [],
                          "deref",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::StructTag",
                            "name"
                          |)
                        ]
                      |)
                    ]
                  |);
                  M.read (| Value.String "String" |)
                ]
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_is_ascii_string :
      M.IsAssociatedFunction Self "is_ascii_string" is_ascii_string.
    
    (*
        pub fn is_std_string(&self, move_std_addr: &AccountAddress) -> bool {
            self.address == *move_std_addr
                && self.module.as_str().eq("string")
                && self.name.as_str().eq("String")
        }
    *)
    Definition is_std_string (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; move_std_addr ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let move_std_addr := M.alloc (| move_std_addr |) in
          LogicalOp.and (|
            LogicalOp.and (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "move_core_types::account_address::AccountAddress",
                  [ Ty.path "move_core_types::account_address::AccountAddress" ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::StructTag",
                    "address"
                  |);
                  M.read (| move_std_addr |)
                ]
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "str",
                    [ Ty.path "str" ],
                    "eq",
                    []
                  |),
                  [
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "move_core_types::identifier::IdentStr",
                        "as_str",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::deref::Deref",
                            Ty.path "move_core_types::identifier::Identifier",
                            [],
                            "deref",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::StructTag",
                              "module"
                            |)
                          ]
                        |)
                      ]
                    |);
                    M.read (| Value.String "string" |)
                  ]
                |)))
            |),
            ltac:(M.monadic
              (M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "str",
                  [ Ty.path "str" ],
                  "eq",
                  []
                |),
                [
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "move_core_types::identifier::IdentStr",
                      "as_str",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::deref::Deref",
                          Ty.path "move_core_types::identifier::Identifier",
                          [],
                          "deref",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::StructTag",
                            "name"
                          |)
                        ]
                      |)
                    ]
                  |);
                  M.read (| Value.String "String" |)
                ]
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_is_std_string :
      M.IsAssociatedFunction Self "is_std_string" is_std_string.
    
    (*
        pub fn module_id(&self) -> ModuleId {
            ModuleId::new(self.address, self.module.to_owned())
        }
    *)
    Definition module_id (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.call_closure (|
            M.get_associated_function (|
              Ty.path "move_core_types::language_storage::ModuleId",
              "new",
              []
            |),
            [
              M.read (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "move_core_types::language_storage::StructTag",
                  "address"
                |)
              |);
              M.call_closure (|
                M.get_trait_method (|
                  "alloc::borrow::ToOwned",
                  Ty.path "move_core_types::identifier::Identifier",
                  [],
                  "to_owned",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::StructTag",
                    "module"
                  |)
                ]
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_module_id : M.IsAssociatedFunction Self "module_id" module_id.
    
    (*
        pub fn to_canonical_string(&self, with_prefix: bool) -> String {
            self.to_canonical_display(with_prefix).to_string()
        }
    *)
    Definition to_canonical_string (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; with_prefix ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let with_prefix := M.alloc (| with_prefix |) in
          M.call_closure (|
            M.get_trait_method (| "alloc::string::ToString", Ty.associated, [], "to_string", [] |),
            [
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "move_core_types::language_storage::StructTag",
                    "to_canonical_display",
                    []
                  |),
                  [ M.read (| self |); M.read (| with_prefix |) ]
                |)
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_to_canonical_string :
      M.IsAssociatedFunction Self "to_canonical_string" to_canonical_string.
    
    (*
        pub fn to_canonical_display(&self, with_prefix: bool) -> impl std::fmt::Display + '_ {
            struct CanonicalDisplay<'a> {
                data: &'a StructTag,
                with_prefix: bool,
            }
    
            impl std::fmt::Display for CanonicalDisplay<'_> {
                fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                    write!(
                        f,
                        "{}::{}::{}",
                        self.data.address.to_canonical_display(self.with_prefix),
                        self.data.module,
                        self.data.name
                    )?;
    
                    if let Some(first_ty) = self.data.type_params.first() {
                        write!(f, "<")?;
                        write!(f, "{}", first_ty.to_canonical_display(self.with_prefix))?;
                        for ty in self.data.type_params.iter().skip(1) {
                            // Note that unlike Display for StructTag, there is no space between the comma and canonical display.
                            // This follows the original to_canonical_string() implementation.
                            write!(f, ",{}", ty.to_canonical_display(self.with_prefix))?;
                        }
                        write!(f, ">")?;
                    }
                    Ok(())
                }
            }
    
            CanonicalDisplay {
                data: self,
                with_prefix,
            }
        }
    *)
    Definition to_canonical_display (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; with_prefix ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let with_prefix := M.alloc (| with_prefix |) in
          Value.StructRecord
            "move_core_types::language_storage::to_canonical_display::CanonicalDisplay"
            [ ("data", M.read (| self |)); ("with_prefix", M.read (| with_prefix |)) ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_to_canonical_display :
      M.IsAssociatedFunction Self "to_canonical_display" to_canonical_display.
    
    (*
        pub fn abstract_size_for_gas_metering(&self) -> AbstractMemorySize {
            // TODO: make this more robust as struct size changes
            self.address.abstract_size_for_gas_metering()
                + self.module.abstract_size_for_gas_metering()
                + self.name.abstract_size_for_gas_metering()
                + self
                    .type_params
                    .iter()
                    .fold(AbstractMemorySize::new(0), |accum, val| {
                        accum + val.abstract_size_for_gas_metering()
                    })
        }
    *)
    Definition abstract_size_for_gas_metering
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.call_closure (|
            M.get_trait_method (|
              "core::ops::arith::Add",
              Ty.apply
                (Ty.path "move_core_types::gas_algebra::GasQuantity")
                []
                [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ],
              [
                Ty.apply
                  (Ty.path "move_core_types::gas_algebra::GasQuantity")
                  []
                  [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ]
              ],
              "add",
              []
            |),
            [
              M.call_closure (|
                M.get_trait_method (|
                  "core::ops::arith::Add",
                  Ty.apply
                    (Ty.path "move_core_types::gas_algebra::GasQuantity")
                    []
                    [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ],
                  [
                    Ty.apply
                      (Ty.path "move_core_types::gas_algebra::GasQuantity")
                      []
                      [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ]
                  ],
                  "add",
                  []
                |),
                [
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::ops::arith::Add",
                      Ty.apply
                        (Ty.path "move_core_types::gas_algebra::GasQuantity")
                        []
                        [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ],
                      [
                        Ty.apply
                          (Ty.path "move_core_types::gas_algebra::GasQuantity")
                          []
                          [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ]
                      ],
                      "add",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_core_types::account_address::AccountAddress",
                          "abstract_size_for_gas_metering",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::StructTag",
                            "address"
                          |)
                        ]
                      |);
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_core_types::identifier::IdentStr",
                          "abstract_size_for_gas_metering",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.path "move_core_types::identifier::Identifier",
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "move_core_types::language_storage::StructTag",
                                "module"
                              |)
                            ]
                          |)
                        ]
                      |)
                    ]
                  |);
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "move_core_types::identifier::IdentStr",
                      "abstract_size_for_gas_metering",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::deref::Deref",
                          Ty.path "move_core_types::identifier::Identifier",
                          [],
                          "deref",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::StructTag",
                            "name"
                          |)
                        ]
                      |)
                    ]
                  |)
                ]
              |);
              M.call_closure (|
                M.get_trait_method (|
                  "core::iter::traits::iterator::Iterator",
                  Ty.apply
                    (Ty.path "core::slice::iter::Iter")
                    []
                    [ Ty.path "move_core_types::language_storage::TypeTag" ],
                  [],
                  "fold",
                  [
                    Ty.apply
                      (Ty.path "move_core_types::gas_algebra::GasQuantity")
                      []
                      [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ];
                    Ty.function
                      [
                        Ty.tuple
                          [
                            Ty.apply
                              (Ty.path "move_core_types::gas_algebra::GasQuantity")
                              []
                              [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ];
                            Ty.apply
                              (Ty.path "&")
                              []
                              [ Ty.path "move_core_types::language_storage::TypeTag" ]
                          ]
                      ]
                      (Ty.apply
                        (Ty.path "move_core_types::gas_algebra::GasQuantity")
                        []
                        [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ])
                  ]
                |),
                [
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "slice")
                        []
                        [ Ty.path "move_core_types::language_storage::TypeTag" ],
                      "iter",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::deref::Deref",
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [
                              Ty.path "move_core_types::language_storage::TypeTag";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [],
                          "deref",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::StructTag",
                            "type_params"
                          |)
                        ]
                      |)
                    ]
                  |);
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "move_core_types::gas_algebra::GasQuantity")
                        []
                        [ Ty.path "move_core_types::gas_algebra::AbstractMemoryUnit" ],
                      "new",
                      []
                    |),
                    [ Value.Integer IntegerKind.U64 0 ]
                  |);
                  M.closure
                    (fun γ =>
                      ltac:(M.monadic
                        match γ with
                        | [ α0; α1 ] =>
                          ltac:(M.monadic
                            (M.match_operator (|
                              M.alloc (| α0 |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let accum := M.copy (| γ |) in
                                    M.match_operator (|
                                      M.alloc (| α1 |),
                                      [
                                        fun γ =>
                                          ltac:(M.monadic
                                            (let val := M.copy (| γ |) in
                                            M.call_closure (|
                                              M.get_trait_method (|
                                                "core::ops::arith::Add",
                                                Ty.apply
                                                  (Ty.path
                                                    "move_core_types::gas_algebra::GasQuantity")
                                                  []
                                                  [
                                                    Ty.path
                                                      "move_core_types::gas_algebra::AbstractMemoryUnit"
                                                  ],
                                                [
                                                  Ty.apply
                                                    (Ty.path
                                                      "move_core_types::gas_algebra::GasQuantity")
                                                    []
                                                    [
                                                      Ty.path
                                                        "move_core_types::gas_algebra::AbstractMemoryUnit"
                                                    ]
                                                ],
                                                "add",
                                                []
                                              |),
                                              [
                                                M.read (| accum |);
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "move_core_types::language_storage::TypeTag",
                                                    "abstract_size_for_gas_metering",
                                                    []
                                                  |),
                                                  [ M.read (| val |) ]
                                                |)
                                              ]
                                            |)))
                                      ]
                                    |)))
                              ]
                            |)))
                        | _ => M.impossible "wrong number of arguments"
                        end))
                ]
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_abstract_size_for_gas_metering :
      M.IsAssociatedFunction Self "abstract_size_for_gas_metering" abstract_size_for_gas_metering.
  End Impl_move_core_types_language_storage_StructTag.
  
  Module Impl_core_str_traits_FromStr_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (*     type Err = anyhow::Error; *)
    Definition _Err : Ty.t := Ty.path "anyhow::Error".
    
    (*
        fn from_str(s: &str) -> Result<Self, Self::Err> {
            parse_struct_tag(s)
        }
    *)
    Definition from_str (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ s ] =>
        ltac:(M.monadic
          (let s := M.alloc (| s |) in
          M.call_closure (|
            M.get_function (| "move_core_types::parser::parse_struct_tag", [] |),
            [ M.read (| s |) ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::str::traits::FromStr"
        Self
        (* Trait polymorphic types *) []
        (* Instance *)
        [ ("Err", InstanceField.Ty _Err); ("from_str", InstanceField.Method from_str) ].
  End Impl_core_str_traits_FromStr_for_move_core_types_language_storage_StructTag.
  
  (* StructRecord
    {
      name := "ResourceKey";
      const_params := [];
      ty_params := [];
      fields :=
        [
          ("address", Ty.path "move_core_types::account_address::AccountAddress");
          ("type_", Ty.path "move_core_types::language_storage::StructTag")
        ];
    } *)
  
  
  
  Module Impl_core_fmt_Debug_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (* Debug *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.call_closure (|
            M.get_associated_function (|
              Ty.path "core::fmt::Formatter",
              "debug_struct_field2_finish",
              []
            |),
            [
              M.read (| f |);
              M.read (| Value.String "ResourceKey" |);
              M.read (| Value.String "address" |);
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "move_core_types::language_storage::ResourceKey",
                "address"
              |);
              M.read (| Value.String "type_" |);
              M.alloc (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "move_core_types::language_storage::ResourceKey",
                  "type_"
                |)
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Debug"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Debug_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    Axiom Implements :
      M.IsTraitInstance
        "core::marker::StructuralPartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [].
  End Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_cmp_PartialEq_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (* PartialEq *)
    Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          LogicalOp.and (|
            M.call_closure (|
              M.get_trait_method (|
                "core::cmp::PartialEq",
                Ty.path "move_core_types::account_address::AccountAddress",
                [ Ty.path "move_core_types::account_address::AccountAddress" ],
                "eq",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "move_core_types::language_storage::ResourceKey",
                  "address"
                |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| other |),
                  "move_core_types::language_storage::ResourceKey",
                  "address"
                |)
              ]
            |),
            ltac:(M.monadic
              (M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "move_core_types::language_storage::StructTag",
                  [ Ty.path "move_core_types::language_storage::StructTag" ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::ResourceKey",
                    "type_"
                  |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| other |),
                    "move_core_types::language_storage::ResourceKey",
                    "type_"
                  |)
                ]
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("eq", InstanceField.Method eq) ].
  End Impl_core_cmp_PartialEq_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_hash_Hash_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (* Hash *)
    Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [ __H ], [ self; state ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let state := M.alloc (| state |) in
          M.read (|
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::hash::Hash",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "hash",
                    [ __H ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ResourceKey",
                      "address"
                    |);
                    M.read (| state |)
                  ]
                |)
              |) in
            M.alloc (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::hash::Hash",
                  Ty.path "move_core_types::language_storage::StructTag",
                  [],
                  "hash",
                  [ __H ]
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::ResourceKey",
                    "type_"
                  |);
                  M.read (| state |)
                ]
              |)
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::hash::Hash"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("hash", InstanceField.Method hash) ].
  End Impl_core_hash_Hash_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_cmp_Eq_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (* Eq *)
    Definition assert_receiver_is_total_eq
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              Value.DeclaredButUndefined,
              [
                fun γ =>
                  ltac:(M.monadic
                    (M.match_operator (|
                      Value.DeclaredButUndefined,
                      [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |))) ]
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Eq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *)
        [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
  End Impl_core_cmp_Eq_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_clone_Clone_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (* Clone *)
    Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          Value.StructRecord
            "move_core_types::language_storage::ResourceKey"
            [
              ("address",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ResourceKey",
                      "address"
                    |)
                  ]
                |));
              ("type_",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "move_core_types::language_storage::StructTag",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ResourceKey",
                      "type_"
                    |)
                  ]
                |))
            ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::clone::Clone"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("clone", InstanceField.Method clone) ].
  End Impl_core_clone_Clone_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (* PartialOrd *)
    Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialOrd",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [ Ty.path "move_core_types::account_address::AccountAddress" ],
                    "partial_cmp",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ResourceKey",
                      "address"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::ResourceKey",
                      "address"
                    |)
                  ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "core::option::Option::Some",
                        0
                      |) in
                    let _ := M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialOrd",
                          Ty.path "move_core_types::language_storage::StructTag",
                          [ Ty.path "move_core_types::language_storage::StructTag" ],
                          "partial_cmp",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::ResourceKey",
                            "type_"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "move_core_types::language_storage::ResourceKey",
                            "type_"
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let cmp := M.copy (| γ |) in
                    cmp))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialOrd"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
  End Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_cmp_Ord_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (* Ord *)
    Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::Ord",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "cmp",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ResourceKey",
                      "address"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::ResourceKey",
                      "address"
                    |)
                  ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::Ord",
                          Ty.path "move_core_types::language_storage::StructTag",
                          [],
                          "cmp",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::ResourceKey",
                            "type_"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "move_core_types::language_storage::ResourceKey",
                            "type_"
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let cmp := M.copy (| γ |) in
                    cmp))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Ord"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
  End Impl_core_cmp_Ord_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (*
        pub fn address(&self) -> AccountAddress {
            self.address
        }
    *)
    Definition address (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.SubPointer.get_struct_record_field (|
              M.read (| self |),
              "move_core_types::language_storage::ResourceKey",
              "address"
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_address : M.IsAssociatedFunction Self "address" address.
    
    (*
        pub fn type_(&self) -> &StructTag {
            &self.type_
        }
    *)
    Definition type_ (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.SubPointer.get_struct_record_field (|
            M.read (| self |),
            "move_core_types::language_storage::ResourceKey",
            "type_"
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_type_ : M.IsAssociatedFunction Self "type_" type_.
    (*
        pub fn new(address: AccountAddress, type_: StructTag) -> Self {
            ResourceKey { address, type_ }
        }
    *)
    Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ address; type_ ] =>
        ltac:(M.monadic
          (let address := M.alloc (| address |) in
          let type_ := M.alloc (| type_ |) in
          Value.StructRecord
            "move_core_types::language_storage::ResourceKey"
            [ ("address", M.read (| address |)); ("type_", M.read (| type_ |)) ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
  End Impl_move_core_types_language_storage_ResourceKey.
  
  
  (* StructRecord
    {
      name := "ModuleId";
      const_params := [];
      ty_params := [];
      fields :=
        [
          ("address", Ty.path "move_core_types::account_address::AccountAddress");
          ("name", Ty.path "move_core_types::identifier::Identifier")
        ];
    } *)
  
  
  
  Module Impl_core_fmt_Debug_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (* Debug *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.call_closure (|
            M.get_associated_function (|
              Ty.path "core::fmt::Formatter",
              "debug_struct_field2_finish",
              []
            |),
            [
              M.read (| f |);
              M.read (| Value.String "ModuleId" |);
              M.read (| Value.String "address" |);
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "move_core_types::language_storage::ModuleId",
                "address"
              |);
              M.read (| Value.String "name" |);
              M.alloc (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "move_core_types::language_storage::ModuleId",
                  "name"
                |)
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Debug"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Debug_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    Axiom Implements :
      M.IsTraitInstance
        "core::marker::StructuralPartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [].
  End Impl_core_marker_StructuralPartialEq_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_cmp_PartialEq_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (* PartialEq *)
    Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          LogicalOp.and (|
            M.call_closure (|
              M.get_trait_method (|
                "core::cmp::PartialEq",
                Ty.path "move_core_types::account_address::AccountAddress",
                [ Ty.path "move_core_types::account_address::AccountAddress" ],
                "eq",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "move_core_types::language_storage::ModuleId",
                  "address"
                |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| other |),
                  "move_core_types::language_storage::ModuleId",
                  "address"
                |)
              ]
            |),
            ltac:(M.monadic
              (M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "move_core_types::identifier::Identifier",
                  [ Ty.path "move_core_types::identifier::Identifier" ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::ModuleId",
                    "name"
                  |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| other |),
                    "move_core_types::language_storage::ModuleId",
                    "name"
                  |)
                ]
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("eq", InstanceField.Method eq) ].
  End Impl_core_cmp_PartialEq_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_hash_Hash_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (* Hash *)
    Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [ __H ], [ self; state ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let state := M.alloc (| state |) in
          M.read (|
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::hash::Hash",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "hash",
                    [ __H ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ModuleId",
                      "address"
                    |);
                    M.read (| state |)
                  ]
                |)
              |) in
            M.alloc (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::hash::Hash",
                  Ty.path "move_core_types::identifier::Identifier",
                  [],
                  "hash",
                  [ __H ]
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "move_core_types::language_storage::ModuleId",
                    "name"
                  |);
                  M.read (| state |)
                ]
              |)
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::hash::Hash"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("hash", InstanceField.Method hash) ].
  End Impl_core_hash_Hash_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_cmp_Eq_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (* Eq *)
    Definition assert_receiver_is_total_eq
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              Value.DeclaredButUndefined,
              [
                fun γ =>
                  ltac:(M.monadic
                    (M.match_operator (|
                      Value.DeclaredButUndefined,
                      [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |))) ]
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Eq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *)
        [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
  End Impl_core_cmp_Eq_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_clone_Clone_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (* Clone *)
    Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          Value.StructRecord
            "move_core_types::language_storage::ModuleId"
            [
              ("address",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ModuleId",
                      "address"
                    |)
                  ]
                |));
              ("name",
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "move_core_types::identifier::Identifier",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ModuleId",
                      "name"
                    |)
                  ]
                |))
            ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::clone::Clone"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("clone", InstanceField.Method clone) ].
  End Impl_core_clone_Clone_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (* PartialOrd *)
    Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialOrd",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [ Ty.path "move_core_types::account_address::AccountAddress" ],
                    "partial_cmp",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ModuleId",
                      "address"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::ModuleId",
                      "address"
                    |)
                  ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "core::option::Option::Some",
                        0
                      |) in
                    let _ := M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialOrd",
                          Ty.path "move_core_types::identifier::Identifier",
                          [ Ty.path "move_core_types::identifier::Identifier" ],
                          "partial_cmp",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::ModuleId",
                            "name"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "move_core_types::language_storage::ModuleId",
                            "name"
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let cmp := M.copy (| γ |) in
                    cmp))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialOrd"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
  End Impl_core_cmp_PartialOrd_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_cmp_Ord_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (* Ord *)
    Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::Ord",
                    Ty.path "move_core_types::account_address::AccountAddress",
                    [],
                    "cmp",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_core_types::language_storage::ModuleId",
                      "address"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "move_core_types::language_storage::ModuleId",
                      "address"
                    |)
                  ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::Ord",
                          Ty.path "move_core_types::identifier::Identifier",
                          [],
                          "cmp",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_core_types::language_storage::ModuleId",
                            "name"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "move_core_types::language_storage::ModuleId",
                            "name"
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let cmp := M.copy (| γ |) in
                    cmp))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::Ord"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
  End Impl_core_cmp_Ord_for_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_convert_From_move_core_types_language_storage_ModuleId_for_Tuple_move_core_types_account_address_AccountAddress_move_core_types_identifier_Identifier_.
    Definition Self : Ty.t :=
      Ty.tuple
        [
          Ty.path "move_core_types::account_address::AccountAddress";
          Ty.path "move_core_types::identifier::Identifier"
        ].
    
    (*
        fn from(module_id: ModuleId) -> Self {
            (module_id.address, module_id.name)
        }
    *)
    Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ module_id ] =>
        ltac:(M.monadic
          (let module_id := M.alloc (| module_id |) in
          Value.Tuple
            [
              M.read (|
                M.SubPointer.get_struct_record_field (|
                  module_id,
                  "move_core_types::language_storage::ModuleId",
                  "address"
                |)
              |);
              M.read (|
                M.SubPointer.get_struct_record_field (|
                  module_id,
                  "move_core_types::language_storage::ModuleId",
                  "name"
                |)
              |)
            ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::convert::From"
        Self
        (* Trait polymorphic types *)
        [ (* T *) Ty.path "move_core_types::language_storage::ModuleId" ]
        (* Instance *) [ ("from", InstanceField.Method from) ].
  End Impl_core_convert_From_move_core_types_language_storage_ModuleId_for_Tuple_move_core_types_account_address_AccountAddress_move_core_types_identifier_Identifier_.
  
  Module Impl_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (*
        pub fn new(address: AccountAddress, name: Identifier) -> Self {
            ModuleId { address, name }
        }
    *)
    Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ address; name ] =>
        ltac:(M.monadic
          (let address := M.alloc (| address |) in
          let name := M.alloc (| name |) in
          Value.StructRecord
            "move_core_types::language_storage::ModuleId"
            [ ("address", M.read (| address |)); ("name", M.read (| name |)) ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
    
    (*
        pub fn name(&self) -> &IdentStr {
            &self.name
        }
    *)
    Definition name (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.call_closure (|
            M.get_trait_method (|
              "core::ops::deref::Deref",
              Ty.path "move_core_types::identifier::Identifier",
              [],
              "deref",
              []
            |),
            [
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "move_core_types::language_storage::ModuleId",
                "name"
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_name : M.IsAssociatedFunction Self "name" name.
    
    (*
        pub fn address(&self) -> &AccountAddress {
            &self.address
        }
    *)
    Definition address (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.SubPointer.get_struct_record_field (|
            M.read (| self |),
            "move_core_types::language_storage::ModuleId",
            "address"
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_address : M.IsAssociatedFunction Self "address" address.
    
    (*
        pub fn access_vector(&self) -> Vec<u8> {
            let mut key = vec![CODE_TAG];
            key.append(&mut bcs::to_bytes(self).unwrap());
            key
        }
    *)
    Definition access_vector (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            let~ key :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                    "into_vec",
                    [ Ty.path "alloc::alloc::Global" ]
                  |),
                  [
                    M.read (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.apply
                                (Ty.path "array")
                                [ Value.Integer IntegerKind.Usize 1 ]
                                [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "new",
                          []
                        |),
                        [
                          M.alloc (|
                            Value.Array
                              [
                                M.read (|
                                  M.get_constant (| "move_core_types::language_storage::CODE_TAG" |)
                                |)
                              ]
                          |)
                        ]
                      |)
                    |)
                  ]
                |)
              |) in
            let~ _ :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                    "append",
                    []
                  |),
                  [
                    key;
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ];
                              Ty.path "bcs::error::Error"
                            ],
                          "unwrap",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "bcs::ser::to_bytes",
                              [ Ty.path "move_core_types::language_storage::ModuleId" ]
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |)
                  ]
                |)
              |) in
            key
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_access_vector :
      M.IsAssociatedFunction Self "access_vector" access_vector.
    
    (*
        pub fn to_canonical_string(&self, with_prefix: bool) -> String {
            self.to_canonical_display(with_prefix).to_string()
        }
    *)
    Definition to_canonical_string (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; with_prefix ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let with_prefix := M.alloc (| with_prefix |) in
          M.call_closure (|
            M.get_trait_method (| "alloc::string::ToString", Ty.associated, [], "to_string", [] |),
            [
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "move_core_types::language_storage::ModuleId",
                    "to_canonical_display",
                    []
                  |),
                  [ M.read (| self |); M.read (| with_prefix |) ]
                |)
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_to_canonical_string :
      M.IsAssociatedFunction Self "to_canonical_string" to_canonical_string.
    
    (*
        pub fn to_canonical_display(&self, with_prefix: bool) -> impl Display + '_ {
            struct IdDisplay<'a> {
                id: &'a ModuleId,
                with_prefix: bool,
            }
    
            impl<'a> Display for IdDisplay<'a> {
                fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
                    write!(
                        f,
                        "{}::{}",
                        self.id.address.to_canonical_display(self.with_prefix),
                        self.id.name,
                    )
                }
            }
    
            IdDisplay {
                id: self,
                with_prefix,
            }
        }
    *)
    Definition to_canonical_display (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; with_prefix ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let with_prefix := M.alloc (| with_prefix |) in
          Value.StructRecord
            "move_core_types::language_storage::to_canonical_display::IdDisplay"
            [ ("id", M.read (| self |)); ("with_prefix", M.read (| with_prefix |)) ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_to_canonical_display :
      M.IsAssociatedFunction Self "to_canonical_display" to_canonical_display.
    (*
        pub fn short_str_lossless(&self) -> String {
            format!("0x{}::{}", self.address.short_str_lossless(), self.name)
        }
    *)
    Definition short_str_lossless (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.call_closure (|
            M.get_function (| "core::hint::must_use", [ Ty.path "alloc::string::String" ] |),
            [
              M.read (|
                let~ res :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (| "alloc::fmt::format", [] |),
                      [
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::Arguments",
                            "new_v1",
                            []
                          |),
                          [
                            M.alloc (|
                              Value.Array
                                [ M.read (| Value.String "0x" |); M.read (| Value.String "::" |) ]
                            |);
                            M.alloc (|
                              Value.Array
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "core::fmt::rt::Argument",
                                      "new_display",
                                      [ Ty.path "alloc::string::String" ]
                                    |),
                                    [
                                      M.alloc (|
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path
                                              "move_core_types::account_address::AccountAddress",
                                            "short_str_lossless",
                                            []
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "move_core_types::language_storage::ModuleId",
                                              "address"
                                            |)
                                          ]
                                        |)
                                      |)
                                    ]
                                  |);
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "core::fmt::rt::Argument",
                                      "new_display",
                                      [ Ty.path "move_core_types::identifier::Identifier" ]
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "move_core_types::language_storage::ModuleId",
                                        "name"
                                      |)
                                    ]
                                  |)
                                ]
                            |)
                          ]
                        |)
                      ]
                    |)
                  |) in
                res
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_short_str_lossless :
      M.IsAssociatedFunction Self "short_str_lossless" short_str_lossless.
  End Impl_move_core_types_language_storage_ModuleId.
  
  Module Impl_core_fmt_Display_for_move_core_types_language_storage_ModuleId.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ModuleId".
    
    (*
        fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
            write!(f, "{}", self.to_canonical_display(/* with_prefix */ false))
        }
    *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.call_closure (|
            M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_fmt", [] |),
            [
              M.read (| f |);
              M.call_closure (|
                M.get_associated_function (| Ty.path "core::fmt::Arguments", "new_v1", [] |),
                [
                  M.alloc (| Value.Array [ M.read (| Value.String "" |) ] |);
                  M.alloc (|
                    Value.Array
                      [
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::rt::Argument",
                            "new_display",
                            [ Ty.associated ]
                          |),
                          [
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_core_types::language_storage::ModuleId",
                                  "to_canonical_display",
                                  []
                                |),
                                [ M.read (| self |); Value.Bool false ]
                              |)
                            |)
                          ]
                        |)
                      ]
                  |)
                ]
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Display"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Display_for_move_core_types_language_storage_ModuleId.
  
  
  Module Impl_core_fmt_Display_for_move_core_types_language_storage_StructTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::StructTag".
    
    (*
        fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
            write!(
                f,
                "0x{}::{}::{}",
                self.address.short_str_lossless(),
                self.module,
                self.name
            )?;
            if let Some(first_ty) = self.type_params.first() {
                write!(f, "<")?;
                write!(f, "{}", first_ty)?;
                for ty in self.type_params.iter().skip(1) {
                    write!(f, ", {}", ty)?;
                }
                write!(f, ">")?;
            }
            Ok(())
        }
    *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::try_trait::Try",
                          Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Formatter",
                              "write_fmt",
                              []
                            |),
                            [
                              M.read (| f |);
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "core::fmt::Arguments",
                                  "new_v1",
                                  []
                                |),
                                [
                                  M.alloc (|
                                    Value.Array
                                      [
                                        M.read (| Value.String "0x" |);
                                        M.read (| Value.String "::" |);
                                        M.read (| Value.String "::" |)
                                      ]
                                  |);
                                  M.alloc (|
                                    Value.Array
                                      [
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::rt::Argument",
                                            "new_display",
                                            [ Ty.path "alloc::string::String" ]
                                          |),
                                          [
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path
                                                    "move_core_types::account_address::AccountAddress",
                                                  "short_str_lossless",
                                                  []
                                                |),
                                                [
                                                  M.SubPointer.get_struct_record_field (|
                                                    M.read (| self |),
                                                    "move_core_types::language_storage::StructTag",
                                                    "address"
                                                  |)
                                                ]
                                              |)
                                            |)
                                          ]
                                        |);
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::rt::Argument",
                                            "new_display",
                                            [ Ty.path "move_core_types::identifier::Identifier" ]
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "move_core_types::language_storage::StructTag",
                                              "module"
                                            |)
                                          ]
                                        |);
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::rt::Argument",
                                            "new_display",
                                            [ Ty.path "move_core_types::identifier::Identifier" ]
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "move_core_types::language_storage::StructTag",
                                              "name"
                                            |)
                                          ]
                                        |)
                                      ]
                                  |)
                                ]
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "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::result::Result")
                                        []
                                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "core::fmt::Error"
                                          ]
                                      ],
                                      "from_residual",
                                      []
                                    |),
                                    [ M.read (| residual |) ]
                                  |)
                                |)
                              |)
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::ops::control_flow::ControlFlow::Continue",
                              0
                            |) in
                          let val := M.copy (| γ0_0 |) in
                          val))
                    ]
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "slice")
                                    []
                                    [ Ty.path "move_core_types::language_storage::TypeTag" ],
                                  "first",
                                  []
                                |),
                                [
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::ops::deref::Deref",
                                      Ty.apply
                                        (Ty.path "alloc::vec::Vec")
                                        []
                                        [
                                          Ty.path "move_core_types::language_storage::TypeTag";
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      [],
                                      "deref",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "move_core_types::language_storage::StructTag",
                                        "type_params"
                                      |)
                                    ]
                                  |)
                                ]
                              |)
                            |) in
                          let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let first_ty := M.copy (| γ0_0 |) in
                          let~ _ :=
                            M.match_operator (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::Try",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      []
                                      [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                    [],
                                    "branch",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::Formatter",
                                        "write_fmt",
                                        []
                                      |),
                                      [
                                        M.read (| f |);
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::Arguments",
                                            "new_const",
                                            []
                                          |),
                                          [
                                            M.alloc (|
                                              Value.Array [ M.read (| Value.String "<" |) ]
                                            |)
                                          ]
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "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::result::Result")
                                                  []
                                                  [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                                [
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    []
                                                    [
                                                      Ty.path "core::convert::Infallible";
                                                      Ty.path "core::fmt::Error"
                                                    ]
                                                ],
                                                "from_residual",
                                                []
                                              |),
                                              [ M.read (| residual |) ]
                                            |)
                                          |)
                                        |)
                                      |)
                                    |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "core::ops::control_flow::ControlFlow::Continue",
                                        0
                                      |) in
                                    let val := M.copy (| γ0_0 |) in
                                    val))
                              ]
                            |) in
                          let~ _ :=
                            M.match_operator (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::Try",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      []
                                      [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                    [],
                                    "branch",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::Formatter",
                                        "write_fmt",
                                        []
                                      |),
                                      [
                                        M.read (| f |);
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::Arguments",
                                            "new_v1",
                                            []
                                          |),
                                          [
                                            M.alloc (|
                                              Value.Array [ M.read (| Value.String "" |) ]
                                            |);
                                            M.alloc (|
                                              Value.Array
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path "core::fmt::rt::Argument",
                                                      "new_display",
                                                      [
                                                        Ty.apply
                                                          (Ty.path "&")
                                                          []
                                                          [
                                                            Ty.path
                                                              "move_core_types::language_storage::TypeTag"
                                                          ]
                                                      ]
                                                    |),
                                                    [ first_ty ]
                                                  |)
                                                ]
                                            |)
                                          ]
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "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::result::Result")
                                                  []
                                                  [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                                [
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    []
                                                    [
                                                      Ty.path "core::convert::Infallible";
                                                      Ty.path "core::fmt::Error"
                                                    ]
                                                ],
                                                "from_residual",
                                                []
                                              |),
                                              [ M.read (| residual |) ]
                                            |)
                                          |)
                                        |)
                                      |)
                                    |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "core::ops::control_flow::ControlFlow::Continue",
                                        0
                                      |) in
                                    let val := M.copy (| γ0_0 |) in
                                    val))
                              ]
                            |) in
                          let~ _ :=
                            M.use
                              (M.match_operator (|
                                M.alloc (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::iter::traits::collect::IntoIterator",
                                      Ty.apply
                                        (Ty.path "core::iter::adapters::skip::Skip")
                                        []
                                        [
                                          Ty.apply
                                            (Ty.path "core::slice::iter::Iter")
                                            []
                                            [ Ty.path "move_core_types::language_storage::TypeTag" ]
                                        ],
                                      [],
                                      "into_iter",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::iter::traits::iterator::Iterator",
                                          Ty.apply
                                            (Ty.path "core::slice::iter::Iter")
                                            []
                                            [ Ty.path "move_core_types::language_storage::TypeTag"
                                            ],
                                          [],
                                          "skip",
                                          []
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.apply
                                                (Ty.path "slice")
                                                []
                                                [
                                                  Ty.path
                                                    "move_core_types::language_storage::TypeTag"
                                                ],
                                              "iter",
                                              []
                                            |),
                                            [
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::deref::Deref",
                                                  Ty.apply
                                                    (Ty.path "alloc::vec::Vec")
                                                    []
                                                    [
                                                      Ty.path
                                                        "move_core_types::language_storage::TypeTag";
                                                      Ty.path "alloc::alloc::Global"
                                                    ],
                                                  [],
                                                  "deref",
                                                  []
                                                |),
                                                [
                                                  M.SubPointer.get_struct_record_field (|
                                                    M.read (| self |),
                                                    "move_core_types::language_storage::StructTag",
                                                    "type_params"
                                                  |)
                                                ]
                                              |)
                                            ]
                                          |);
                                          Value.Integer IntegerKind.Usize 1
                                        ]
                                      |)
                                    ]
                                  |)
                                |),
                                [
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let iter := M.copy (| γ |) in
                                      M.loop (|
                                        ltac:(M.monadic
                                          (let~ _ :=
                                            M.match_operator (|
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_trait_method (|
                                                    "core::iter::traits::iterator::Iterator",
                                                    Ty.apply
                                                      (Ty.path "core::iter::adapters::skip::Skip")
                                                      []
                                                      [
                                                        Ty.apply
                                                          (Ty.path "core::slice::iter::Iter")
                                                          []
                                                          [
                                                            Ty.path
                                                              "move_core_types::language_storage::TypeTag"
                                                          ]
                                                      ],
                                                    [],
                                                    "next",
                                                    []
                                                  |),
                                                  [ iter ]
                                                |)
                                              |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let _ :=
                                                      M.is_struct_tuple (|
                                                        γ,
                                                        "core::option::Option::None"
                                                      |) in
                                                    M.alloc (|
                                                      M.never_to_any (| M.read (| M.break (||) |) |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ0_0 :=
                                                      M.SubPointer.get_struct_tuple_field (|
                                                        γ,
                                                        "core::option::Option::Some",
                                                        0
                                                      |) in
                                                    let ty := M.copy (| γ0_0 |) in
                                                    let~ _ :=
                                                      M.match_operator (|
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::Try",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                []
                                                                [
                                                                  Ty.tuple [];
                                                                  Ty.path "core::fmt::Error"
                                                                ],
                                                              [],
                                                              "branch",
                                                              []
                                                            |),
                                                            [
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path "core::fmt::Formatter",
                                                                  "write_fmt",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (| f |);
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.path
                                                                        "core::fmt::Arguments",
                                                                      "new_v1",
                                                                      []
                                                                    |),
                                                                    [
                                                                      M.alloc (|
                                                                        Value.Array
                                                                          [
                                                                            M.read (|
                                                                              Value.String ", "
                                                                            |)
                                                                          ]
                                                                      |);
                                                                      M.alloc (|
                                                                        Value.Array
                                                                          [
                                                                            M.call_closure (|
                                                                              M.get_associated_function (|
                                                                                Ty.path
                                                                                  "core::fmt::rt::Argument",
                                                                                "new_display",
                                                                                [
                                                                                  Ty.apply
                                                                                    (Ty.path "&")
                                                                                    []
                                                                                    [
                                                                                      Ty.path
                                                                                        "move_core_types::language_storage::TypeTag"
                                                                                    ]
                                                                                ]
                                                                              |),
                                                                              [ ty ]
                                                                            |)
                                                                          ]
                                                                      |)
                                                                    ]
                                                                  |)
                                                                ]
                                                              |)
                                                            ]
                                                          |)
                                                        |),
                                                        [
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ0_0 :=
                                                                M.SubPointer.get_struct_tuple_field (|
                                                                  γ,
                                                                  "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::result::Result")
                                                                            []
                                                                            [
                                                                              Ty.tuple [];
                                                                              Ty.path
                                                                                "core::fmt::Error"
                                                                            ],
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "core::result::Result")
                                                                              []
                                                                              [
                                                                                Ty.path
                                                                                  "core::convert::Infallible";
                                                                                Ty.path
                                                                                  "core::fmt::Error"
                                                                              ]
                                                                          ],
                                                                          "from_residual",
                                                                          []
                                                                        |),
                                                                        [ M.read (| residual |) ]
                                                                      |)
                                                                    |)
                                                                  |)
                                                                |)
                                                              |)));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ0_0 :=
                                                                M.SubPointer.get_struct_tuple_field (|
                                                                  γ,
                                                                  "core::ops::control_flow::ControlFlow::Continue",
                                                                  0
                                                                |) in
                                                              let val := M.copy (| γ0_0 |) in
                                                              val))
                                                        ]
                                                      |) in
                                                    M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          M.alloc (| Value.Tuple [] |)))
                                      |)))
                                ]
                              |)) in
                          let~ _ :=
                            M.match_operator (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::Try",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      []
                                      [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                    [],
                                    "branch",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::Formatter",
                                        "write_fmt",
                                        []
                                      |),
                                      [
                                        M.read (| f |);
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::Arguments",
                                            "new_const",
                                            []
                                          |),
                                          [
                                            M.alloc (|
                                              Value.Array [ M.read (| Value.String ">" |) ]
                                            |)
                                          ]
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "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::result::Result")
                                                  []
                                                  [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                                [
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    []
                                                    [
                                                      Ty.path "core::convert::Infallible";
                                                      Ty.path "core::fmt::Error"
                                                    ]
                                                ],
                                                "from_residual",
                                                []
                                              |),
                                              [ M.read (| residual |) ]
                                            |)
                                          |)
                                        |)
                                      |)
                                    |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "core::ops::control_flow::ControlFlow::Continue",
                                        0
                                      |) in
                                    let val := M.copy (| γ0_0 |) in
                                    val))
                              ]
                            |) in
                          M.alloc (| Value.Tuple [] |)));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Display"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Display_for_move_core_types_language_storage_StructTag.
  
  Module Impl_core_fmt_Display_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (*
        fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
            match self {
                TypeTag::Struct(s) => write!(f, "{}", s),
                TypeTag::Vector(ty) => write!(f, "vector<{}>", ty),
                TypeTag::U8 => write!(f, "u8"),
                TypeTag::U16 => write!(f, "u16"),
                TypeTag::U32 => write!(f, "u32"),
                TypeTag::U64 => write!(f, "u64"),
                TypeTag::U128 => write!(f, "u128"),
                TypeTag::U256 => write!(f, "u256"),
                TypeTag::Address => write!(f, "address"),
                TypeTag::Signer => write!(f, "signer"),
                TypeTag::Bool => write!(f, "bool"),
            }
        }
    *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.read (|
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Struct",
                        0
                      |) in
                    let s := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_v1",
                              []
                            |),
                            [
                              M.alloc (| Value.Array [ M.read (| Value.String "" |) ] |);
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::rt::Argument",
                                        "new_display",
                                        [
                                          Ty.apply
                                            (Ty.path "&")
                                            []
                                            [
                                              Ty.apply
                                                (Ty.path "alloc::boxed::Box")
                                                []
                                                [
                                                  Ty.path
                                                    "move_core_types::language_storage::StructTag";
                                                  Ty.path "alloc::alloc::Global"
                                                ]
                                            ]
                                        ]
                                      |),
                                      [ s ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Vector",
                        0
                      |) in
                    let ty := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_v1",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.Array
                                  [
                                    M.read (| Value.String "vector<" |);
                                    M.read (| Value.String ">" |)
                                  ]
                              |);
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::rt::Argument",
                                        "new_display",
                                        [
                                          Ty.apply
                                            (Ty.path "&")
                                            []
                                            [
                                              Ty.apply
                                                (Ty.path "alloc::boxed::Box")
                                                []
                                                [
                                                  Ty.path
                                                    "move_core_types::language_storage::TypeTag";
                                                  Ty.path "alloc::alloc::Global"
                                                ]
                                            ]
                                        ]
                                      |),
                                      [ ty ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (| γ, "move_core_types::language_storage::TypeTag::U8" |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "u8" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U16"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "u16" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U32"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "u32" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U64"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "u64" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U128"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "u128" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::U256"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "u256" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Address"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "address" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Signer"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "signer" |) ] |) ]
                          |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_core_types::language_storage::TypeTag::Bool"
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_fmt",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Arguments",
                              "new_const",
                              []
                            |),
                            [ M.alloc (| Value.Array [ M.read (| Value.String "bool" |) ] |) ]
                          |)
                        ]
                      |)
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Display"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Display_for_move_core_types_language_storage_TypeTag.
  
  Module Impl_core_fmt_Display_for_move_core_types_language_storage_ResourceKey.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::ResourceKey".
    
    (*
        fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
            write!(f, "0x{}/{}", self.address.short_str_lossless(), self.type_)
        }
    *)
    Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.call_closure (|
            M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_fmt", [] |),
            [
              M.read (| f |);
              M.call_closure (|
                M.get_associated_function (| Ty.path "core::fmt::Arguments", "new_v1", [] |),
                [
                  M.alloc (|
                    Value.Array [ M.read (| Value.String "0x" |); M.read (| Value.String "/" |) ]
                  |);
                  M.alloc (|
                    Value.Array
                      [
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::rt::Argument",
                            "new_display",
                            [ Ty.path "alloc::string::String" ]
                          |),
                          [
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_core_types::account_address::AccountAddress",
                                  "short_str_lossless",
                                  []
                                |),
                                [
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_core_types::language_storage::ResourceKey",
                                    "address"
                                  |)
                                ]
                              |)
                            |)
                          ]
                        |);
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::rt::Argument",
                            "new_display",
                            [ Ty.path "move_core_types::language_storage::StructTag" ]
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_core_types::language_storage::ResourceKey",
                              "type_"
                            |)
                          ]
                        |)
                      ]
                  |)
                ]
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Display"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Display_for_move_core_types_language_storage_ResourceKey.
  
  Module Impl_core_convert_From_move_core_types_language_storage_StructTag_for_move_core_types_language_storage_TypeTag.
    Definition Self : Ty.t := Ty.path "move_core_types::language_storage::TypeTag".
    
    (*
        fn from(t: StructTag) -> TypeTag {
            TypeTag::Struct(Box::new(t))
        }
    *)
    Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ t ] =>
        ltac:(M.monadic
          (let t := M.alloc (| t |) in
          Value.StructTuple
            "move_core_types::language_storage::TypeTag::Struct"
            [
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply
                    (Ty.path "alloc::boxed::Box")
                    []
                    [
                      Ty.path "move_core_types::language_storage::StructTag";
                      Ty.path "alloc::alloc::Global"
                    ],
                  "new",
                  []
                |),
                [ M.read (| t |) ]
              |)
            ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::convert::From"
        Self
        (* Trait polymorphic types *)
        [ (* T *) Ty.path "move_core_types::language_storage::StructTag" ]
        (* Instance *) [ ("from", InstanceField.Method from) ].
  End Impl_core_convert_From_move_core_types_language_storage_StructTag_for_move_core_types_language_storage_TypeTag.
End language_storage.
