(** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *)
(** [constants] *)
Require Import Primitives.
Import Primitives.
Require Import Coq.ZArith.ZArith.
Require Import List.
Import ListNotations.
Local Open Scope Primitives_scope.
Module Constants.

(** [constants::X0]
    Source: 'tests/src/constants.rs', lines 6:0-6:22
    Visibility: public *)
Definition x0 : u32 := 0%u32.

(** [constants::X1]
    Source: 'tests/src/constants.rs', lines 8:0-8:29
    Visibility: public *)
Definition x1 : u32 := core_num_U32_MAX.

(** [constants::X2]
    Source: 'tests/src/constants.rs', lines 11:0-14:2
    Visibility: public *)
Definition x2 : u32 := 3%u32.

(** [constants::incr]:
    Source: 'tests/src/constants.rs', lines 18:0-20:1
    Visibility: public *)
Definition incr (n : u32) : result u32 :=
  u32_add n 1%u32.

(** [constants::X3]
    Source: 'tests/src/constants.rs', lines 16:0-16:29
    Visibility: public *)
Definition x3 : result u32 := incr 32%u32.

(** [constants::mk_pair0]:
    Source: 'tests/src/constants.rs', lines 24:0-26:1
    Visibility: public *)
Definition mk_pair0 (x : u32) (y1 : u32) : result (u32 * u32) :=
  Ok (x, y1).

(** [constants::Pair]
    Source: 'tests/src/constants.rs', lines 37:0-40:1
    Visibility: public *)
Record Pair_t (T1 : Type) (T2 : Type) :=
mkPair_t {
  pair_x : T1; pair_y : T2;
}
.

Arguments mkPair_t { _ } { _ }.
Arguments pair_x { _ } { _ }.
Arguments pair_y { _ } { _ }.

(** [constants::mk_pair1]:
    Source: 'tests/src/constants.rs', lines 28:0-30:1
    Visibility: public *)
Definition mk_pair1 (x : u32) (y1 : u32) : result (Pair_t u32 u32) :=
  Ok {| pair_x := x; pair_y := y1 |}
.

(** [constants::P0]
    Source: 'tests/src/constants.rs', lines 32:0-32:42
    Visibility: public *)
Definition p0 : result (u32 * u32) := mk_pair0 0%u32 1%u32.

(** [constants::P1]
    Source: 'tests/src/constants.rs', lines 33:0-33:46
    Visibility: public *)
Definition p1 : result (Pair_t u32 u32) := mk_pair1 0%u32 1%u32.

(** [constants::P2]
    Source: 'tests/src/constants.rs', lines 34:0-34:34
    Visibility: public *)
Definition p2 : (u32 * u32) := (0%u32, 1%u32).

(** [constants::P3]
    Source: 'tests/src/constants.rs', lines 35:0-35:51
    Visibility: public *)
Definition p3 : Pair_t u32 u32 := {| pair_x := 0%u32; pair_y := 1%u32 |}.

(** [constants::Wrap]
    Source: 'tests/src/constants.rs', lines 50:0-52:1
    Visibility: public *)
Record Wrap_t (T : Type) := mkWrap_t { wrap_value : T; }.

Arguments mkWrap_t { _ }.
Arguments wrap_value { _ }.

(** [constants::{constants::Wrap<T>}::new]:
    Source: 'tests/src/constants.rs', lines 55:4-57:5
    Visibility: public *)
Definition wrap_new {T : Type} (value : T) : result (Wrap_t T) :=
  Ok {| wrap_value := value |}
.

(** [constants::Y]
    Source: 'tests/src/constants.rs', lines 42:0-42:38
    Visibility: public *)
Definition y : result (Wrap_t i32) := wrap_new 2%i32.

(** [constants::unwrap_y]:
    Source: 'tests/src/constants.rs', lines 44:0-46:1
    Visibility: public *)
Definition unwrap_y : result i32 :=
  w <- y; Ok w.(wrap_value).

(** [constants::YVAL]
    Source: 'tests/src/constants.rs', lines 48:0-48:33
    Visibility: public *)
Definition yVAL : result i32 := unwrap_y.

(** [constants::get_z1::Z1]
    Source: 'tests/src/constants.rs', lines 63:4-63:22 *)
Definition get_z1_Z1 : i32 := 3%i32.

(** [constants::get_z1]:
    Source: 'tests/src/constants.rs', lines 62:0-65:1
    Visibility: public *)
Definition get_z1 : result i32 :=
  Ok get_z1_Z1.

(** [constants::add]:
    Source: 'tests/src/constants.rs', lines 67:0-69:1
    Visibility: public *)
Definition add (a : i32) (b : i32) : result i32 :=
  i32_add a b.

(** [constants::Q1]
    Source: 'tests/src/constants.rs', lines 75:0-75:22
    Visibility: public *)
Definition q1 : i32 := 5%i32.

(** [constants::Q2]
    Source: 'tests/src/constants.rs', lines 76:0-76:23
    Visibility: public *)
Definition q2 : i32 := q1.

(** [constants::Q3]
    Source: 'tests/src/constants.rs', lines 77:0-77:31
    Visibility: public *)
Definition q3 : result i32 := add q2 3%i32.

(** [constants::get_z2]:
    Source: 'tests/src/constants.rs', lines 71:0-73:1
    Visibility: public *)
Definition get_z2 : result i32 :=
  i <- get_z1; i1 <- q3; i2 <- add i i1; add q1 i2
.

(** [constants::S1]
    Source: 'tests/src/constants.rs', lines 81:0-81:23
    Visibility: public *)
Definition s1 : u32 := 6%u32.

(** [constants::S2]
    Source: 'tests/src/constants.rs', lines 82:0-82:30
    Visibility: public *)
Definition s2 : result u32 := incr s1.

(** [constants::S3]
    Source: 'tests/src/constants.rs', lines 83:0-83:35
    Visibility: public *)
Definition s3 : Pair_t u32 u32 := p3.

(** [constants::S4]
    Source: 'tests/src/constants.rs', lines 84:0-84:47
    Visibility: public *)
Definition s4 : result (Pair_t u32 u32) := mk_pair1 7%u32 8%u32.

(** [constants::V]
    Source: 'tests/src/constants.rs', lines 87:0-89:1
    Visibility: public *)
Record V_t (T : Type) (N : usize) := mkV_t { v_x : array T N; }.

Arguments mkV_t { _ } { _ }.
Arguments v_x { _ } { _ }.

(** [constants::{constants::V<T, N>}::LEN]
    Source: 'tests/src/constants.rs', lines 92:4-92:29
    Visibility: public *)
Definition v_LEN (T : Type) (N : usize) : usize := N.

(** [constants::use_v]:
    Source: 'tests/src/constants.rs', lines 95:0-97:1
    Visibility: public *)
Definition use_v (T : Type) (N : usize) : result usize :=
  Ok (v_LEN T N).

End Constants.
