Skip to main content

🍬 Script_family.v

Proofs

See simulations, Gitlab , OCaml

Require Import CoqOfOCaml.CoqOfOCaml.
Require Import CoqOfOCaml.Settings.

Require Import TezosOfOCaml.Environment.V8.
Require Import TezosOfOCaml.Proto_alpha.Simulations.Script_family.

Module Ty.
[Prop]ositional predicate specifying comparable Michelson types.
  Fixpoint is_Comparable (ty : Ty.t) : Prop :=
    match ty with
    | Ty.Unit
    | Ty.Never
    | Ty.Num _
    | Ty.Signature
    | Ty.String
    | Ty.Bytes
    | Ty.Mutez
    | Ty.Bool
    | Ty.Key_hash
    | Ty.Key
    | Ty.Timestamp
    | Ty.Chain_id
    | Ty.Address
    | Ty.Tx_rollup_l2_addressTrue
    | Ty.Pair t1 t2
          is_Comparable t1
         is_Comparable t2
    | Ty.Union t1 t2
          is_Comparable t1
         is_Comparable t2
    | Ty.Option t'
        is_Comparable t'
    | _False
    end.

The validity of a type.
  Module Valid.
    Fixpoint t (ty : Ty.t) : Prop :=
      match ty with
      | Ty.UnitTrue
      | Ty.Num _True
      | Ty.SignatureTrue
      | Ty.StringTrue
      | Ty.BytesTrue
      | Ty.MutezTrue
      | Ty.Key_hashTrue
      | Ty.KeyTrue
      | Ty.TimestampTrue
      | Ty.AddressTrue
      | Ty.Tx_rollup_l2_addressTrue
      | Ty.BoolTrue
      | Ty.Pair ty1 ty2t ty1 t ty2
      | Ty.Union ty1 ty2t ty1 t ty2
      | Ty.Lambda arg rett arg t ret
      | Ty.Option tyt ty
      | Ty.List tyt ty
      | Ty.Set_ keyis_Comparable key t key
      | Ty.Map key valueis_Comparable key t key t value
      | Ty.Big_map key valueis_Comparable key t key t value
      | Ty.Contract tyt ty
      | Ty.Sapling_transactionTrue
      | Ty.Sapling_transaction_deprecatedTrue
      | Ty.Sapling_stateTrue
      | Ty.OperationTrue
      | Ty.Chain_idTrue
      | Ty.NeverTrue
      | Ty.Bls12_381_g1True
      | Ty.Bls12_381_g2True
      | Ty.Bls12_381_frTrue
      | Ty.Ticket tyis_Comparable ty t ty
      | Ty.Chest_keyTrue
      | Ty.ChestTrue
      end.
  End Valid.
End Ty.

Module Stack_ty.
The validity of a stack family.
  Module Valid.
    Definition t (tys : Stack_ty.t) : Prop :=
      List.Forall Ty.Valid.t tys.
  End Valid.
End Stack_ty.