Module Tezos_raw_protocol_alpha.Script_typed_ir

type step_constants = {
  1. sender : Alpha_context.Destination.t;
    (*

    The address calling this contract, as returned by SENDER.

    *)
  2. payer : Tezos_protocol_environment_alpha.Signature.public_key_hash;
    (*

    The address of the implicit account that initiated the chain of contract calls, as returned by SOURCE.

    *)
  3. self : Contract_hash.t;
    (*

    The address of the contract being executed, as returned by SELF and SELF_ADDRESS. Also used:

    • as ticketer in TICKET
    • as caller in VIEW, TRANSFER_TOKENS, and CREATE_CONTRACT
    *)
  4. amount : Alpha_context.Tez.t;
    (*

    The amount of the current transaction, as returned by AMOUNT.

    *)
  5. balance : Alpha_context.Tez.t;
    (*

    The balance of the contract as returned by BALANCE.

    *)
  6. chain_id : Tezos_protocol_environment_alpha.Chain_id.t;
    (*

    The chain id of the chain, as returned by CHAIN_ID.

    *)
  7. now : Script_timestamp.t;
    (*

    The earliest time at which the current block could have been timestamped, as returned by NOW.

    *)
  8. level : Script_int.n Script_int.num;
    (*

    The level of the current block, as returned by LEVEL.

    *)
}
type never = |
type address = {
  1. destination : Alpha_context.Destination.t;
  2. entrypoint : Alpha_context.Entrypoint.t;
}
module Script_signature : sig ... end
type signature = Script_signature.t
type ('a, 'b) pair = 'a * 'b
type ('a, 'b) or_ =
  1. | L of 'a
  2. | R of 'b
module Script_chain_id : sig ... end
module Script_bls : sig ... end
module Script_timelock : sig ... end
type ticket_amount = Ticket_amount.t
type 'a ticket = {
  1. ticketer : Alpha_context.Contract.t;
  2. contents : 'a;
  3. amount : ticket_amount;
}
type empty_cell =
  1. | EmptyCell
type end_of_stack = empty_cell * empty_cell
module Type_size : sig ... end
type 'a ty_metadata = {
  1. size : 'a Type_size.t;
}
module type Boxed_set_OPS = sig ... end
module type Boxed_set = sig ... end
type 'elt set =
  1. | Set_tag of (module Boxed_set with type elt = 'elt)

set is made algebraic in order to distinguish it from the other type parameters of ty.

module type Boxed_map_OPS = sig ... end
module type Boxed_map = sig ... end
type ('key, 'value) map =
  1. | Map_tag of (module Boxed_map with type key = 'key and type value = 'value)

map is made algebraic in order to distinguish it from the other type parameters of ty.

type ('key, 'value) big_map_overlay = {
  1. map : ('key * 'value option) Big_map_overlay.t;
  2. size : int;
}
type view = {
  1. input_ty : Alpha_context.Script.node;
  2. output_ty : Alpha_context.Script.node;
  3. view_code : Alpha_context.Script.node;
}
type view_map = (Script_string.t, view) map
type entrypoint_info = {
  1. name : Alpha_context.Entrypoint.t;
  2. original_type_expr : Alpha_context.Script.node;
}
type 'arg entrypoints_node = {
  1. at_node : entrypoint_info option;
  2. nested : 'arg nested_entrypoints;
}

'arg entrypoints represents the tree of entrypoints of a parameter type 'arg. at_node are entrypoint details at that node if it is not None. nested are the entrypoints below the node in the tree. It is always Entrypoints_None for non-or nodes. But it is also ok to have Entrypoints_None for an or node, it just means that there are no entrypoints below that node in the tree.

and 'arg nested_entrypoints =
  1. | Entrypoints_Or : {
    1. left : 'l entrypoints_node;
    2. right : 'r entrypoints_node;
    } -> ('l, 'r) or_ nested_entrypoints
  2. | Entrypoints_None : _ nested_entrypoints
val no_entrypoints : _ entrypoints_node

no_entrypoints is {at_node = None; nested = Entrypoints_None}

type logging_event =
  1. | LogEntry
  2. | LogExit of Alpha_context.Script.location
