package gospel

  1. Overview
  2. Docs

Module Gospel.TtermSource

Sourcemodule Ident = Identifier.Ident
Sourcetype vsymbol = {
  1. vs_name : Ident.t;
  2. vs_ty : Ttypes.ty;
}
Sourceval create_vsymbol : Gospel__Identifier.Preid.t -> Ttypes.ty -> vsymbol
Sourcemodule Vs : sig ... end
Sourcemodule Svs : sig ... end
Sourcetype lsymbol = {
  1. ls_name : Ident.t;
  2. ls_args : Ttypes.ty list;
  3. ls_value : Ttypes.ty option;
  4. ls_constr : bool;
  5. ls_field : bool;
}
Sourceval ls_equal : lsymbol -> lsymbol -> bool
Sourcemodule LS : sig ... end
Sourcemodule Sls : sig ... end
Sourcemodule Mls : sig ... end
Sourceval lsymbol : ?constr:bool -> field:bool -> Ident.t -> Ttypes.ty list -> Ttypes.ty option -> lsymbol
Sourceval fsymbol : ?constr:bool -> field:bool -> Ident.t -> Ttypes.ty list -> Ttypes.ty -> lsymbol
Sourceval psymbol : Ident.t -> Ttypes.ty list -> lsymbol

buil-in lsymbols

Sourceval ps_equ : lsymbol
Sourceval fs_unit : lsymbol
Sourceval fs_bool_true : lsymbol
Sourceval fs_bool_false : lsymbol
Sourceval fs_apply : lsymbol
Sourceval fs_tuple_ids : (Ident.t, lsymbol) Hashtbl.t
Sourceval fs_tuple : int -> lsymbol
Sourceval is_fs_tuple : lsymbol -> bool

terms

Sourcetype pattern = {
  1. p_node : pattern_node;
  2. p_ty : Ttypes.ty;
  3. p_vars : Svs.t;
  4. p_loc : Ppxlib.Location.t;
}
Sourceand pattern_node =
  1. | Pwild
  2. | Pvar of vsymbol
  3. | Papp of lsymbol * pattern list
  4. | Por of pattern * pattern
  5. | Pas of pattern * vsymbol
Sourcetype binop =
  1. | Tand
  2. | Tand_asym
  3. | Tor
  4. | Tor_asym
  5. | Timplies
  6. | Tiff
Sourcetype quant =
  1. | Tforall
  2. | Texists
  3. | Tlambda
Sourcetype term = {
  1. t_node : term_node;
  2. t_ty : Ttypes.ty option;
  3. t_attrs : string list;
  4. t_loc : Ppxlib.Location.t;
}
Sourceand term_node =
  1. | Tvar of vsymbol
  2. | Tconst of Ppxlib.Parsetree.constant
  3. | Tapp of lsymbol * term list
  4. | Tfield of term * lsymbol
  5. | Tif of term * term * term
  6. | Tlet of vsymbol * term * term
  7. | Tcase of term * (pattern * term) list
  8. | Tquant of quant * vsymbol list * term
  9. | Tbinop of binop * term * term
  10. | Tnot of term
  11. | Told of term
  12. | Ttrue
  13. | Tfalse
Sourceval p_vars : pattern -> Svs.t
Sourceval t_free_vars : term -> Svs.t
Sourceexception FreeVariables of Svs.t
Sourceval t_free_vs_in_set : Svs.t -> term -> unit

type checking

Sourceexception TermExpected of term
Sourceexception FmlaExpected of term
Sourceval t_prop : term -> term
Sourceval t_type : term -> Ttypes.ty
Sourceval t_ty_check : term -> Ttypes.ty option -> unit
Sourceexception BadArity of lsymbol * int
Sourceexception PredicateSymbolExpected of lsymbol
Sourceexception FunctionSymbolExpected of lsymbol
Sourceval ls_arg_inst : lsymbol -> term list -> Ttypes.ty Ttypes.Mtv.t
Sourceval ls_app_inst : loc:Ppxlib.Location.t -> lsymbol -> term list -> Ttypes.ty option -> Ttypes.ty Ttypes.Mtv.t

Pattern constructors

Sourceexception PDuplicatedVar of vsymbol
Sourceexception EmptyCase

Terms constructors

Sourceval mk_term : term_node -> Ttypes.ty option -> Ppxlib.Location.t -> term
Sourceval t_const : Ppxlib.Parsetree.constant -> Ttypes.ty -> Ppxlib.Location.t -> term
Sourceval t_app : lsymbol -> term list -> Ttypes.ty option -> Ppxlib.Location.t -> term
Sourceval t_field : term -> lsymbol -> Ttypes.ty option -> Ppxlib.Location.t -> term
Sourceval t_if : term -> term -> term -> Ppxlib.Location.t -> term
Sourceval t_let : vsymbol -> term -> term -> Ppxlib.Location.t -> term
Sourceval t_case : term -> (pattern * term) list -> Ppxlib.Location.t -> term
Sourceval t_binop : binop -> term -> term -> Ppxlib.Location.t -> term
Sourceval t_false : Ppxlib.Location.t -> term
Sourceval t_attr_set : string list -> term -> term
Sourceval t_bool_true : Ppxlib.Location.t -> term
Sourceval t_bool_false : Ppxlib.Location.t -> term
Sourceval t_equ : term -> term -> Ppxlib.Location.t -> term
Sourceval f_binop : binop -> term -> term -> Ppxlib.Location.t -> term
Sourceval t_quant : quant -> vsymbol list -> term -> Ttypes.ty option -> Ppxlib.Location.t -> term
Sourceval f_forall : vsymbol list -> term -> Ttypes.ty option -> Ppxlib.Location.t -> term
Sourceval f_exists : vsymbol list -> term -> Ttypes.ty option -> Ppxlib.Location.t -> term
Sourceval t_lambda : vsymbol list -> term -> Ttypes.ty option -> Ppxlib.Location.t -> term
Sourceval f_and : term -> term -> Ppxlib.Location.t -> term
Sourceval f_and_asym : term -> term -> Ppxlib.Location.t -> term
Sourceval f_or_asym : term -> term -> Ppxlib.Location.t -> term
Sourceval f_implies : term -> term -> Ppxlib.Location.t -> term
Sourceval f_iff : term -> term -> Ppxlib.Location.t -> term

Pretty printing

Sourceval print_vs : Format.formatter -> vsymbol -> unit
Sourceval print_ls_decl : Format.formatter -> lsymbol -> unit
Sourceval print_ls_nm : Format.formatter -> lsymbol -> unit
Sourceval protect_on : bool -> ('a, 'b, 'c, 'd, 'e, 'f) format6 -> ('a, 'b, 'c, 'd, 'e, 'f) format6
Sourceval print_pat_node : int -> pattern Utils.Fmt.t
Sourceval print_pattern : pattern Utils.Fmt.t
Sourceval print_binop : Format.formatter -> binop -> unit
Sourceval print_quantifier : Format.formatter -> quant -> unit
Sourceval print_term : term Utils.Fmt.t

register exceptions

OCaml

Innovation. Community. Security.