package archetype

  1. Overview
  2. Docs
val pp_ident : Format.formatter -> string -> unit
val pp_lident : Format.formatter -> string Location.loced -> unit
type container =
  1. | Collection
  2. | Subset
  3. | Partition
val show_container : container -> Ppx_deriving_runtime.string
type currency =
  1. | Tz
  2. | Mtz
val show_currency : currency -> Ppx_deriving_runtime.string
type vtyp =
  1. | VTbool
  2. | VTint
  3. | VTrational
  4. | VTdate
  5. | VTduration
  6. | VTstring
  7. | VTaddress
  8. | VTrole
  9. | VTcurrency
  10. | VTkey
type trtyp =
  1. | TRentry
  2. | TRaction
  3. | TRasset
  4. | TRfield
type ptyp =
  1. | Tasset of lident
  2. | Tenum of lident
  3. | Tcontract of lident
  4. | Tbuiltin of vtyp
  5. | Tcontainer of ptyp * container
  6. | Ttuple of ptyp list
  7. | Toption of ptyp
  8. | Tentry
  9. | Ttrace of trtyp
type type_ = ptyp
type logical_operator =
  1. | And
  2. | Or
  3. | Imply
  4. | Equiv
val show_logical_operator : logical_operator -> Ppx_deriving_runtime.string
type comparison_operator =
  1. | Equal
  2. | Nequal
  3. | Gt
  4. | Ge
  5. | Lt
  6. | Le
val show_comparison_operator : comparison_operator -> Ppx_deriving_runtime.string
type assignment_operator =
  1. | ValueAssign
  2. | PlusAssign
  3. | MinusAssign
  4. | MultAssign
  5. | DivAssign
  6. | AndAssign
  7. | OrAssign
val show_assignment_operator : assignment_operator -> Ppx_deriving_runtime.string
type arithmetic_operator =
  1. | Plus
  2. | Minus
  3. | Mult
  4. | Div
  5. | Modulo
val show_arithmetic_operator : arithmetic_operator -> Ppx_deriving_runtime.string
type unary_arithmetic_operator =
  1. | Uplus
  2. | Uminus
