Collaboration diagram for Abstract Theory Interface:
These are the theory-specific methods which provide the decision procedure functionality for a new theory. At the very least, a theory must implement the checkSat method. The other methods can be used to make the implementation more convenient. For more information on this API, see Clark Barrett's PhD dissertation and HOWTO Write a Decision Procedure in CVC Lite.
|
Notify theory of a new shared term. When a term e associated with theory i occurs as a child of an expression associated with theory j, the framework calls i->addSharedTerm(e) and j->addSharedTerm(e) Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryQuant, and CVCL::TheoryUF. Definition at line 133 of file theory.h. Referenced by TheoryCore::collectBasicVars(), and TheoryCore::setupTerm(). |
|
Assert a new fact to the decision procedure. Each fact that makes it into the core framework is assigned to exactly one theory: the theory associated with that fact. assertFact is called to inform the theory that a new fact has been assigned to the theory. Implemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryQuant, CVCL::TheoryRecords, CVCL::TheorySimulate, and CVCL::TheoryUF. Referenced by TheoryCore::assertFormula(). |
|
Check for satisfiability in the theory.
Implemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryDatatypeLazy, CVCL::TheoryQuant, CVCL::TheoryRecords, CVCL::TheorySimulate, and CVCL::TheoryUF. |
|
Theory-specific rewrite rules. By default, rewrite just returns a reflexive theorem stating that the input expression is equivalent to itself. However, rewrite is allowed to return any theorem which describes how the input expression is equivalent to some new expression. rewrite should be used to perform simplifications, normalization, and any other preprocessing on theory-specific expressions that needs to be done. Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryRecords, CVCL::TheorySimulate, and CVCL::TheoryUF. Definition at line 165 of file theory.h. References CVCL::Theory::reflexivityRule(). Referenced by TheoryCore::rewriteCore(). |
|
Set up the term e for call-backs when e or its children change. setup is called once for each expression associated with the theory. It is typically used to setup theory-specific data for an expression and to add call-back information for use with update.
Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryDatatypeLazy, CVCL::TheoryQuant, CVCL::TheoryRecords, and CVCL::TheoryUF. Definition at line 173 of file theory.h. Referenced by TheoryCore::setupTerm(). |
|
Notify a theory of a new equality. update is a call-back used by the notify mechanism of the core theory. It works as follows. When an equation t1 = t2 makes it into the core framework, the two find equivalence classes for t1 and t2 are merged. The result is that t2 is the new equivalence class representative and t1 is no longer an equivalence class representative. When this happens, the notify list of t1 is traversed. Notify list entries consist of a theory and an expression d. For each entry (i,d), i->update(e, d) is called, where e is the theorem corresponding to the equality t1=t2. To add the entry (i,d) to a term t1's notify list, a call must be made to t1.addNotify(i,d). This is typically done in setup.
Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryDatatypeLazy, CVCL::TheoryQuant, CVCL::TheoryRecords, and CVCL::TheoryUF. Definition at line 190 of file theory.h. Referenced by TheoryCore::processNotify(). |
|
An optional solver. The solve method can be used to implement a Shostak-style solver. Since solvers do not in general combine, the following technique is used. One theory is designated as the primary solver (in our case, it is the theory of arithmetic). For each equation that enters the core framework, the primary solver is called to ensure that the equation is in solved form with respect to the primary theory. After the primary solver, the solver for the theory associated with the equation is called. This solver can do whatever it likes, as long as the result is still in solved form with respect to the primary solver. This is a slight generalization of what is described in my (Clark)'s PhD thesis. Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, and CVCL::TheoryDatatype. Definition at line 205 of file theory.h. Referenced by TheoryCore::solve(). |
|
Recursive simplification step. INVARIANT: the result is a Theorem(e=e'), where e' is a fully simplified version of e. To simplify subexpressions recursively, call simplify() function. This theory-specific method is called when the simplifier descends top-down into the expression. Normally, every kid is simplified recursively, and the results are combined into the new parent with the same operator (Op). This functionality is provided with the default implementation. However, in some expressions some kids may not matter in the result, and can be skipped. For instance, if the first kid in a long AND simplifies to FALSE, then the entire expression simplifies to FALSE, and the remaining kids do not need to be simplified. This call is a chance for a DP to provide these types of optimizations during the top-down phase of simplification. Reimplemented in CVCL::TheoryBitvector, and CVCL::TheoryCore. Definition at line 60 of file theory.cpp. References CVCL::Expr::arity(), CVCL::Theory::d_commonRules, CVCL::Theorem::getLHS(), CVCL::Theorem::getRHS(), CVCL::Theory::reflexivityRule(), CVCL::Theory::simplifyRec(), and CVCL::CommonProofRules::substitutivityRule(). Referenced by TheoryCore::simplifyFullRec(). |
|
Check that e is a valid Type expr.
Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryRecords, and CVCL::TheoryUF. Definition at line 235 of file theory.h. References CVCL::Expr::toString(). Referenced by CVCL::TypeComputerCore::checkType(). |
|
Compute and store the type of e.
Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryQuant, CVCL::TheoryRecords, CVCL::TheorySimulate, and CVCL::TheoryUF. Definition at line 245 of file theory.h. Referenced by CVCL::TypeComputerCore::computeType(). |
|
Compute the base type of the top-level operator of an arbitrary type.
Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryCore, CVCL::TheoryRecords, and CVCL::TheoryUF. Definition at line 247 of file theory.h. Referenced by CVCL::Theory::getBaseType(). |
|
Theory specific computation of the subtyping predicate for type t applied to the expression e. By default returns true. Each theory needs to compute subtype predicates for the types associated with it. So, for example, the theory of records will take a record type [# f1: T1, f2: T2 #] and an expression e and will return the subtyping predicate for e, namely: computeTypePred(T1, e.f1) AND computeTypePred(T2, e.f2) Reimplemented in CVCL::TheoryArith, CVCL::TheoryBitvector, CVCL::TheoryCore, and CVCL::TheoryRecords. Definition at line 257 of file theory.h. References CVCL::Expr::getEM(), and CVCL::ExprManager::trueExpr(). Referenced by TheoryCore::computeTypePred(), and CVCL::Theory::getTypePred(). |
|
|
Theory-specific parsing implemented by the DP.
Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryQuant, CVCL::TheoryRecords, and CVCL::TheoryUF. Definition at line 274 of file theory.h. Referenced by TheoryCore::parseExpr(). |
|
Theory-specific pretty-printing. By default, print the top node in AST, and resume pretty-printing the children. The same call e.print(os) can be used in DP-specific printers to use AST printing for the given node. In fact, it is strongly recommended to add e.print(os) as the default for all the cases/kinds that are not handled by the particular pretty-printer. Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryCore, CVCL::TheoryDatatype, CVCL::TheoryQuant, CVCL::TheoryRecords, CVCL::TheorySimulate, and CVCL::TheoryUF. Definition at line 284 of file theory.h. References CVCL::Expr::printAST(). Referenced by CVCL::PrettyPrinterCore::print(). |
|
Add variables from 'e' to 'v' for constructing a concrete model. If e is already of primitive type, do NOT add it to v. Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryDatatype, CVCL::TheoryRecords, and CVCL::TheoryUF. |
|
Process disequalities from the arrangement for model generation.
Reimplemented in CVCL::TheoryArith, and CVCL::TheoryCore. |
|
Assign concrete values to basic-type variables in v.
Reimplemented in CVCL::TheoryArith, and CVCL::TheoryCore. |
|
Compute the value of a compound variable from the more primitive ones. The more primitive variables for e are already assigned concrete values, and are available through getModelValue(). The new value for e must be assigned using assignValue() method.
Reimplemented in CVCL::TheoryArith, CVCL::TheoryArray, CVCL::TheoryBitvector, CVCL::TheoryRecords, and CVCL::TheoryUF. Definition at line 316 of file theory.h. References CVCL::Theory::assignValue(), and CVCL::Theory::find(). Referenced by TheoryCore::collectModelValues(). |
|
Receives all the type predicates for the types of the given theory. Type predicates may be expensive to enqueue eagerly, and DPs may choose to postpone them, or transform them to something more efficient. By default, the asserted type predicate is immediately enqueued as a new fact. Note: Used only by bitvector theory.
Reimplemented in CVCL::TheoryBitvector. Definition at line 332 of file theory.h. References CVCL::Theory::enqueueFact(). Referenced by TheoryCore::setupTerm(). |
|
Theory-specific rewrites for atomic formulas. The intended use is to convert complex atomic formulas into an equivalent Boolean combination of simpler formulas. Such conversion may be harmful for algebraic rewrites, and is not always desirable to have in rewrite() method. Note: Used only by bitvector theory and rewriteLiteral in core. However, if rewrite() alone cannot solve the problem, and the SAT solver needs to be envoked, these additional rewrites may ease the job for the SAT solver. Reimplemented in CVCL::TheoryBitvector. Definition at line 347 of file theory.h. References CVCL::Theory::reflexivityRule(). Referenced by TheoryCore::rewriteLiteral(). |
|
Notification of conflict. Decision procedures implement this method when they want to be notified about a conflict. Note: Used only by quantifier theory
Reimplemented in CVCL::TheoryQuant. |