type 'arg entrypoints = {
  1. root : 'arg entrypoints_node;
  2. original_type_expr : Alpha_context.Script.node;
}
and ('before_top, 'before, 'result_top, 'result) kinstr =
  1. | IDrop : Alpha_context.Script.location * ('b, 'S, 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  2. | IDup : Alpha_context.Script.location * ('a, 'a * ('b * 'S), 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  3. | ISwap : Alpha_context.Script.location * ('b, 'a * ('c * 'S), 'r, 'F) kinstr -> ('a, 'b * ('c * 'S), 'r, 'F) kinstr
  4. | IPush : Alpha_context.Script.location * ('ty, _) ty * 'ty * ('ty, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  5. | IUnit : Alpha_context.Script.location * (unit, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  6. | ICons_pair : Alpha_context.Script.location * (('a, 'b) pair, 'c * 'S, 'r, 'F) kinstr -> ('a, 'b * ('c * 'S), 'r, 'F) kinstr
  7. | ICar : Alpha_context.Script.location * ('a, 'S, 'r, 'F) kinstr -> (('a, 'b) pair, 'S, 'r, 'F) kinstr
  8. | ICdr : Alpha_context.Script.location * ('b, 'S, 'r, 'F) kinstr -> (('a, 'b) pair, 'S, 'r, 'F) kinstr
  9. | IUnpair : Alpha_context.Script.location * ('a, 'b * 'S, 'r, 'F) kinstr -> (('a, 'b) pair, 'S, 'r, 'F) kinstr
  10. | ICons_some : Alpha_context.Script.location * ('v option, 'a * 'S, 'r, 'F) kinstr -> ('v, 'a * 'S, 'r, 'F) kinstr
  11. | ICons_none : Alpha_context.Script.location * ('b, _) ty * ('b option, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  12. | IIf_none : {
    1. loc : Alpha_context.Script.location;
    2. branch_if_none : ('b, 'S, 'c, 'T) kinstr;
    3. branch_if_some : ('a, 'b * 'S, 'c, 'T) kinstr;
    4. k : ('c, 'T, 'r, 'F) kinstr;
    } -> ('a option, 'b * 'S, 'r, 'F) kinstr
  13. | IOpt_map : {
    1. loc : Alpha_context.Script.location;
    2. body : ('a, 'S, 'b, 'S) kinstr;
    3. k : ('b option, 'S, 'c, 'F) kinstr;
    } -> ('a option, 'S, 'c, 'F) kinstr
  14. | ICons_left : Alpha_context.Script.location * ('b, _) ty * (('a, 'b) or_, 'c * 'S, 'r, 'F) kinstr -> ('a, 'c * 'S, 'r, 'F) kinstr
  15. | ICons_right : Alpha_context.Script.location * ('a, _) ty * (('a, 'b) or_, 'c * 'S, 'r, 'F) kinstr -> ('b, 'c * 'S, 'r, 'F) kinstr
  16. | IIf_left : {
    1. loc : Alpha_context.Script.location;
    2. branch_if_left : ('a, 'S, 'c, 'T) kinstr;
    3. branch_if_right : ('b, 'S, 'c, 'T) kinstr;
    4. k : ('c, 'T, 'r, 'F) kinstr;
    } -> (('a, 'b) or_, 'S, 'r, 'F) kinstr
  17. | ICons_list : Alpha_context.Script.location * ('a Script_list.t, 'S, 'r, 'F) kinstr -> ('a, 'a Script_list.t * 'S, 'r, 'F) kinstr
  18. | INil : Alpha_context.Script.location * ('b, _) ty * ('b Script_list.t, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  19. | IIf_cons : {
    1. loc : Alpha_context.Script.location;
    2. branch_if_cons : ('a, 'a Script_list.t * ('b * 'S), 'c, 'T) kinstr;
    3. branch_if_nil : ('b, 'S, 'c, 'T) kinstr;
    4. k : ('c, 'T, 'r, 'F) kinstr;
    } -> ('a Script_list.t, 'b * 'S, 'r, 'F) kinstr
  20. | IList_map : Alpha_context.Script.location * ('a, 'c * 'S, 'b, 'c * 'S) kinstr * ('b Script_list.t, _) ty option * ('b Script_list.t, 'c * 'S, 'r, 'F) kinstr -> ('a Script_list.t, 'c * 'S, 'r, 'F) kinstr
  21. | IList_iter : Alpha_context.Script.location * ('a, _) ty option * ('a, 'b * 'S, 'b, 'S) kinstr * ('b, 'S, 'r, 'F) kinstr -> ('a Script_list.t, 'b * 'S, 'r, 'F) kinstr
  22. | IList_size : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> ('a Script_list.t, 'S, 'r, 'F) kinstr
  23. | IEmpty_set : Alpha_context.Script.location * 'b comparable_ty * ('b set, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  24. | ISet_iter : Alpha_context.Script.location * 'a comparable_ty option * ('a, 'b * 'S, 'b, 'S) kinstr * ('b, 'S, 'r, 'F) kinstr -> ('a set, 'b * 'S, 'r, 'F) kinstr
  25. | ISet_mem : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> ('a, 'a set * 'S, 'r, 'F) kinstr
  26. | ISet_update : Alpha_context.Script.location * ('a set, 'S, 'r, 'F) kinstr -> ('a, bool * ('a set * 'S), 'r, 'F) kinstr
  27. | ISet_size : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> ('a set, 'S, 'r, 'F) kinstr
  28. | IEmpty_map : Alpha_context.Script.location * 'b comparable_ty * ('c, _) ty option * (('b, 'c) map, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  29. | IMap_map : Alpha_context.Script.location * (('a, 'c) map, _) ty option * (('a, 'b) pair, 'd * 'S, 'c, 'd * 'S) kinstr * (('a, 'c) map, 'd * 'S, 'r, 'F) kinstr -> (('a, 'b) map, 'd * 'S, 'r, 'F) kinstr
  30. | IMap_iter : Alpha_context.Script.location * (('a, 'b) pair, _) ty option * (('a, 'b) pair, 'c * 'S, 'c, 'S) kinstr * ('c, 'S, 'r, 'F) kinstr -> (('a, 'b) map, 'c * 'S, 'r, 'F) kinstr
  31. | IMap_mem : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> ('a, ('a, 'b) map * 'S, 'r, 'F) kinstr
  32. | IMap_get : Alpha_context.Script.location * ('b option, 'S, 'r, 'F) kinstr -> ('a, ('a, 'b) map * 'S, 'r, 'F) kinstr
  33. | IMap_update : Alpha_context.Script.location * (('a, 'b) map, 'S, 'r, 'F) kinstr -> ('a, 'b option * (('a, 'b) map * 'S), 'r, 'F) kinstr
  34. | IMap_get_and_update : Alpha_context.Script.location * ('b option, ('a, 'b) map * 'S, 'r, 'F) kinstr -> ('a, 'b option * (('a, 'b) map * 'S), 'r, 'F) kinstr
  35. | IMap_size : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (('a, 'b) map, 'S, 'r, 'F) kinstr
  36. | IEmpty_big_map : Alpha_context.Script.location * 'b comparable_ty * ('c, _) ty * (('b, 'c) big_map, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  37. | IBig_map_mem : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> ('a, ('a, 'b) big_map * 'S, 'r, 'F) kinstr
  38. | IBig_map_get : Alpha_context.Script.location * ('b option, 'S, 'r, 'F) kinstr -> ('a, ('a, 'b) big_map * 'S, 'r, 'F) kinstr
  39. | IBig_map_update : Alpha_context.Script.location * (('a, 'b) big_map, 'S, 'r, 'F) kinstr -> ('a, 'b option * (('a, 'b) big_map * 'S), 'r, 'F) kinstr
  40. | IBig_map_get_and_update : Alpha_context.Script.location * ('b option, ('a, 'b) big_map * 'S, 'r, 'F) kinstr -> ('a, 'b option * (('a, 'b) big_map * 'S), 'r, 'F) kinstr
  41. | IConcat_string : Alpha_context.Script.location * (Script_string.t, 'S, 'r, 'F) kinstr -> (Script_string.t Script_list.t, 'S, 'r, 'F) kinstr
  42. | IConcat_string_pair : Alpha_context.Script.location * (Script_string.t, 'S, 'r, 'F) kinstr -> (Script_string.t, Script_string.t * 'S, 'r, 'F) kinstr
  43. | ISlice_string : Alpha_context.Script.location * (Script_string.t option, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * (Script_string.t * 'S), 'r, 'F) kinstr
  44. | IString_size : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_string.t, 'S, 'r, 'F) kinstr
  45. | IConcat_bytes : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes Script_list.t, 'S, 'r, 'F) kinstr
  46. | IConcat_bytes_pair : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, bytes * 'S, 'r, 'F) kinstr
  47. | ISlice_bytes : Alpha_context.Script.location * (bytes option, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * (bytes * 'S), 'r, 'F) kinstr
  48. | IBytes_size : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  49. | ILsl_bytes : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  50. | ILsr_bytes : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  51. | IOr_bytes : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, bytes * 'S, 'r, 'F) kinstr
  52. | IAnd_bytes : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, bytes * 'S, 'r, 'F) kinstr
  53. | IXor_bytes : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, bytes * 'S, 'r, 'F) kinstr
  54. | INot_bytes : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  55. | INat_bytes : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  56. | IBytes_nat : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr
  57. | IInt_bytes : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  58. | IBytes_int : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  59. | IAdd_seconds_to_timestamp : Alpha_context.Script.location * (Script_timestamp.t, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, Script_timestamp.t * 'S, 'r, 'F) kinstr
  60. | IAdd_timestamp_to_seconds : Alpha_context.Script.location * (Script_timestamp.t, 'S, 'r, 'F) kinstr -> (Script_timestamp.t, Script_int.z Script_int.num * 'S, 'r, 'F) kinstr
  61. | ISub_timestamp_seconds : Alpha_context.Script.location * (Script_timestamp.t, 'S, 'r, 'F) kinstr -> (Script_timestamp.t, Script_int.z Script_int.num * 'S, 'r, 'F) kinstr
  62. | IDiff_timestamps : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> (Script_timestamp.t, Script_timestamp.t * 'S, 'r, 'F) kinstr
  63. | IAdd_tez : Alpha_context.Script.location * (Alpha_context.Tez.t, 'S, 'r, 'F) kinstr -> (Alpha_context.Tez.t, Alpha_context.Tez.t * 'S, 'r, 'F) kinstr
  64. | ISub_tez : Alpha_context.Script.location * (Alpha_context.Tez.t option, 'S, 'r, 'F) kinstr -> (Alpha_context.Tez.t, Alpha_context.Tez.t * 'S, 'r, 'F) kinstr
  65. | ISub_tez_legacy : Alpha_context.Script.location * (Alpha_context.Tez.t, 'S, 'r, 'F) kinstr -> (Alpha_context.Tez.t, Alpha_context.Tez.t * 'S, 'r, 'F) kinstr
  66. | IMul_teznat : Alpha_context.Script.location * (Alpha_context.Tez.t, 'S, 'r, 'F) kinstr -> (Alpha_context.Tez.t, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  67. | IMul_nattez : Alpha_context.Script.location * (Alpha_context.Tez.t, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Alpha_context.Tez.t * 'S, 'r, 'F) kinstr
  68. | IEdiv_teznat : Alpha_context.Script.location * ((Alpha_context.Tez.t, Alpha_context.Tez.t) pair option, 'S, 'r, 'F) kinstr -> (Alpha_context.Tez.t, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  69. | IEdiv_tez : Alpha_context.Script.location * ((Script_int.n Script_int.num, Alpha_context.Tez.t) pair option, 'S, 'r, 'F) kinstr -> (Alpha_context.Tez.t, Alpha_context.Tez.t * 'S, 'r, 'F) kinstr
  70. | IOr : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (bool, bool * 'S, 'r, 'F) kinstr
  71. | IAnd : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (bool, bool * 'S, 'r, 'F) kinstr
  72. | IXor : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (bool, bool * 'S, 'r, 'F) kinstr
  73. | INot : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (bool, 'S, 'r, 'F) kinstr
  74. | IIs_nat : Alpha_context.Script.location * (Script_int.n Script_int.num option, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  75. | INeg : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> ('a Script_int.num, 'S, 'r, 'F) kinstr
  76. | IAbs_int : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  77. | IInt_nat : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr
  78. | IAdd_int : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> ('a Script_int.num, 'b Script_int.num * 'S, 'r, 'F) kinstr
  79. | IAdd_nat : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  80. | ISub_int : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> ('a Script_int.num, 'b Script_int.num * 'S, 'r, 'F) kinstr
  81. | IMul_int : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> ('a Script_int.num, 'b Script_int.num * 'S, 'r, 'F) kinstr
  82. | IMul_nat : Alpha_context.Script.location * ('a Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, 'a Script_int.num * 'S, 'r, 'F) kinstr
  83. | IEdiv_int : Alpha_context.Script.location * ((Script_int.z Script_int.num, Script_int.n Script_int.num) pair option, 'S, 'r, 'F) kinstr -> ('a Script_int.num, 'b Script_int.num * 'S, 'r, 'F) kinstr
  84. | IEdiv_nat : Alpha_context.Script.location * (('a Script_int.num, Script_int.n Script_int.num) pair option, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, 'a Script_int.num * 'S, 'r, 'F) kinstr
  85. | ILsl_nat : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  86. | ILsr_nat : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  87. | IOr_nat : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  88. | IAnd_nat : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  89. | IAnd_int_nat : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  90. | IXor_nat : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Script_int.n Script_int.num, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  91. | INot_int : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> ('a Script_int.num, 'S, 'r, 'F) kinstr
  92. | IIf : {
    1. loc : Alpha_context.Script.location;
    2. branch_if_true : ('a, 'S, 'b, 'T) kinstr;
    3. branch_if_false : ('a, 'S, 'b, 'T) kinstr;
    4. k : ('b, 'T, 'r, 'F) kinstr;
    } -> (bool, 'a * 'S, 'r, 'F) kinstr
  93. | ILoop : Alpha_context.Script.location * ('a, 'S, bool, 'a * 'S) kinstr * ('a, 'S, 'r, 'F) kinstr -> (bool, 'a * 'S, 'r, 'F) kinstr
  94. | ILoop_left : Alpha_context.Script.location * ('a, 'S, ('a, 'b) or_, 'S) kinstr * ('b, 'S, 'r, 'F) kinstr -> (('a, 'b) or_, 'S, 'r, 'F) kinstr
  95. | IDip : Alpha_context.Script.location * ('b, 'S, 'c, 'T) kinstr * ('a, _) ty option * ('a, 'c * 'T, 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  96. | IExec : Alpha_context.Script.location * ('b, 'S) stack_ty option * ('b, 'S, 'r, 'F) kinstr -> ('a, ('a, 'b) lambda * 'S, 'r, 'F) kinstr
  97. | IApply : Alpha_context.Script.location * ('a, _) ty * (('b, 'c) lambda, 'S, 'r, 'F) kinstr -> ('a, (('a, 'b) pair, 'c) lambda * 'S, 'r, 'F) kinstr
  98. | ILambda : Alpha_context.Script.location * ('b, 'c) lambda * (('b, 'c) lambda, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  99. | IFailwith : Alpha_context.Script.location * ('a, _) ty -> ('a, 'S, 'r, 'F) kinstr
  100. | ICompare : Alpha_context.Script.location * 'a comparable_ty * (Script_int.z Script_int.num, 'b * 'S, 'r, 'F) kinstr -> ('a, 'a * ('b * 'S), 'r, 'F) kinstr
  101. | IEq : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  102. | INeq : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  103. | ILt : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  104. | IGt : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  105. | ILe : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  106. | IGe : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr
  107. | IAddress : Alpha_context.Script.location * (address, 'S, 'r, 'F) kinstr -> ('a typed_contract, 'S, 'r, 'F) kinstr
  108. | IContract : Alpha_context.Script.location * ('a, _) ty * Alpha_context.Entrypoint.t * ('a typed_contract option, 'S, 'r, 'F) kinstr -> (address, 'S, 'r, 'F) kinstr
  109. | IView : Alpha_context.Script.location * ('a, 'b) view_signature * ('c, 'S) stack_ty option * ('b option, 'c * 'S, 'r, 'F) kinstr -> ('a, address * ('c * 'S), 'r, 'F) kinstr
  110. | ITransfer_tokens : Alpha_context.Script.location * (operation, 'S, 'r, 'F) kinstr -> ('a, Alpha_context.Tez.t * ('a typed_contract * 'S), 'r, 'F) kinstr
  111. | IImplicit_account : Alpha_context.Script.location * (unit typed_contract, 'S, 'r, 'F) kinstr -> (Alpha_context.public_key_hash, 'S, 'r, 'F) kinstr
  112. | ICreate_contract : {
    1. loc : Alpha_context.Script.location;
    2. storage_type : ('a, _) ty;
    3. code : Alpha_context.Script.expr;
    4. k : (operation, address * ('c * 'S), 'r, 'F) kinstr;
    } -> (Alpha_context.public_key_hash option, Alpha_context.Tez.t * ('a * ('c * 'S)), 'r, 'F) kinstr
  113. | ISet_delegate : Alpha_context.Script.location * (operation, 'S, 'r, 'F) kinstr -> (Alpha_context.public_key_hash option, 'S, 'r, 'F) kinstr
  114. | INow : Alpha_context.Script.location * (Script_timestamp.t, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  115. | IMin_block_time : Alpha_context.Script.location * (Script_int.n Script_int.num, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  116. | IBalance : Alpha_context.Script.location * (Alpha_context.Tez.t, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  117. | ILevel : Alpha_context.Script.location * (Script_int.n Script_int.num, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  118. | ICheck_signature : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> (Alpha_context.public_key, signature * (bytes * 'S), 'r, 'F) kinstr
  119. | IHash_key : Alpha_context.Script.location * (Alpha_context.public_key_hash, 'S, 'r, 'F) kinstr -> (Alpha_context.public_key, 'S, 'r, 'F) kinstr
  120. | IPack : Alpha_context.Script.location * ('a, _) ty * (bytes, 'b * 'S, 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  121. | IUnpack : Alpha_context.Script.location * ('a, _) ty * ('a option, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  122. | IBlake2b : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  123. | ISha256 : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  124. | ISha512 : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  125. | ISource : Alpha_context.Script.location * (address, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  126. | ISender : Alpha_context.Script.location * (address, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  127. | ISelf : Alpha_context.Script.location * ('b, _) ty * Alpha_context.Entrypoint.t * ('b typed_contract, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  128. | ISelf_address : Alpha_context.Script.location * (address, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  129. | IAmount : Alpha_context.Script.location * (Alpha_context.Tez.t, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  130. | ISapling_empty_state : Alpha_context.Script.location * Alpha_context.Sapling.Memo_size.t * (Alpha_context.Sapling.state, 'a * 'S, 'b, 'F) kinstr -> ('a, 'S, 'b, 'F) kinstr
  131. | ISapling_verify_update : Alpha_context.Script.location * ((bytes, (Script_int.z Script_int.num, Alpha_context.Sapling.state) pair) pair option, 'S, 'r, 'F) kinstr -> (Alpha_context.Sapling.transaction, Alpha_context.Sapling.state * 'S, 'r, 'F) kinstr
  132. | ISapling_verify_update_deprecated : Alpha_context.Script.location * ((Script_int.z Script_int.num, Alpha_context.Sapling.state) pair option, 'S, 'r, 'F) kinstr -> (Alpha_context.Sapling.Legacy.transaction, Alpha_context.Sapling.state * 'S, 'r, 'F) kinstr
  133. | IDig : Alpha_context.Script.location * int * ('b, 'c * 'T, 'c, 'T, 'a, 'S, 'd, 'U) stack_prefix_preservation_witness * ('b, 'd * 'U, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  134. | IDug : Alpha_context.Script.location * int * ('c, 'T, 'a, 'c * 'T, 'b, 'S, 'd, 'U) stack_prefix_preservation_witness * ('d, 'U, 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  135. | IDipn : Alpha_context.Script.location * int * ('c, 'T, 'd, 'V, 'a, 'S, 'b, 'U) stack_prefix_preservation_witness * ('c, 'T, 'd, 'V) kinstr * ('b, 'U, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  136. | IDropn : Alpha_context.Script.location * int * ('b, 'U, 'b, 'U, 'a, 'S, 'a, 'S) stack_prefix_preservation_witness * ('b, 'U, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  137. | IChainId : Alpha_context.Script.location * (Script_chain_id.t, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  138. | INever : Alpha_context.Script.location -> (never, 'S, 'r, 'F) kinstr
  139. | IVoting_power : Alpha_context.Script.location * (Script_int.n Script_int.num, 'S, 'r, 'F) kinstr -> (Alpha_context.public_key_hash, 'S, 'r, 'F) kinstr
  140. | ITotal_voting_power : Alpha_context.Script.location * (Script_int.n Script_int.num, 'a * 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
  141. | IKeccak : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  142. | ISha3 : Alpha_context.Script.location * (bytes, 'S, 'r, 'F) kinstr -> (bytes, 'S, 'r, 'F) kinstr
  143. | IAdd_bls12_381_g1 : Alpha_context.Script.location * (Script_bls.G1.t, 'S, 'r, 'F) kinstr -> (Script_bls.G1.t, Script_bls.G1.t * 'S, 'r, 'F) kinstr
  144. | IAdd_bls12_381_g2 : Alpha_context.Script.location * (Script_bls.G2.t, 'S, 'r, 'F) kinstr -> (Script_bls.G2.t, Script_bls.G2.t * 'S, 'r, 'F) kinstr
  145. | IAdd_bls12_381_fr : Alpha_context.Script.location * (Script_bls.Fr.t, 'S, 'r, 'F) kinstr -> (Script_bls.Fr.t, Script_bls.Fr.t * 'S, 'r, 'F) kinstr
  146. | IMul_bls12_381_g1 : Alpha_context.Script.location * (Script_bls.G1.t, 'S, 'r, 'F) kinstr -> (Script_bls.G1.t, Script_bls.Fr.t * 'S, 'r, 'F) kinstr
  147. | IMul_bls12_381_g2 : Alpha_context.Script.location * (Script_bls.G2.t, 'S, 'r, 'F) kinstr -> (Script_bls.G2.t, Script_bls.Fr.t * 'S, 'r, 'F) kinstr
  148. | IMul_bls12_381_fr : Alpha_context.Script.location * (Script_bls.Fr.t, 'S, 'r, 'F) kinstr -> (Script_bls.Fr.t, Script_bls.Fr.t * 'S, 'r, 'F) kinstr
  149. | IMul_bls12_381_z_fr : Alpha_context.Script.location * (Script_bls.Fr.t, 'S, 'r, 'F) kinstr -> (Script_bls.Fr.t, 'a Script_int.num * 'S, 'r, 'F) kinstr
  150. | IMul_bls12_381_fr_z : Alpha_context.Script.location * (Script_bls.Fr.t, 'S, 'r, 'F) kinstr -> ('a Script_int.num, Script_bls.Fr.t * 'S, 'r, 'F) kinstr
  151. | IInt_bls12_381_fr : Alpha_context.Script.location * (Script_int.z Script_int.num, 'S, 'r, 'F) kinstr -> (Script_bls.Fr.t, 'S, 'r, 'F) kinstr
  152. | INeg_bls12_381_g1 : Alpha_context.Script.location * (Script_bls.G1.t, 'S, 'r, 'F) kinstr -> (Script_bls.G1.t, 'S, 'r, 'F) kinstr
  153. | INeg_bls12_381_g2 : Alpha_context.Script.location * (Script_bls.G2.t, 'S, 'r, 'F) kinstr -> (Script_bls.G2.t, 'S, 'r, 'F) kinstr
  154. | INeg_bls12_381_fr : Alpha_context.Script.location * (Script_bls.Fr.t, 'S, 'r, 'F) kinstr -> (Script_bls.Fr.t, 'S, 'r, 'F) kinstr
  155. | IPairing_check_bls12_381 : Alpha_context.Script.location * (bool, 'S, 'r, 'F) kinstr -> ((Script_bls.G1.t, Script_bls.G2.t) pair Script_list.t, 'S, 'r, 'F) kinstr
  156. | IComb : Alpha_context.Script.location * int * ('a, 'b, 'S, 'c, 'd, 'T) comb_gadt_witness * ('c, 'd * 'T, 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  157. | IUncomb : Alpha_context.Script.location * int * ('a, 'b, 'S, 'c, 'd, 'T) uncomb_gadt_witness * ('c, 'd * 'T, 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  158. | IComb_get : Alpha_context.Script.location * int * ('t, 'v) comb_get_gadt_witness * ('v, 'a * 'S, 'r, 'F) kinstr -> ('t, 'a * 'S, 'r, 'F) kinstr
  159. | IComb_set : Alpha_context.Script.location * int * ('a, 'b, 'c) comb_set_gadt_witness * ('c, 'd * 'S, 'r, 'F) kinstr -> ('a, 'b * ('d * 'S), 'r, 'F) kinstr
  160. | IDup_n : Alpha_context.Script.location * int * ('a, 'b, 'S, 't) dup_n_gadt_witness * ('t, 'a * ('b * 'S), 'r, 'F) kinstr -> ('a, 'b * 'S, 'r, 'F) kinstr
  161. | ITicket : Alpha_context.Script.location * 'a comparable_ty option * ('a ticket option, 'S, 'r, 'F) kinstr -> ('a, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  162. | ITicket_deprecated : Alpha_context.Script.location * 'a comparable_ty option * ('a ticket, 'S, 'r, 'F) kinstr -> ('a, Script_int.n Script_int.num * 'S, 'r, 'F) kinstr
  163. | IRead_ticket : Alpha_context.Script.location * 'a comparable_ty option * ((address, ('a, Script_int.n Script_int.num) pair) pair, 'a ticket * 'S, 'r, 'F) kinstr -> ('a ticket, 'S, 'r, 'F) kinstr
  164. | ISplit_ticket : Alpha_context.Script.location * (('a ticket, 'a ticket) pair option, 'S, 'r, 'F) kinstr -> ('a ticket, (Script_int.n Script_int.num, Script_int.n Script_int.num) pair * 'S, 'r, 'F) kinstr
  165. | IJoin_tickets : Alpha_context.Script.location * 'a comparable_ty * ('a ticket option, 'S, 'r, 'F) kinstr -> (('a ticket, 'a ticket) pair, 'S, 'r, 'F) kinstr
  166. | IOpen_chest : Alpha_context.Script.location * (bytes option, 'S, 'r, 'F) kinstr -> (Script_timelock.chest_key, Script_timelock.chest * (Script_int.n Script_int.num * 'S), 'r, 'F) kinstr
  167. | IEmit : {
    1. loc : Alpha_context.Script.location;
    2. tag : Alpha_context.Entrypoint.t;
    3. ty : ('a, _) ty;
    4. unparsed_ty : Alpha_context.Script.expr;
    5. k : (operation, 'S, 'r, 'F) kinstr;
    } -> ('a, 'S, 'r, 'F) kinstr
  168. | IHalt : Alpha_context.Script.location -> ('a, 'S, 'a, 'S) kinstr
  169. | ILog : Alpha_context.Script.location * ('a, 'S) stack_ty * logging_event * logger * ('a, 'S, 'r, 'F) kinstr -> ('a, 'S, 'r, 'F) kinstr
and ('arg, 'ret) lambda =
  1. | Lam : ('arg, end_of_stack, 'ret, end_of_stack) kdescr * Alpha_context.Script.node -> ('arg, 'ret) lambda
  2. | LamRec : ('arg, ('arg, 'ret) lambda * end_of_stack, 'ret, end_of_stack) kdescr * Alpha_context.Script.node -> ('arg, 'ret) lambda
and 'arg typed_contract =
  1. | Typed_implicit : Alpha_context.public_key_hash -> unit typed_contract
  2. | Typed_implicit_with_ticket : {
    1. ticket_ty : ('arg ticket, _) ty;
    2. destination : Alpha_context.public_key_hash;
    } -> 'arg ticket typed_contract
  3. | Typed_originated : {
    1. arg_ty : ('arg, _) ty;
    2. contract_hash : Contract_hash.t;
    3. entrypoint : Alpha_context.Entrypoint.t;
    } -> 'arg typed_contract
  4. | Typed_sc_rollup : {
    1. arg_ty : ('arg, _) ty;
    2. sc_rollup : Alpha_context.Sc_rollup.t;
    3. entrypoint : Alpha_context.Entrypoint.t;
    } -> 'arg typed_contract
  5. | Typed_zk_rollup : {
    1. arg_ty : (('a ticket, bytes) pair, _) ty;
    2. zk_rollup : Alpha_context.Zk_rollup.t;
    } -> ('a ticket, bytes) pair typed_contract
and (_, _, _, _) continuation =
  1. | KNil : ('r, 'F, 'r, 'F) continuation
  2. | KCons : ('a, 'S, 'b, 'T) kinstr * ('b, 'T, 'r, 'F) continuation -> ('a, 'S, 'r, 'F) continuation
  3. | KReturn : 'S * ('a, 'S) stack_ty option * ('a, 'S, 'r, 'F) continuation -> ('a, end_of_stack, 'r, 'F) continuation
  4. | KMap_head : ('a -> 'b) * ('b, 'S, 'r, 'F) continuation -> ('a, 'S, 'r, 'F) continuation
  5. | KUndip : 'b * ('b, _) ty option * ('b, 'a * 'S, 'r, 'F) continuation -> ('a, 'S, 'r, 'F) continuation
  6. | KLoop_in : ('a, 'S, bool, 'a * 'S) kinstr * ('a, 'S, 'r, 'F) continuation -> (bool, 'a * 'S, 'r, 'F) continuation
  7. | KLoop_in_left : ('a, 'S, ('a, 'b) or_, 'S) kinstr * ('b, 'S, 'r, 'F) continuation -> (('a, 'b) or_, 'S, 'r, 'F) continuation
  8. | KIter : ('a, 'b * 'S, 'b, 'S) kinstr * ('a, _) ty option * 'a list * ('b, 'S, 'r, 'F) continuation -> ('b, 'S, 'r, 'F) continuation
  9. | KList_enter_body : ('a, 'c * 'S, 'b, 'c * 'S) kinstr * 'a list * 'b Script_list.t * ('b Script_list.t, _) ty option * int * ('b Script_list.t, 'c * 'S, 'r, 'F) continuation -> ('c, 'S, 'r, 'F) continuation
  10. | KList_exit_body : ('a, 'c * 'S, 'b, 'c * 'S) kinstr * 'a list * 'b Script_list.t * ('b Script_list.t, _) ty option * int * ('b Script_list.t, 'c * 'S, 'r, 'F) continuation -> ('b, 'c * 'S, 'r, 'F) continuation
  11. | KMap_enter_body : (('a, 'b) pair, 'd * 'S, 'c, 'd * 'S) kinstr * ('a * 'b) list * ('a, 'c) map * (('a, 'c) map, _) ty option * (('a, 'c) map, 'd * 'S, 'r, 'F) continuation -> ('d, 'S, 'r, 'F) continuation
  12. | KMap_exit_body : (('a, 'b) pair, 'd * 'S, 'c, 'd * 'S) kinstr * ('a * 'b) list * ('a, 'c) map * 'a * (('a, 'c) map, _) ty option * (('a, 'c) map, 'd * 'S, 'r, 'F) continuation -> ('c, 'd * 'S, 'r, 'F) continuation
  13. | KView_exit : step_constants * ('a, 'S, 'r, 'F) continuation -> ('a, 'S, 'r, 'F) continuation
  14. | KLog : ('a, 'S, 'r, 'F) continuation * ('a, 'S) stack_ty * logger -> ('a, 'S, 'r, 'F) continuation
and ('a, 'S, 'b, 'F, 'c, 'U) logging_function = ('a, 'S, 'b, 'F) kinstr -> Alpha_context.context -> Alpha_context.Script.location -> ('c, 'U) stack_ty -> ('c * 'U) -> unit
and logger = {
  1. log_interp : 'a 'S 'b 'F 'c 'U. ('a, 'S, 'b, 'F, 'c, 'U) logging_function;
    (*

    log_interp is called at each call of the internal function interp. interp is called when starting the interpretation of a script and subsequently at each Exec instruction.

    *)
  2. get_log : unit -> execution_trace option Tezos_protocol_environment_alpha.Error_monad.tzresult Tezos_protocol_environment_alpha.Lwt.t;
    (*

    get_log allows to obtain an execution trace, if any was produced.

    *)
  3. klog : 'a 'S 'r 'F. ('a, 'S, 'r, 'F) klog;
    (*

    klog is called on KLog inserted when instrumenting continuations.

    *)
  4. ilog : 'a 'S 'b 'T 'r 'F. ('a, 'S, 'b, 'T, 'r, 'F) ilog;
    (*

    ilog is called on ILog inserted when instrumenting instructions.

    *)
  5. log_kinstr : 'a 'b 'c 'd. ('a, 'b, 'c, 'd) log_kinstr;
    (*

    log_kinstr instruments an instruction with ILog.

    *)
}
and ('a, 'S, 'b, 'T, 'r, 'F) ilog = logger -> logging_event -> ('a, 'S) stack_ty -> ('a, 'S, 'b, 'T, 'r, 'F) step_type
and ('a, 'b, 'c, 'd) log_kinstr = logger -> ('a, 'b) stack_ty -> ('a, 'b, 'c, 'd) kinstr -> ('a, 'b, 'c, 'd) kinstr
and ('ty, 'comparable) ty =
  1. | Unit_t : (unit, Dependent_bool.yes) ty
  2. | Int_t : (Script_int.z Script_int.num, Dependent_bool.yes) ty
  3. | Nat_t : (Script_int.n Script_int.num, Dependent_bool.yes) ty
  4. | Signature_t : (signature, Dependent_bool.yes) ty
  5. | String_t : (Script_string.t, Dependent_bool.yes) ty
  6. | Bytes_t : (bytes, Dependent_bool.yes) ty
  7. | Mutez_t : (Alpha_context.Tez.t, Dependent_bool.yes) ty
  8. | Key_hash_t : (Alpha_context.public_key_hash, Dependent_bool.yes) ty
  9. | Key_t : (Alpha_context.public_key, Dependent_bool.yes) ty
  10. | Timestamp_t : (Script_timestamp.t, Dependent_bool.yes) ty
  11. | Address_t : (address, Dependent_bool.yes) ty
  12. | Bool_t : (bool, Dependent_bool.yes) ty
  13. | Pair_t : ('a, 'ac) ty * ('b, 'bc) ty * ('a, 'b) pair ty_metadata * ('ac, 'bc, 'rc) Dependent_bool.dand -> (('a, 'b) pair, 'rc) ty
  14. | Or_t : ('a, 'ac) ty * ('b, 'bc) ty * ('a, 'b) or_ ty_metadata * ('ac, 'bc, 'rc) Dependent_bool.dand -> (('a, 'b) or_, 'rc) ty
  15. | Lambda_t : ('arg, _) ty * ('ret, _) ty * ('arg, 'ret) lambda ty_metadata -> (('arg, 'ret) lambda, Dependent_bool.no) ty
  16. | Option_t : ('v, 'c) ty * 'v option ty_metadata * 'c Dependent_bool.dbool -> ('v option, 'c) ty
  17. | List_t : ('v, _) ty * 'v Script_list.t ty_metadata -> ('v Script_list.t, Dependent_bool.no) ty
  18. | Set_t : 'v comparable_ty * 'v set ty_metadata -> ('v set, Dependent_bool.no) ty
  19. | Map_t : 'k comparable_ty * ('v, _) ty * ('k, 'v) map ty_metadata -> (('k, 'v) map, Dependent_bool.no) ty
  20. | Big_map_t : 'k comparable_ty * ('v, _) ty * ('k, 'v) big_map ty_metadata -> (('k, 'v) big_map, Dependent_bool.no) ty
  21. | Contract_t : ('arg, _) ty * 'arg typed_contract ty_metadata -> ('arg typed_contract, Dependent_bool.no) ty
  22. | Sapling_transaction_t : Alpha_context.Sapling.Memo_size.t -> (Alpha_context.Sapling.transaction, Dependent_bool.no) ty
  23. | Sapling_transaction_deprecated_t : Alpha_context.Sapling.Memo_size.t -> (Alpha_context.Sapling.Legacy.transaction, Dependent_bool.no) ty
  24. | Sapling_state_t : Alpha_context.Sapling.Memo_size.t -> (Alpha_context.Sapling.state, Dependent_bool.no) ty
  25. | Operation_t : (operation, Dependent_bool.no) ty
  26. | Chain_id_t : (Script_chain_id.t, Dependent_bool.yes) ty
  27. | Never_t : (never, Dependent_bool.yes) ty
  28. | Bls12_381_g1_t : (Script_bls.G1.t, Dependent_bool.no) ty
  29. | Bls12_381_g2_t : (Script_bls.G2.t, Dependent_bool.no) ty
  30. | Bls12_381_fr_t : (Script_bls.Fr.t, Dependent_bool.no) ty
  31. | Ticket_t : 'a comparable_ty * 'a ticket ty_metadata -> ('a ticket, Dependent_bool.no) ty
  32. | Chest_key_t : (Script_timelock.chest_key, Dependent_bool.no) ty
  33. | Chest_t : (Script_timelock.chest, Dependent_bool.no) ty
and 'ty comparable_ty = ('ty, Dependent_bool.yes) ty
and ('top_ty, 'resty) stack_ty =
  1. | Item_t : ('ty, _) ty * ('ty2, 'rest) stack_ty -> ('ty, 'ty2 * 'rest) stack_ty
  2. | Bot_t : (empty_cell, empty_cell) stack_ty
and ('key, 'value) big_map =
  1. | Big_map : {
    1. id : Alpha_context.Big_map.Id.t option;
    2. diff : ('key, 'value) big_map_overlay;
    3. key_type : 'key comparable_ty;
    4. value_type : ('value, _) ty;
    } -> ('key, 'value) big_map
and ('a, 'S, 'r, 'F) kdescr = {
  1. kloc : Alpha_context.Script.location;
  2. kbef : ('a, 'S) stack_ty;
  3. kaft : ('r, 'F) stack_ty;
  4. kinstr : ('a, 'S, 'r, 'F) kinstr;
}
and (_, _, _, _, _, _, _, _) stack_prefix_preservation_witness =
  1. | KPrefix : Alpha_context.Script.location * ('a, _) ty * ('c, 'V, 'd, 'W, 'x, 'S, 'y, 'U) stack_prefix_preservation_witness -> ('c, 'V, 'd, 'W, 'a, 'x * 'S, 'a, 'y * 'U) stack_prefix_preservation_witness
  2. | KRest : ('a, 'S, 'b, 'U, 'a, 'S, 'b, 'U) stack_prefix_preservation_witness
and (_, _, _, _, _, _) comb_gadt_witness =
  1. | Comb_one : ('a, 'x, 'before, 'a, 'x, 'before) comb_gadt_witness
  2. | Comb_succ : ('b, 'c, 'S, 'd, 'e, 'T) comb_gadt_witness -> ('a, 'b, 'c * 'S, 'a * 'd, 'e, 'T) comb_gadt_witness
and (_, _, _, _, _, _) uncomb_gadt_witness =
  1. | Uncomb_one : ('a, 'x, 'before, 'a, 'x, 'before) uncomb_gadt_witness
  2. | Uncomb_succ : ('b, 'c, 'S, 'd, 'e, 'T) uncomb_gadt_witness -> (('a, 'b) pair, 'c, 'S, 'a, 'd, 'e * 'T) uncomb_gadt_witness
and ('before, 'after) comb_get_gadt_witness =
  1. | Comb_get_zero : ('b, 'b) comb_get_gadt_witness
  2. | Comb_get_one : (('a, 'b) pair, 'a) comb_get_gadt_witness
  3. | Comb_get_plus_two : ('before, 'after) comb_get_gadt_witness -> (('a, 'before) pair, 'after) comb_get_gadt_witness
and ('value, 'before, 'after) comb_set_gadt_witness =
  1. | Comb_set_zero : ('value, _, 'value) comb_set_gadt_witness
  2. | Comb_set_one : ('value, ('hd, 'tl) pair, ('value, 'tl) pair) comb_set_gadt_witness
  3. | Comb_set_plus_two : ('value, 'before, 'after) comb_set_gadt_witness -> ('value, ('a, 'before) pair, ('a, 'after) pair) comb_set_gadt_witness
and (_, _, _, _) dup_n_gadt_witness =
  1. | Dup_n_zero : ('a, _, _, 'a) dup_n_gadt_witness
  2. | Dup_n_succ : ('b, 'c, 'stack, 'd) dup_n_gadt_witness -> ('a, 'b, 'c * 'stack, 'd) dup_n_gadt_witness
and ('input, 'output) view_signature =
  1. | View_signature : {
    1. name : Script_string.t;
    2. input_ty : ('input, _) ty;
    3. output_ty : ('output, _) ty;
    } -> ('input, 'output) view_signature
and 'kind internal_operation_contents =
  1. | Transaction_to_implicit : {
    1. destination : Tezos_protocol_environment_alpha.Signature.Public_key_hash.t;
    2. amount : Alpha_context.Tez.t;
    } -> Alpha_context.Kind.transaction internal_operation_contents
  2. | Transaction_to_implicit_with_ticket : {
    1. destination : Tezos_protocol_environment_alpha.Signature.Public_key_hash.t;
    2. ticket_ty : ('content ticket, _) ty;
    3. ticket : 'content ticket;
    4. unparsed_ticket : Alpha_context.Script.lazy_expr;
    5. amount : Alpha_context.Tez.t;
    } -> Alpha_context.Kind.transaction internal_operation_contents
  3. | Transaction_to_smart_contract : {
    1. destination : Contract_hash.t;
    2. amount : Alpha_context.Tez.t;
    3. entrypoint : Alpha_context.Entrypoint.t;
    4. location : Alpha_context.Script.location;
    5. parameters_ty : ('a, _) ty;
    6. parameters : 'a;
    7. unparsed_parameters : Alpha_context.Script.expr;
    } -> Alpha_context.Kind.transaction internal_operation_contents
  4. | Transaction_to_sc_rollup : {
    1. destination : Alpha_context.Sc_rollup.t;
    2. entrypoint : Alpha_context.Entrypoint.t;
    3. parameters_ty : ('a, _) ty;
    4. parameters : 'a;
    5. unparsed_parameters : Alpha_context.Script.expr;
    } -> Alpha_context.Kind.transaction internal_operation_contents
  5. | Event : {
    1. ty : Alpha_context.Script.expr;
    2. tag : Alpha_context.Entrypoint.t;
    3. unparsed_data : Alpha_context.Script.expr;
    } -> Alpha_context.Kind.event internal_operation_contents
  6. | Transaction_to_zk_rollup : {
    1. destination : Alpha_context.Zk_rollup.t;
    2. parameters_ty : (('a ticket, bytes) pair, _) ty;
    3. parameters : ('a ticket, bytes) pair;
    4. unparsed_parameters : Alpha_context.Script.expr;
    } -> Alpha_context.Kind.transaction internal_operation_contents
  7. | Origination : {
    1. delegate : Tezos_protocol_environment_alpha.Signature.Public_key_hash.t option;
    2. code : Alpha_context.Script.expr;
    3. unparsed_storage : Alpha_context.Script.expr;
    4. credit : Alpha_context.Tez.t;
    5. preorigination : Contract_hash.t;
    6. storage_type : ('storage, _) ty;
    7. storage : 'storage;
    } -> Alpha_context.Kind.origination internal_operation_contents
  8. | Delegation : Tezos_protocol_environment_alpha.Signature.Public_key_hash.t option -> Alpha_context.Kind.delegation internal_operation_contents
and 'kind internal_operation = {
  1. sender : Alpha_context.Destination.t;
  2. operation : 'kind internal_operation_contents;
  3. nonce : int;
}
and packed_internal_operation =
  1. | Internal_operation : 'kind internal_operation -> packed_internal_operation
and operation = {
  1. piop : packed_internal_operation;
  2. lazy_storage_diff : Alpha_context.Lazy_storage.diffs option;
}
type ('arg, 'storage) script =
  1. | Script : {
    1. code : (('arg, 'storage) pair, (operation Script_list.t, 'storage) pair) lambda;
    2. arg_type : ('arg, _) ty;
    3. storage : 'storage;
    4. storage_type : ('storage, _) ty;
    5. views : view_map;
    6. entrypoints : 'arg entrypoints;
    7. code_size : Cache_memory_helpers.sint;
    } -> ('arg, 'storage) script
type ex_ty =
  1. | Ex_ty : ('a, _) ty -> ex_ty
val kinstr_location : (_, _, _, _) kinstr -> Alpha_context.Script.location
val ty_size : ('a, _) ty -> 'a Type_size.t
val is_comparable : ('v, 'c) ty -> 'c Dependent_bool.dbool
type 'v ty_ex_c =
  1. | Ty_ex_c : ('v, _) ty -> 'v ty_ex_c
val unit_t : unit comparable_ty
val signature_t : signature comparable_ty
val address_t : address comparable_ty
val bool_t : bool comparable_ty
val pair_3_t : Alpha_context.Script.location -> ('a, _) ty -> ('b, _) ty -> ('c, _) ty -> ('a, ('b, 'c) pair) pair ty_ex_c Tezos_protocol_environment_alpha.Error_monad.tzresult
val option_mutez_t : Alpha_context.Tez.t option comparable_ty
val option_string_t : Script_string.t option comparable_ty
val option_nat_t : Script_int.n Script_int.num option comparable_ty
val option_pair_nat_mutez_t : (Script_int.n Script_int.num, Alpha_context.Tez.t) pair option comparable_ty
val option_pair_mutez_mutez_t : (Alpha_context.Tez.t, Alpha_context.Tez.t) pair option comparable_ty
val list_operation_t : (operation Script_list.t, Dependent_bool.no) ty
val contract_unit_t : (unit typed_contract, Dependent_bool.no) ty
val operation_t : (operation, Dependent_bool.no) ty
val never_t : never comparable_ty
val bls12_381_g1_t : (Script_bls.G1.t, Dependent_bool.no) ty
val bls12_381_g2_t : (Script_bls.G2.t, Dependent_bool.no) ty
val bls12_381_fr_t : (Script_bls.Fr.t, Dependent_bool.no) ty
type 'a kinstr_traverse = {
  1. apply : 'b 'S 'r 'F. 'a -> ('b, 'S, 'r, 'F) kinstr -> 'a;
}

The following functions named `X_traverse` for X in { kinstr, ty, stack_ty, value } provide tail recursive top down traversals over the values of these types.

The traversal goes through a value and rewrites an accumulator along the way starting from some initial value for the accumulator.

All these traversals follow the same recursion scheme: the user-provided function is first called on the toplevel value, then the traversal recurses on the direct subvalues of the same type.

Hence, the user-provided function must only compute the contribution of the value on the accumulator minus the contribution of its subvalues of the same type.

val kinstr_traverse : ('a, 'S, 'c, 'F) kinstr -> 'ret -> 'ret kinstr_traverse -> 'ret
type 'a ty_traverse = {
  1. apply : 't 'tc. 'a -> ('t, 'tc) ty -> 'a;
}
val ty_traverse : ('a, _) ty -> 'r -> 'r ty_traverse -> 'r
type 'accu stack_ty_traverse = {
  1. apply : 'ty 'S. 'accu -> ('ty, 'S) stack_ty -> 'accu;
}
val stack_ty_traverse : ('a, 'S) stack_ty -> 'r -> 'r stack_ty_traverse -> 'r
type 'a value_traverse = {
  1. apply : 't 'tc. 'a -> ('t, 'tc) ty -> 't -> 'a;
}
val value_traverse : ('t, _) ty -> 't -> 'r -> 'r value_traverse -> 'r
val stack_top_ty : ('a, 'b * 'S) stack_ty -> 'a ty_ex_c
module Typed_contract : sig ... end