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

Module ability_field_requirements.
  (*
  pub fn verify_module(module: &CompiledModule) -> VMResult<()> {
      verify_module_impl(module).map_err(|e| e.finish(Location::Module(module.self_id())))
  }
  *)
  Definition verify_module (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
    match ε, τ, α with
    | [], [], [ module ] =>
      ltac:(M.monadic
        (let module := M.alloc (| module |) in
        M.call_closure (|
          M.get_associated_function (|
            Ty.apply
              (Ty.path "core::result::Result")
              []
              [ Ty.tuple []; Ty.path "move_binary_format::errors::PartialVMError" ],
            "map_err",
            [
              Ty.path "move_binary_format::errors::VMError";
              Ty.function
                [ Ty.tuple [ Ty.path "move_binary_format::errors::PartialVMError" ] ]
                (Ty.path "move_binary_format::errors::VMError")
            ]
          |),
          [
            M.call_closure (|
              M.get_function (|
                "move_bytecode_verifier::ability_field_requirements::verify_module_impl",
                []
              |),
              [ M.read (| module |) ]
            |);
            M.closure
              (fun γ =>
                ltac:(M.monadic
                  match γ with
                  | [ α0 ] =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        M.alloc (| α0 |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let e := M.copy (| γ |) in
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::errors::PartialVMError",
                                  "finish",
                                  []
                                |),
                                [
                                  M.read (| e |);
                                  Value.StructTuple
                                    "move_binary_format::errors::Location::Module"
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "move_binary_format::file_format::CompiledModule",
                                          "self_id",
                                          []
                                        |),
                                        [ M.read (| module |) ]
                                      |)
                                    ]
                                ]
                              |)))
                        ]
                      |)))
                  | _ => M.impossible "wrong number of arguments"
                  end))
          ]
        |)))
    | _, _, _ => M.impossible "wrong number of arguments"
    end.
  
  Axiom Function_verify_module :
    M.IsFunction "move_bytecode_verifier::ability_field_requirements::verify_module" verify_module.
  
  (*
  fn verify_module_impl(module: &CompiledModule) -> PartialVMResult<()> {
      for (idx, struct_def) in module.struct_defs().iter().enumerate() {
          let sh = module.struct_handle_at(struct_def.struct_handle);
          let fields = match &struct_def.field_information {
              StructFieldInformation::Native => continue,
              StructFieldInformation::Declared(fields) => fields,
          };
          let required_abilities = sh
              .abilities
              .into_iter()
              .map(|a| a.requires())
              .fold(AbilitySet::EMPTY, |acc, required| acc | required);
          // Assume type parameters have all abilities, as the struct's abilities will be dependent on
          // them
          let type_parameter_abilities = sh
              .type_parameters
              .iter()
              .map(|_| AbilitySet::ALL)
              .collect::<Vec<_>>();
          for field in fields {
              let field_abilities =
                  module.abilities(&field.signature.0, &type_parameter_abilities)?;
              if !required_abilities.is_subset(field_abilities) {
                  return Err(verification_error(
                      StatusCode::FIELD_MISSING_TYPE_ABILITY,
                      IndexKind::StructDefinition,
                      idx as TableIndex,
                  ));
              }
          }
      }
      Ok(())
  }
  *)
  Definition verify_module_impl (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
    match ε, τ, α with
    | [], [], [ module ] =>
      ltac:(M.monadic
        (let module := M.alloc (| module |) in
        M.catch_return (|
          ltac:(M.monadic
            (M.read (|
              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::enumerate::Enumerate")
                            []
                            [
                              Ty.apply
                                (Ty.path "core::slice::iter::Iter")
                                []
                                [ Ty.path "move_binary_format::file_format::StructDefinition" ]
                            ],
                          [],
                          "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_binary_format::file_format::StructDefinition" ],
                              [],
                              "enumerate",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "slice")
                                    []
                                    [ Ty.path "move_binary_format::file_format::StructDefinition" ],
                                  "iter",
                                  []
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "move_binary_format::file_format::CompiledModule",
                                      "struct_defs",
                                      []
                                    |),
                                    [ M.read (| module |) ]
                                  |)
                                ]
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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::enumerate::Enumerate")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "core::slice::iter::Iter")
                                              []
                                              [
                                                Ty.path
                                                  "move_binary_format::file_format::StructDefinition"
                                              ]
                                          ],
                                        [],
                                        "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 γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                        let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                        let idx := M.copy (| γ1_0 |) in
                                        let struct_def := M.copy (| γ1_1 |) in
                                        let~ sh :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path
                                                  "move_binary_format::file_format::CompiledModule",
                                                "struct_handle_at",
                                                []
                                              |),
                                              [
                                                M.read (| module |);
                                                M.read (|
                                                  M.SubPointer.get_struct_record_field (|
                                                    M.read (| struct_def |),
                                                    "move_binary_format::file_format::StructDefinition",
                                                    "struct_handle"
                                                  |)
                                                |)
                                              ]
                                            |)
                                          |) in
                                        let~ fields :=
                                          M.copy (|
                                            M.match_operator (|
                                              M.alloc (|
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (| struct_def |),
                                                  "move_binary_format::file_format::StructDefinition",
                                                  "field_information"
                                                |)
                                              |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ := M.read (| γ |) in
                                                    let _ :=
                                                      M.is_struct_tuple (|
                                                        γ,
                                                        "move_binary_format::file_format::StructFieldInformation::Native"
                                                      |) in
                                                    M.alloc (|
                                                      M.never_to_any (|
                                                        M.read (| M.continue (||) |)
                                                      |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ := M.read (| γ |) in
                                                    let γ1_0 :=
                                                      M.SubPointer.get_struct_tuple_field (|
                                                        γ,
                                                        "move_binary_format::file_format::StructFieldInformation::Declared",
                                                        0
                                                      |) in
                                                    let fields := M.alloc (| γ1_0 |) in
                                                    fields))
                                              ]
                                            |)
                                          |) in
                                        let~ required_abilities :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_trait_method (|
                                                "core::iter::traits::iterator::Iterator",
                                                Ty.apply
                                                  (Ty.path "core::iter::adapters::map::Map")
                                                  []
                                                  [
                                                    Ty.path
                                                      "move_binary_format::file_format::AbilitySetIterator";
                                                    Ty.function
                                                      [
                                                        Ty.tuple
                                                          [
                                                            Ty.path
                                                              "move_binary_format::file_format::Ability"
                                                          ]
                                                      ]
                                                      (Ty.path
                                                        "move_binary_format::file_format::Ability")
                                                  ],
                                                [],
                                                "fold",
                                                [
                                                  Ty.path
                                                    "move_binary_format::file_format::AbilitySet";
                                                  Ty.function
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path
                                                            "move_binary_format::file_format::AbilitySet";
                                                          Ty.path
                                                            "move_binary_format::file_format::Ability"
                                                        ]
                                                    ]
                                                    (Ty.path
                                                      "move_binary_format::file_format::AbilitySet")
                                                ]
                                              |),
                                              [
                                                M.call_closure (|
                                                  M.get_trait_method (|
                                                    "core::iter::traits::iterator::Iterator",
                                                    Ty.path
                                                      "move_binary_format::file_format::AbilitySetIterator",
                                                    [],
                                                    "map",
                                                    [
                                                      Ty.path
                                                        "move_binary_format::file_format::Ability";
                                                      Ty.function
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.path
                                                                "move_binary_format::file_format::Ability"
                                                            ]
                                                        ]
                                                        (Ty.path
                                                          "move_binary_format::file_format::Ability")
                                                    ]
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_trait_method (|
                                                        "core::iter::traits::collect::IntoIterator",
                                                        Ty.path
                                                          "move_binary_format::file_format::AbilitySet",
                                                        [],
                                                        "into_iter",
                                                        []
                                                      |),
                                                      [
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| sh |),
                                                            "move_binary_format::file_format::StructHandle",
                                                            "abilities"
                                                          |)
                                                        |)
                                                      ]
                                                    |);
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ α0 ] =>
                                                            ltac:(M.monadic
                                                              (M.match_operator (|
                                                                M.alloc (| α0 |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let a := M.copy (| γ |) in
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.path
                                                                            "move_binary_format::file_format::Ability",
                                                                          "requires",
                                                                          []
                                                                        |),
                                                                        [ M.read (| a |) ]
                                                                      |)))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  ]
                                                |);
                                                M.read (|
                                                  M.get_constant (|
                                                    "move_binary_format::file_format::EMPTY"
                                                  |)
                                                |);
                                                M.closure
                                                  (fun γ =>
                                                    ltac:(M.monadic
                                                      match γ with
                                                      | [ α0; α1 ] =>
                                                        ltac:(M.monadic
                                                          (M.match_operator (|
                                                            M.alloc (| α0 |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let acc := M.copy (| γ |) in
                                                                  M.match_operator (|
                                                                    M.alloc (| α1 |),
                                                                    [
                                                                      fun γ =>
                                                                        ltac:(M.monadic
                                                                          (let required :=
                                                                            M.copy (| γ |) in
                                                                          M.call_closure (|
                                                                            M.get_trait_method (|
                                                                              "core::ops::bit::BitOr",
                                                                              Ty.path
                                                                                "move_binary_format::file_format::AbilitySet",
                                                                              [
                                                                                Ty.path
                                                                                  "move_binary_format::file_format::Ability"
                                                                              ],
                                                                              "bitor",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (| acc |);
                                                                              M.read (| required |)
                                                                            ]
                                                                          |)))
                                                                    ]
                                                                  |)))
                                                            ]
                                                          |)))
                                                      | _ =>
                                                        M.impossible "wrong number of arguments"
                                                      end))
                                              ]
                                            |)
                                          |) in
                                        let~ type_parameter_abilities :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_trait_method (|
                                                "core::iter::traits::iterator::Iterator",
                                                Ty.apply
                                                  (Ty.path "core::iter::adapters::map::Map")
                                                  []
                                                  [
                                                    Ty.apply
                                                      (Ty.path "core::slice::iter::Iter")
                                                      []
                                                      [
                                                        Ty.path
                                                          "move_binary_format::file_format::StructTypeParameter"
                                                      ];
                                                    Ty.function
                                                      [
                                                        Ty.tuple
                                                          [
                                                            Ty.apply
                                                              (Ty.path "&")
                                                              []
                                                              [
                                                                Ty.path
                                                                  "move_binary_format::file_format::StructTypeParameter"
                                                              ]
                                                          ]
                                                      ]
                                                      (Ty.path
                                                        "move_binary_format::file_format::AbilitySet")
                                                  ],
                                                [],
                                                "collect",
                                                [
                                                  Ty.apply
                                                    (Ty.path "alloc::vec::Vec")
                                                    []
                                                    [
                                                      Ty.path
                                                        "move_binary_format::file_format::AbilitySet";
                                                      Ty.path "alloc::alloc::Global"
                                                    ]
                                                ]
                                              |),
                                              [
                                                M.call_closure (|
                                                  M.get_trait_method (|
                                                    "core::iter::traits::iterator::Iterator",
                                                    Ty.apply
                                                      (Ty.path "core::slice::iter::Iter")
                                                      []
                                                      [
                                                        Ty.path
                                                          "move_binary_format::file_format::StructTypeParameter"
                                                      ],
                                                    [],
                                                    "map",
                                                    [
                                                      Ty.path
                                                        "move_binary_format::file_format::AbilitySet";
                                                      Ty.function
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                []
                                                                [
                                                                  Ty.path
                                                                    "move_binary_format::file_format::StructTypeParameter"
                                                                ]
                                                            ]
                                                        ]
                                                        (Ty.path
                                                          "move_binary_format::file_format::AbilitySet")
                                                    ]
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path "slice")
                                                          []
                                                          [
                                                            Ty.path
                                                              "move_binary_format::file_format::StructTypeParameter"
                                                          ],
                                                        "iter",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::ops::deref::Deref",
                                                            Ty.apply
                                                              (Ty.path "alloc::vec::Vec")
                                                              []
                                                              [
                                                                Ty.path
                                                                  "move_binary_format::file_format::StructTypeParameter";
                                                                Ty.path "alloc::alloc::Global"
                                                              ],
                                                            [],
                                                            "deref",
                                                            []
                                                          |),
                                                          [
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| sh |),
                                                              "move_binary_format::file_format::StructHandle",
                                                              "type_parameters"
                                                            |)
                                                          ]
                                                        |)
                                                      ]
                                                    |);
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ α0 ] =>
                                                            ltac:(M.monadic
                                                              (M.match_operator (|
                                                                M.alloc (| α0 |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (M.read (|
                                                                        M.get_constant (|
                                                                          "move_binary_format::file_format::ALL"
                                                                        |)
                                                                      |)))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.use
                                          (M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::iter::traits::collect::IntoIterator",
                                                  Ty.apply
                                                    (Ty.path "&")
                                                    []
                                                    [
                                                      Ty.apply
                                                        (Ty.path "alloc::vec::Vec")
                                                        []
                                                        [
                                                          Ty.path
                                                            "move_binary_format::file_format::FieldDefinition";
                                                          Ty.path "alloc::alloc::Global"
                                                        ]
                                                    ],
                                                  [],
                                                  "into_iter",
                                                  []
                                                |),
                                                [ M.read (| fields |) ]
                                              |)
                                            |),
                                            [
                                              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::slice::iter::Iter")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "move_binary_format::file_format::FieldDefinition"
                                                                  ],
                                                                [],
                                                                "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 field := M.copy (| γ0_0 |) in
                                                                let~ field_abilities :=
                                                                  M.copy (|
                                                                    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.path
                                                                                  "move_binary_format::file_format::AbilitySet";
                                                                                Ty.path
                                                                                  "move_binary_format::errors::PartialVMError"
                                                                              ],
                                                                            [],
                                                                            "branch",
                                                                            []
                                                                          |),
                                                                          [
                                                                            M.call_closure (|
                                                                              M.get_associated_function (|
                                                                                Ty.path
                                                                                  "move_binary_format::file_format::CompiledModule",
                                                                                "abilities",
                                                                                []
                                                                              |),
                                                                              [
                                                                                M.read (| module |);
                                                                                M.SubPointer.get_struct_tuple_field (|
                                                                                  M.SubPointer.get_struct_record_field (|
                                                                                    M.read (|
                                                                                      field
                                                                                    |),
                                                                                    "move_binary_format::file_format::FieldDefinition",
                                                                                    "signature"
                                                                                  |),
                                                                                  "move_binary_format::file_format::TypeSignature",
                                                                                  0
                                                                                |);
                                                                                M.call_closure (|
                                                                                  M.get_trait_method (|
                                                                                    "core::ops::deref::Deref",
                                                                                    Ty.apply
                                                                                      (Ty.path
                                                                                        "alloc::vec::Vec")
                                                                                      []
                                                                                      [
                                                                                        Ty.path
                                                                                          "move_binary_format::file_format::AbilitySet";
                                                                                        Ty.path
                                                                                          "alloc::alloc::Global"
                                                                                      ],
                                                                                    [],
                                                                                    "deref",
                                                                                    []
                                                                                  |),
                                                                                  [
                                                                                    type_parameter_abilities
                                                                                  ]
                                                                                |)
                                                                              ]
                                                                            |)
                                                                          ]
                                                                        |)
                                                                      |),
                                                                      [
                                                                        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
                                                                                              "move_binary_format::errors::PartialVMError"
                                                                                          ],
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "core::result::Result")
                                                                                            []
                                                                                            [
                                                                                              Ty.path
                                                                                                "core::convert::Infallible";
                                                                                              Ty.path
                                                                                                "move_binary_format::errors::PartialVMError"
                                                                                            ]
                                                                                        ],
                                                                                        "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.match_operator (|
                                                                  M.alloc (| Value.Tuple [] |),
                                                                  [
                                                                    fun γ =>
                                                                      ltac:(M.monadic
                                                                        (let γ :=
                                                                          M.use
                                                                            (M.alloc (|
                                                                              UnOp.not (|
                                                                                M.call_closure (|
                                                                                  M.get_associated_function (|
                                                                                    Ty.path
                                                                                      "move_binary_format::file_format::AbilitySet",
                                                                                    "is_subset",
                                                                                    []
                                                                                  |),
                                                                                  [
                                                                                    M.read (|
                                                                                      required_abilities
                                                                                    |);
                                                                                    M.read (|
                                                                                      field_abilities
                                                                                    |)
                                                                                  ]
                                                                                |)
                                                                              |)
                                                                            |)) in
                                                                        let _ :=
                                                                          M.is_constant_or_break_match (|
                                                                            M.read (| γ |),
                                                                            Value.Bool true
                                                                          |) in
                                                                        M.alloc (|
                                                                          M.never_to_any (|
                                                                            M.read (|
                                                                              M.return_ (|
                                                                                Value.StructTuple
                                                                                  "core::result::Result::Err"
                                                                                  [
                                                                                    M.call_closure (|
                                                                                      M.get_function (|
                                                                                        "move_binary_format::errors::verification_error",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        Value.StructTuple
                                                                                          "move_core_types::vm_status::StatusCode::FIELD_MISSING_TYPE_ABILITY"
                                                                                          [];
                                                                                        Value.StructTuple
                                                                                          "move_binary_format::IndexKind::StructDefinition"
                                                                                          [];
                                                                                        M.rust_cast
                                                                                          (M.read (|
                                                                                            idx
                                                                                          |))
                                                                                      ]
                                                                                    |)
                                                                                  ]
                                                                              |)
                                                                            |)
                                                                          |)
                                                                        |)));
                                                                    fun γ =>
                                                                      ltac:(M.monadic
                                                                        (M.alloc (|
                                                                          Value.Tuple []
                                                                        |)))
                                                                  ]
                                                                |)))
                                                          ]
                                                        |) in
                                                      M.alloc (| Value.Tuple [] |)))
                                                  |)))
                                            ]
                                          |))))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
            |)))
        |)))
    | _, _, _ => M.impossible "wrong number of arguments"
    end.
  
  Axiom Function_verify_module_impl :
    M.IsFunction
      "move_bytecode_verifier::ability_field_requirements::verify_module_impl"
      verify_module_impl.
End ability_field_requirements.