val show_unary_arithmetic_operator : unary_arithmetic_operator -> Ppx_deriving_runtime.string
type operator = [
  1. | `Logical of logical_operator
  2. | `Cmp of comparison_operator
  3. | `Arith of arithmetic_operator
  4. | `Unary of unary_arithmetic_operator
  5. | `Assign of assignment_operator
]
val show_operator : operator -> Ppx_deriving_runtime.string
type const =
  1. | Cstate
  2. | Cnow
  3. | Ctransferred
  4. | Ccaller
  5. | Cfail
  6. | Cbalance
  7. | Cconditions
  8. | Cactions
  9. | Cnone
  10. | Cany
  11. | Canyaction
  12. | Cisempty
  13. | Cget
  14. | Cadd
  15. | Caddnofail
  16. | Cremove
  17. | Cremovenofail
  18. | Cremoveif
  19. | Cupdate
  20. | Cupdatenofail
  21. | Cclear
  22. | Ccontains
  23. | Cnth
  24. | Creverse
  25. | Cselect
  26. | Csort
  27. | Ccount
  28. | Csum
  29. | Cmax
  30. | Cmin
  31. | Csubsetof
  32. | Chead
  33. | Ctail
  34. | Cbefore
  35. | Cunmoved
  36. | Cadded
  37. | Cremoved
  38. | Citerated
  39. | Ctoiterate
type 'node struct_poly = {
  1. node : 'node;
  2. type_ : ptyp option;
  3. label : Ident.ident option;
  4. loc : Location.t;
}
type 'id qualid_gen = 'id qualid_node struct_poly
and 'id qualid_node =
  1. | Qident of 'id
  2. | Qdot of 'id qualid_gen * 'id
type qualid = lident qualid_gen
val show_qualid : qualid -> Ppx_deriving_runtime.string
type 'id rexpr_gen = 'id rexpr_node struct_poly
and 'id rexpr_node =
  1. | Rany
  2. | Rqualid of 'id qualid_gen
  3. | Ror of 'id rexpr_gen * 'id rexpr_gen
  4. | Raddress of 'id
type rexpr = lident rexpr_gen
type 'id sexpr_gen = 'id sexpr_node struct_poly
and 'id sexpr_node =
  1. | Sref of 'id
  2. | Sor of 'id sexpr_gen * 'id sexpr_gen
  3. | Sany
type sexpr = lident sexpr_gen
type bval_gen = bval_node struct_poly
and bval_node =
  1. | BVint of Core.big_int
  2. | BVuint of Core.big_int
  3. | BVbool of bool
  4. | BVenum of string
  5. | BVrational of Core.big_int * Core.big_int
  6. | BVdate of string
  7. | BVstring of string
  8. | BVcurrency of currency * Core.big_int
  9. | BVaddress of string
  10. | BVduration of Core.duration
val show_bval_gen : bval_gen -> Ppx_deriving_runtime.string
val show_bval_node : bval_node -> Ppx_deriving_runtime.string
type bval = bval_gen
type 'id signature = {
  1. name : 'id;
  2. args : ptyp list;
  3. loc : Location.t;
}
type quantifier =
  1. | Forall
  2. | Exists
val show_quantifier : quantifier -> Ppx_deriving_runtime.string
type 'id pattern_gen = 'id pattern_node struct_poly
and 'id pattern_node =
  1. | Mwild
  2. | Mconst of 'id
type pattern = lident pattern_gen
val show_pattern : pattern -> Ppx_deriving_runtime.string
type 'id call_kind =
  1. | Cid of 'id
  2. | Cconst of const
type 'id term_node =
  1. | Pquantifer of quantifier * 'id * 'id term_gen option * type_ * 'id term_gen
  2. | Pif of 'id term_gen * 'id term_gen * 'id term_gen
  3. | Pmatchwith of 'id term_gen * ('id pattern_gen * 'id term_gen) list
  4. | Pcall of 'id term_gen option * 'id call_kind * 'id term_arg list
  5. | Plogical of logical_operator * 'id term_gen * 'id term_gen
  6. | Pnot of 'id term_gen
  7. | Pmulticomp of 'id term_gen * (comparison_operator * 'id term_gen) list
  8. | Pcomp of comparison_operator * 'id term_gen * 'id term_gen
  9. | Parith of arithmetic_operator * 'id term_gen * 'id term_gen
  10. | Puarith of unary_arithmetic_operator * 'id term_gen
  11. | Precord of 'id term_gen list
  12. | Pletin of 'id * 'id term_gen * ptyp option * 'id term_gen
  13. | Pvar of 'id
  14. | Parray of 'id term_gen list
  15. | Plit of bval
  16. | Pdot of 'id term_gen * 'id
  17. | Pconst of const
  18. | Ptuple of 'id term_gen list
and 'id term_arg =
  1. | AExpr of 'id term_gen
  2. | AFun of 'id * ptyp * 'id term_gen
  3. | AEffect of ('id * operator * 'id term_gen) list
and 'id term_poly = 'id term_node struct_poly
and 'id term_gen = 'id term_poly
type pterm = lident term_gen
type pterm_arg = lident term_arg
val show_pterm_arg : pterm_arg -> Ppx_deriving_runtime.string
type 'id instruction_poly = {
  1. node : 'id instruction_node;
  2. label : string option;
  3. subvars : Ident.ident list;
  4. loc : Location.t;
}
and 'id instruction_node =
  1. | Iif of 'id term_gen * 'id instruction_gen * 'id instruction_gen
  2. | Ifor of 'id * 'id term_gen * 'id instruction_gen
  3. | Iiter of 'id * 'id term_gen * 'id term_gen * 'id instruction_gen
  4. | Iletin of 'id * 'id term_gen * 'id instruction_gen
  5. | Iseq of 'id instruction_gen list
  6. | Imatchwith of 'id term_gen * ('id pattern_gen * 'id instruction_gen) list
  7. | Iassign of assignment_operator * 'id * 'id term_gen
  8. | Irequire of bool * 'id term_gen
  9. | Itransfer of 'id term_gen * bool * 'id qualid_gen option
  10. | Ibreak
  11. | Iassert of 'id term_gen
  12. | Icall of 'id term_gen option * 'id call_kind * 'id term_arg list
  13. | Ireturn of 'id term_gen
  14. | Ilabel of 'id
and 'id instruction_gen = 'id instruction_poly
and instruction = lident instruction_poly
val show_instruction : instruction -> Ppx_deriving_runtime.string
type 'id decl_gen = {
  1. name : 'id;
  2. typ : ptyp option;
  3. default : 'id term_gen option;
  4. loc : Location.t;
}
type 'id label_term = {
  1. label : 'id option;
  2. term : 'id term_gen;
  3. loc : Location.t;
}
type 'id variable = {
  1. decl : 'id decl_gen;
  2. constant : bool;
  3. from : 'id qualid_gen option;
  4. to_ : 'id qualid_gen option;
  5. loc : Location.t;
}
type 'id predicate = {
  1. name : 'id;
  2. args : ('id * type_) list;
  3. body : 'id term_gen;
  4. loc : Location.t;
}
type 'id definition = {
  1. name : 'id;
  2. typ : type_;
  3. var : 'id;
  4. body : 'id term_gen;
  5. loc : Location.t;
}
type 'id invariant = {
  1. label : 'id;
  2. formulas : 'id term_gen list;
}
type 'id postcondition = {
  1. name : 'id;
  2. formula : 'id term_gen;
  3. invariants : 'id invariant list;
}
type 'id assert_ = {
  1. name : 'id;
  2. label : 'id;
  3. formula : 'id term_gen;
  4. invariants : 'id invariant list;
}
type 'id specification = {
  1. predicates : 'id predicate list;
  2. definitions : 'id definition list;
  3. lemmas : 'id label_term list;
  4. theorems : 'id label_term list;
  5. variables : 'id variable list;
  6. invariants : ('id * 'id label_term list) list;
  7. effect : 'id term_gen option;
  8. specs : 'id postcondition list;
  9. asserts : 'id assert_ list;
  10. loc : Location.t;
}
type action_description =
  1. | ADAny
  2. | ADOp of string * lident
val show_action_description : action_description -> Ppx_deriving_runtime.string
type security_role = lident
val show_security_role : security_role -> Ppx_deriving_runtime.string
type security_action =
  1. | Sany
  2. | Sentry of lident list
val show_security_action : security_action -> Ppx_deriving_runtime.string
type security_node =
  1. | SonlyByRole of action_description * security_role list
  2. | SonlyInAction of action_description * security_action
  3. | SonlyByRoleInAction of action_description * security_role list * security_action
  4. | SnotByRole of action_description * security_role list
  5. | SnotInAction of action_description * security_action
  6. | SnotByRoleInAction of action_description * security_role list * security_action
  7. | StransferredBy of action_description
  8. | StransferredTo of action_description
  9. | SnoStorageFail of security_action
val show_security_node : security_node -> Ppx_deriving_runtime.string
type security_predicate = {
  1. s_node : security_node;
  2. loc : Location.t;
}
val show_security_predicate : security_predicate -> Ppx_deriving_runtime.string
type security_item = {
  1. label : lident;
  2. predicate : security_predicate;
  3. loc : Location.t;
}
val show_security_item : security_item -> Ppx_deriving_runtime.string
type security = {
  1. items : security_item list;
  2. loc : Location.t;
}
val show_security : security -> Ppx_deriving_runtime.string
type 'id function_struct = {
  1. name : 'id;
  2. args : 'id decl_gen list;
  3. body : 'id instruction_gen;
  4. specification : 'id specification option;
  5. return : ptyp;
  6. fvs : (Ident.ident * ptyp) list;
  7. loc : Location.t;
}
type function_ = lident function_struct
val show_function_ : function_ -> Ppx_deriving_runtime.string
type 'id transition = {
  1. from : 'id sexpr_gen;
  2. on : ('id * 'id) option;
  3. trs : ('id * 'id term_gen option * 'id instruction_gen option) list;
}
type 'id transaction_struct = {
  1. name : 'id;
  2. args : 'id decl_gen list;
  3. calledby : 'id rexpr_gen option;
  4. accept_transfer : bool;
  5. require : 'id label_term list option;
  6. failif : 'id label_term list option;
  7. transition : 'id transition option;
  8. specification : 'id specification option;
  9. functions : 'id function_struct list;
  10. effect : 'id instruction_gen option;
  11. loc : Location.t;
}
type transaction = lident transaction_struct
val show_transaction : transaction -> Ppx_deriving_runtime.string
type 'id enum_item_struct = {
  1. name : 'id;
  2. initial : bool;
  3. invariants : 'id label_term list;
  4. loc : Location.t;
}
type 'id enum_kind =
  1. | EKenum of 'id
  2. | EKstate
type 'id enum_struct = {
  1. kind : 'id enum_kind;
  2. items : 'id enum_item_struct list;
  3. loc : Location.t;
}
type enum = lident enum_struct
type 'id asset_struct = {
  1. name : 'id;
  2. fields : 'id decl_gen list;
  3. key : 'id option;
  4. sort : 'id list;
  5. state : 'id option;
  6. role : bool;
  7. init : 'id term_gen option;
  8. specs : 'id label_term list;
  9. loc : Location.t;
}
type asset = lident asset_struct
type 'id contract = {
  1. name : 'id;
  2. signatures : 'id signature list;
  3. init : 'id term_gen option;
  4. loc : Location.t;
}
type 'id model_struct = {
  1. name : 'id;
  2. variables : 'id variable list;
  3. assets : 'id asset_struct list;
  4. functions : 'id function_struct list;
  5. transactions : 'id transaction_struct list;
  6. enums : 'id enum_struct list;
  7. contracts : 'id contract list;
  8. specifications : 'id specification list;
  9. securities : security list;
  10. loc : Location.t;
}
and model = lident model_struct
val vtbool : ptyp
val vtint : ptyp
val vtrational : ptyp
val vtdate : ptyp
val vtduration : ptyp
val vtstring : ptyp
val vtaddress : ptyp
val vtrole : ptyp
val vtcurrency : ptyp
val vtkey : ptyp
val mk_sp : ?label:Ident.ident -> ?loc:Location.t -> ?type_:ptyp -> 'a -> 'b struct_poly
val mk_instr : ?label:string -> ?loc:Location.t -> ?subvars:Ident.ident list -> 'a instruction_node -> 'a instruction_poly
val mk_label_term : ?label:'a -> ?loc:Location.t -> 'b term_gen -> 'c label_term
val mk_variable : ?constant:bool -> ?from:'a qualid_gen -> ?to_:'b qualid_gen -> ?loc:Location.t -> 'c decl_gen -> 'c variable
val mk_predicate : ?args:('a * type_) list -> ?loc:Location.t -> 'b -> 'c term_gen -> 'd predicate
val mk_definition : ?loc:Location.t -> 'a -> type_ -> 'b -> 'c term_gen -> 'd definition
val mk_invariant : ?formulas:'a term_gen list -> 'b -> 'c invariant
val mk_postcondition : ?invariants:'a invariant list -> 'b -> 'c term_gen -> 'd postcondition
val mk_assert : ?invariants:'a invariant list -> 'b -> 'c -> 'd term_gen -> 'e assert_
val mk_specification : ?predicates:'a predicate list -> ?definitions:'b definition list -> ?lemmas:'c label_term list -> ?theorems:'d label_term list -> ?variables:'e variable list -> ?invariants:('f * 'f label_term list) list -> ?effect:'g term_gen -> ?specs:'h postcondition list -> ?asserts:'i assert_ list -> ?loc:Location.t -> unit -> 'a specification
val mk_function_struct : ?args:'a decl_gen list -> ?specification:'b specification -> ?fvs:(Ident.ident * ptyp) list -> ?loc:Location.t -> 'c -> 'd instruction_gen -> ptyp -> 'e function_struct
val mk_transition : ?on:('a * 'a) -> ?trs:('b * 'b term_gen option * 'b instruction_gen option) list -> 'c sexpr_gen -> 'c transition
val mk_transaction_struct : ?args:'a decl_gen list -> ?calledby:'b rexpr_gen -> ?accept_transfer:bool -> ?require:'c label_term list -> ?failif:'d label_term list -> ?transition:'e transition -> ?specification:'f specification -> ?functions:'g function_struct list -> ?effect:'h instruction_gen -> ?loc:Location.t -> 'i -> 'j transaction_struct
val mk_enum_item : ?initial:bool -> ?invariants:'id label_term list -> ?loc:Location.t -> 'id0 -> 'id1 enum_item_struct
val mk_enum : ?items:'a enum_item_struct list -> ?loc:Location.t -> 'b enum_kind -> 'b enum_struct
val mk_decl : ?typ:ptyp -> ?default:'a term_gen -> ?loc:Location.t -> 'b -> 'c decl_gen
val mk_asset : ?fields:'a decl_gen list -> ?key:'b -> ?sort:'c list -> ?state:'d -> ?role:bool -> ?init:'e term_gen -> ?specs:'f label_term list -> ?loc:Location.t -> 'g -> 'h asset_struct
val mk_contract : ?signatures:'a signature list -> ?init:'b term_gen -> ?loc:Location.t -> 'c -> 'd contract
val mk_model : ?variables:'a variable list -> ?assets:'b asset_struct list -> ?functions:'c function_struct list -> ?transactions:'d transaction_struct list -> ?enums:'e enum_struct list -> ?contracts:'f contract list -> ?specifications:'g specification list -> ?securities:security list -> ?loc:Location.t -> 'h -> 'i model_struct
val mk_id : ptyp -> lident -> qualid
val map_term_node : ('id term_gen -> 'id term_gen) -> 'id0 term_node -> 'id1 term_node
val map_instr_node : ('a instruction_gen -> 'b instruction_gen) -> 'a instruction_node -> 'b instruction_node
val map_gen_poly : ('a -> 'id -> 'id0) -> 'b -> 'id1 struct_poly -> 'id2 struct_poly
val map_gen : ('a -> 'b instruction_node -> 'c instruction_node) -> 'd -> 'e instruction_poly -> 'f instruction_poly
val map_term : ('a term_gen -> 'a term_gen) -> 'a term_node struct_poly -> 'a term_node struct_poly
val map_instr : ('a instruction_gen -> 'a instruction_gen) -> 'b instruction_poly -> 'c instruction_poly
val fold_term : ('a -> 'id term_gen -> 'a) -> 'a0 -> 'id0 term_gen -> 'a1
val fold_instr : ('a -> 'b instruction_gen -> 'a) -> 'c -> 'd instruction_poly -> 'e
val fold_instr_expr : ('a -> 'b instruction_gen as 'b instruction_gen -> 'a) -> ('c -> 'b term_gen -> 'd) -> 'e -> 'b instruction_gen -> 'f
val fold_map_term : ('id term_node -> 'term) -> ('a -> 'id0 term_gen -> 'id term_gen * 'a0) -> 'a1 -> 'id1 term_gen -> 'term0 * 'a2
val fold_map_instr_term : ('id instruction_node -> 'id0 instruction_gen) -> 'b -> ('a -> 'id1 instruction_gen -> 'id instruction_gen * 'a0) -> ('a1 -> 'id1 term_gen -> 'id term_gen * 'a2) -> 'a3 -> 'id2 instruction_poly -> 'id0 instruction_gen * 'a4
module Utils : sig ... end
OCaml

Innovation. Community. Security.