Module Logtk_parsers.Tip_ast
Trivial AST for parsing
val pp_str : Stdlib.Format.formatter -> string -> unitval pp_to_string : (Stdlib.Format.formatter -> 'a -> 'b) -> 'a -> string
module Loc = Logtk.ParseLocationtype var= stringtype ty_var= stringtype ty=|Ty_bool|Ty_app of ty_var * ty list|Ty_arrow of ty list * tyPolymorphic types
type typed_var= var * tytype term=|True|False|Const of string|App of string * term list|HO_app of term * term|Match of term * match_branch list|If of term * term * term|Let of (var * term) list * term|Fun of typed_var * term|Eq of term * term|Imply of term * term|And of term list|Or of term list|Not of term|Distinct of term list|Cast of term * ty|Forall of (var * ty) list * term|Exists of (var * ty) list * termAST: S-expressions with locations
and match_branch=|Match_default of term|Match_case of string * var list * termtype cstor={cstor_name : string;cstor_args : (string * ty) list;}type 'arg fun_decl={fun_ty_vars : ty_var list;fun_name : string;fun_args : 'arg list;fun_ret : ty;}type fun_def={fr_decl : typed_var fun_decl;fr_body : term;}type funs_rec_def={fsr_decls : typed_var fun_decl list;fsr_bodies : term list;}type statement={stmt : stmt;loc : Loc.t option;}and stmt=|Stmt_decl_sort of string * int|Stmt_decl of ty fun_decl|Stmt_fun_def of fun_def|Stmt_fun_rec of fun_def|Stmt_funs_rec of funs_rec_def|Stmt_data of ty_var list * (string * cstor list) list|Stmt_assert of term|Stmt_lemma of term|Stmt_assert_not of ty_var list * term|Stmt_check_sat
val ty_bool : tyval ty_app : ty_var -> ty list -> tyval ty_const : ty_var -> tyval ty_arrow_l : ty list -> ty -> tyval ty_arrow : ty -> ty -> tyval true_ : termval false_ : termval const : string -> termval app : string -> term list -> termval ho_app : term -> term -> termval ho_app_l : term -> term list -> termval match_ : term -> match_branch list -> termval if_ : term -> term -> term -> termval fun_ : typed_var -> term -> termval fun_l : typed_var list -> term -> termval let_ : (var * term) list -> term -> termval eq : term -> term -> termval imply : term -> term -> termval and_ : term list -> termval or_ : term list -> termval distinct : term list -> termval cast : term -> ty:ty -> termval forall : (var * ty) list -> term -> termval exists : (var * ty) list -> term -> termval not_ : term -> termval _mk : ?loc:Loc.t -> stmt -> statementval mk_cstor : string -> (string * ty) list -> cstorval mk_fun_decl : ty_vars:ty_var list -> string -> 'a list -> ty -> 'a fun_declval mk_fun_rec : ty_vars:ty_var list -> string -> typed_var list -> ty -> term -> fun_defval decl_sort : ?loc:Loc.t -> string -> arity:int -> statementval decl_fun : ?loc:Loc.t -> tyvars:ty_var list -> string -> ty list -> ty -> statementval fun_def : ?loc:Loc.t -> fun_def -> statementval fun_rec : ?loc:Loc.t -> fun_def -> statementval funs_rec : ?loc:Loc.t -> typed_var fun_decl list -> term list -> statementval data : ?loc:Loc.t -> ty_var list -> (string * cstor list) list -> statementval assert_ : ?loc:Loc.t -> term -> statementval lemma : ?loc:Loc.t -> term -> statementval assert_not : ?loc:Loc.t -> ty_vars:ty_var list -> term -> statementval check_sat : ?loc:Loc.t -> unit -> statementval loc : statement -> Loc.t optionval view : statement -> stmtval fpf : Stdlib.Format.formatter -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'aval pp_list : ?start:string -> ?stop:string -> ?sep:string -> (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a list -> unitval pp_tyvar : Stdlib.Format.formatter -> string -> unitval pp_ty : Stdlib.Format.formatter -> ty -> unitval pp_term : Stdlib.Format.formatter -> term -> unitval pp_typed_var : Stdlib.Format.formatter -> typed_var -> unitval pp_par : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> (string list * 'a) -> unitval pp_fun_decl : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a fun_decl -> unitval pp_fr : Stdlib.Format.formatter -> fun_def -> unitval pp_stmt : Stdlib.Format.formatter -> statement -> unit
Errors
exceptionParse_error of Loc.t option * string