CVC3

kinds.h

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*!
00003  * \file kinds.h
00004  *
00005  * Author: Clark Barrett
00006  *
00007  * Created: Mon Jan 20 13:38:52 2003
00008  *
00009  * <hr>
00010  *
00011  * License to use, copy, modify, sell and/or distribute this software
00012  * and its documentation for any purpose is hereby granted without
00013  * royalty, subject to the terms and conditions defined in the \ref
00014  * LICENSE file provided with this distribution.
00015  *
00016  * <hr>
00017  *
00018  */
00019 /*****************************************************************************/
00020 
00021 #ifndef _cvc3__include__kinds_h_
00022 #define _cvc3__include__kinds_h_
00023 
00024 #ifdef __cplusplus
00025 namespace CVC3 {
00026 #endif /* __cplusplus */
00027 
00028   // The commonly used kinds and the kinds needed by the parser.  All
00029   // these kinds are registered by the ExprManager and are readily
00030   // available for everyone else.
00031 typedef enum {
00032   NULL_KIND = 0,
00033 
00034   // Constant (Leaf) Exprs
00035   TRUE_EXPR = 1,
00036   FALSE_EXPR = 2,
00037   RATIONAL_EXPR = 3,
00038   STRING_EXPR = 4,
00039 
00040   // All constants should have kinds less than MAX_CONST
00041   MAX_CONST = 100,
00042 
00043   // Generic LISP kinds for representing raw parsed expressions
00044   RAW_LIST, //!< May have any number of children >= 0
00045   //! Identifier is (ID (STRING_EXPR "name"))
00046   ID,
00047   // Types
00048   BOOLEAN,
00049 //   TUPLE_TYPE,
00050   ANY_TYPE,
00051   ARROW,
00052   // The "type" of any expression type (as in BOOLEAN : TYPE).
00053   TYPE,
00054   // Declaration of new (uninterpreted) types: T1, T2, ... : TYPE
00055   // (TYPEDECL T1 T2 ...)
00056   TYPEDECL,
00057   // Declaration of a defined type T : TYPE = type === (TYPEDEF T type)
00058   TYPEDEF,
00059 
00060   // Equality
00061   EQ,
00062   NEQ,
00063   DISTINCT,
00064 
00065   // Propositional connectives
00066   NOT,
00067   AND,
00068   OR,
00069   XOR,
00070   IFF,
00071   IMPLIES,
00072   //  BOOL_VAR, //!< Boolean variables are treated as 0-ary predicates
00073 
00074   // Propositional relations (for circuit propagation)
00075   AND_R,
00076   IFF_R,
00077   ITE_R,
00078 
00079   // (ITE c e1 e2) == IF c THEN e1 ELSE e2 ENDIF, the internal
00080   // representation of the conditional.  Parser produces (IF ...).
00081   ITE,
00082 
00083   // Quantifiers
00084   FORALL,
00085   EXISTS,
00086 
00087   // Uninterpreted function
00088   UFUNC,
00089   // Application of a function
00090   APPLY,
00091 
00092   // Top-level Commands
00093   ASSERT,
00094   QUERY,
00095   CHECKSAT,
00096   CONTINUE,
00097   RESTART,
00098   DBG,
00099   TRACE,
00100   UNTRACE,
00101   OPTION,
00102   HELP,
00103   TRANSFORM,
00104   PRINT,
00105   CALL,
00106   ECHO,
00107   INCLUDE,
00108   DUMP_PROOF,
00109   DUMP_ASSUMPTIONS,
00110   DUMP_SIG,
00111   DUMP_TCC,
00112   DUMP_TCC_ASSUMPTIONS,
00113   DUMP_TCC_PROOF,
00114   DUMP_CLOSURE,
00115   DUMP_CLOSURE_PROOF,
00116   WHERE,
00117   ASSERTIONS,
00118   ASSUMPTIONS,
00119   COUNTEREXAMPLE,
00120   COUNTERMODEL,
00121   PUSH,
00122   POP,
00123   POPTO,
00124   PUSH_SCOPE,
00125   POP_SCOPE,
00126   POPTO_SCOPE,
00127   RESET,
00128   CONTEXT,
00129   FORGET,
00130   GET_TYPE,
00131   CHECK_TYPE,
00132   GET_CHILD,
00133   SUBSTITUTE,
00134   SEQ,
00135   ARITH_VAR_ORDER,
00136   ANNOTATION,
00137 
00138   // Kinds used mostly in the parser
00139 
00140   TCC,
00141   // Variable declaration (VARDECL v1 v2 ... v_n type).  A variable
00142   // can be an ID or a BOUNDVAR.
00143   VARDECL,
00144   // A list of variable declarations (VARDECLS (VARDECL ...) (VARDECL ...) ...)
00145   VARDECLS,
00146 
00147   // Bound variables have a "printable name", the one the user typed
00148   // in, and a uniqueID used to distinguish it from other bound
00149   // variables, which is effectively the alpha-renaming:
00150 
00151   // Op(BOUND_VAR (BOUND_ID "user_name" "uniqueID")).  Note that
00152   // BOUND_VAR is an operator (Expr without children), just as UFUNC
00153   // and UCONST.
00154 
00155   // The uniqueID normally is just a number, so one can print a bound
00156   // variable X as X_17.
00157 
00158   // NOTE that in the parsed expressions like LET x: T = e IN foo(x),
00159   // the second instance of 'x' will be an ID, and *not* a BOUNDVAR.
00160   // The parser does not know how to resolve bound variables, and it
00161   // has to be resolved later.
00162   BOUND_VAR,
00163   BOUND_ID,
00164 
00165   // Updator "e1 WITH <bunch of stuff> := e2" is represented as
00166   // (UPDATE e1 (UPDATE_SELECT <bunch of stuff>) e2), where <bunch
00167   // of stuff> is the list of accessors:
00168   // (READ idx)
00169   // ID (what's that for?)
00170   // (REC_SELECT ID)
00171   // and (TUPLE_SELECT num).
00172 //   UPDATE,
00173 //   UPDATE_SELECT,
00174   // Record type [# f1 : t1, f2 : t2 ... #] is represented as
00175   // (RECORD_TYPE (f1 t1) (f2 t2) ... )
00176 //   RECORD_TYPE,
00177 //   // (# f1=e1, f2=e2, ...#) == (RECORD (f1 e1) ...)
00178 //   RECORD,
00179 //   RECORD_SELECT,
00180 //   RECORD_UPDATE,
00181 
00182 //   // (e1, e2, ...) == (TUPLE e1 e2 ...)
00183 //   TUPLE,
00184 //   TUPLE_SELECT,
00185 //   TUPLE_UPDATE,
00186 
00187 //   SUBRANGE,
00188   // Enumerated type (SCALARTYPE v1 v2 ...)
00189 //   SCALARTYPE,
00190   // Predicate subtype: the argument is the predicate (lambda-expression)
00191   SUBTYPE,
00192   // Datatype is Expr(DATATYPE, Constructors), where Constructors is a
00193   // vector of Expr(CONSTRUCTOR, id [ , arg ]), where 'id' is an ID,
00194   // and 'arg' a VARDECL node (list of variable declarations with
00195   // types).  If 'arg' is present, the constructor has arguments
00196   // corresponding to the declared variables.
00197 //   DATATYPE,
00198 //   THISTYPE, // Used to indicate recursion in recursive datatypes
00199 //   CONSTRUCTOR,
00200 //   SELECTOR,
00201 //   TESTER,
00202   // Expression e WITH accessor := e2 is transformed by the command
00203   // processor into (DATATYPE_UPDATE e accessor e2), where e is the
00204   // original datatype value C(a1, ..., an) (here C is the
00205   // constructor), and "accessor" is the name of one of the arguments
00206   // a_i of C.
00207   //  DATATYPE_UPDATE,
00208   // Statement IF c1 THEN e1 ELSIF c2 THEN e2 ... ELSE e_n ENDIF is
00209   // represented as (IF (IFTHEN c1 e1) (IFTHEN c2 e2) ... (ELSE e_n))
00210   IF,
00211   IFTHEN,
00212   ELSE,
00213   // Lisp version of multi-branch IF:
00214   // (COND (c1 e1) (c2 e2) ... (ELSE en))
00215   COND,
00216 
00217   // LET x1: t1 = e1, x2: t2 = e2, ... IN e
00218   // Parser builds:
00219   // (LET (LETDECLS (LETDECL x1 t1 e1) (LETDECL x2 t2 e2) ... ) e)
00220   // where each x_i is a BOUNDVAR.
00221   // After processing, it is rebuilt to have (LETDECL var def); the
00222   // type is set as the attribute to var.
00223   LET,
00224   LETDECLS,
00225   LETDECL,
00226   // Lambda-abstraction LAMBDA (<vars>) : e  === (LAMBDA <vars> e)
00227   LAMBDA,
00228   // Symbolic simulation operator
00229   SIMULATE,
00230 
00231   // Uninterpreted constants (variables) x1, x2, ... , x_n : type
00232   // (CONST (VARLIST x1 x2 ... x_n) type)
00233   // Uninterpreted functions are declared as constants of functional type.
00234 
00235   // After processing, uninterpreted functions and constants
00236   // (a.k.a. variables) are represented as Op(UFUNC, (ID "name")) and
00237   // Op(UCONST, (ID "name")) with the appropriate type attribute.
00238   CONST,
00239   VARLIST,
00240   UCONST,
00241 
00242   // User function definition f(args) : type = e === (DEFUN args type e)
00243   // Here 'args' are bound var declarations
00244   DEFUN,
00245 
00246   // Arithmetic types and operators
00247 //   REAL,
00248 //   INT,
00249 
00250 //   UMINUS,
00251 //   PLUS,
00252 //   MINUS,
00253 //   MULT,
00254 //   DIVIDE,
00255 //   INTDIV,
00256 //   MOD,
00257 //   LT,
00258 //   LE,
00259 //   GT,
00260 //   GE,
00261 //   IS_INTEGER,
00262 //   NEGINF,
00263 //   POSINF,
00264 //   DARK_SHADOW,
00265 //   GRAY_SHADOW,
00266 
00267 //   //Floor theory operators
00268 //   FLOOR,
00269   // Kind for Extension to Non-linear Arithmetic
00270 //   POW,
00271 
00272   // Kinds for proof terms
00273   PF_APPLY,
00274   PF_HOLE,
00275 
00276 
00277 //   // Mlss
00278 //   EMPTY, // {}
00279 //   UNION, // +
00280 //   INTER, // *
00281 //   DIFF,
00282 //   SINGLETON,
00283 //   IN,
00284 //   INCS,
00285 //   INCIN,
00286 
00287   //Skolem variable
00288   SKOLEM_VAR,
00289   // Expr that holds a theorem
00290   THEOREM_KIND,
00291   //! Must always be the last kind
00292   LAST_KIND
00293 } Kind;
00294 
00295 #ifdef __cplusplus
00296 } // end of namespace CVC3
00297 #endif /* __cplusplus */
00298 
00299 #endif