CVC3  2.4.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CVC3::TheoryRecords Class Reference

This theory handles records. More...

#include <theory_records.h>

Inheritance diagram for CVC3::TheoryRecords:
CVC3::Theory

Public Member Functions

 TheoryRecords (TheoryCore *core)
 Constructor. More...
 
 ~TheoryRecords ()
 
RecordsProofRulescreateProofRules ()
 creates a reference to the proof rules More...
 
void assertFact (const Theorem &e)
 assert a fact to the theory of records More...
 
void checkSat (bool fullEffort)
 empty implementation to fit theory interface More...
 
Theorem rewrite (const Expr &e)
 rewrites an expression e to one of several allowed forms More...
 
void checkType (const Expr &e)
 check record or tuple type More...
 
Cardinality finiteTypeInfo (Expr &e, Unsigned &n, bool enumerate, bool computeSize)
 Compute information related to finiteness of types. More...
 
void computeType (const Expr &e)
 computes the type of a record or a tuple More...
 
Type computeBaseType (const Type &t)
 Compute the base type of the top-level operator of an arbitrary type. More...
 
Expr computeTypePred (const Type &t, const Expr &e)
 Theory specific computation of the subtyping predicate for type t applied to the expression e. More...
 
void computeModelTerm (const Expr &e, std::vector< Expr > &v)
 Add variables from 'e' to 'v' for constructing a concrete model. More...
 
void computeModel (const Expr &e, std::vector< Expr > &vars)
 Compute the value of a compound variable from the more primitive ones. More...
 
Expr computeTCC (const Expr &e)
 Compute and cache the TCC of e. More...
 
virtual Expr parseExprOp (const Expr &e)
 Theory-specific parsing implemented by the DP. More...
 
void setup (const Expr &e)
 Set up the term e for call-backs when e or its children change. More...
 
void update (const Theorem &e, const Expr &d)
 Notify a theory of a new equality. More...
 
ExprStreamprint (ExprStream &os, const Expr &e)
 pretty printing More...
 
bool isRecord (const Expr &e)
 Test whether expr is a record literal. More...
 
bool isRecordType (const Expr &e)
 Test whether expr is a record type. More...
 
bool isRecordType (const Type &t)
 Test whether expr is a record type. More...
 
bool isRecordAccess (const Expr &e)
 Test whether expr is a record select/update subclass. More...
 
Expr recordExpr (const std::vector< std::string > &fields, const std::vector< Expr > &kids)
 Create a record literal. More...
 
Expr recordExpr (const std::vector< Expr > &fields, const std::vector< Expr > &kids)
 Create a record literal. More...
 
Type recordType (const std::vector< std::string > &fields, const std::vector< Type > &types)
 Create a record type. More...
 
Type recordType (const std::vector< std::string > &fields, const std::vector< Expr > &types)
 Create a record type (field types are given as a vector of Expr) More...
 
Type recordType (const std::vector< Expr > &fields, const std::vector< Expr > &types)
 Create a record type (fields and types are given as a vector of Expr) More...
 
Expr recordSelect (const Expr &r, const std::string &field)
 Create a record field select expression. More...
 
Expr recordUpdate (const Expr &r, const std::string &field, const Expr &val)
 Create a record field update expression. More...
 
const std::vector< Expr > & getFields (const Expr &r)
 Get the list of fields from a record literal. More...
 
const std::string & getField (const Expr &e, int i)
 Get the i-th field name from the record literal or type. More...
 
int getFieldIndex (const Expr &e, const std::string &field)
 Get the field index in the record literal or type. More...
 
const std::string & getField (const Expr &e)
 Get the field name from the record select and update expressions. More...
 
Expr tupleExpr (const std::vector< Expr > &kids)
 Create a tuple literal. More...
 
Type tupleType (const std::vector< Type > &types)
 Create a tuple type. More...
 
Type tupleType (const std::vector< Expr > &types)
 Create a tuple type (types of components are given as Exprs) More...
 
Expr tupleSelect (const Expr &tup, int i)
 Create a tuple index selector expression. More...
 
Expr tupleUpdate (const Expr &tup, int i, const Expr &val)
 Create a tuple index update expression. More...
 
int getIndex (const Expr &e)
 Get the index from the tuple select and update expressions. More...
 
bool isTupleAccess (const Expr &e)
 Test whether expr is a tuple select/update subclass. More...
 
bool isTuple (const Expr &e)
 Test if expr is a tuple literal. More...
 
bool isTupleType (const Expr &e)
 Test if expr represents a tuple type. More...
 
bool isTupleType (const Type &tp)
 Test if 'tp' is a tuple type. More...
 
- Public Member Functions inherited from CVC3::Theory
 Theory (TheoryCore *theoryCore, const std::string &name)
 Whether theory has been used (for smtlib translator) More...
 
virtual ~Theory (void)
 Destructor. More...
 
ExprManagergetEM ()
 Access to ExprManager. More...
 
TheoryCoretheoryCore ()
 Get a pointer to theoryCore. More...
 
CommonProofRulesgetCommonRules ()
 Get a pointer to common proof rules. More...
 
const std::string & getName () const
 Get the name of the theory (for debugging purposes) More...
 
virtual void setUsed ()
 Set the "used" flag on this theory (for smtlib translator) More...
 
virtual bool theoryUsed ()
 Get whether theory has been used (for smtlib translator) More...
 
virtual void addSharedTerm (const Expr &e)
 Notify theory of a new shared term. More...
 
virtual Theorem theoryPreprocess (const Expr &e)
 Theory-specific preprocessing. More...
 
virtual Theorem solve (const Theorem &e)
 An optional solver. More...
 
virtual void checkAssertEqInvariant (const Theorem &e)
 A debug check used by the primary solver. More...
 
virtual Theorem simplifyOp (const Expr &e)
 Recursive simplification step. More...
 
virtual void refineCounterExample ()
 Process disequalities from the arrangement for model generation. More...
 
virtual void computeModelBasic (const std::vector< Expr > &v)
 Assign concrete values to basic-type variables in v. More...
 
virtual void assertTypePred (const Expr &e, const Theorem &pred)
 Receives all the type predicates for the types of the given theory. More...
 
virtual Theorem rewriteAtomic (const Expr &e)
 Theory-specific rewrites for atomic formulas. More...
 
virtual void notifyInconsistent (const Theorem &thm)
 Notification of conflict. More...
 
virtual void registerAtom (const Expr &e, const Theorem &thm)
 
virtual void registerAtom (const Expr &e)
 Theory-specific registration of atoms. More...
 
virtual bool inconsistent ()
 Check if the current context is inconsistent. More...
 
virtual void setInconsistent (const Theorem &e)
 Make the context inconsistent; The formula proved by e must FALSE. More...
 
virtual void setIncomplete (const std::string &reason)
 Mark the current decision branch as possibly incomplete. More...
 
virtual Theorem simplify (const Expr &e)
 Simplify a term e and return a Theorem(e==e') More...
 
Expr simplifyExpr (const Expr &e)
 Simplify a term e w.r.t. the current context. More...
 
virtual void enqueueFact (const Theorem &e)
 Submit a derived fact to the core from a decision procedure. More...
 
virtual void enqueueSE (const Theorem &e)
 Check if the current context is inconsistent. More...
 
virtual void assertEqualities (const Theorem &e)
 Handle new equalities (usually asserted through addFact) More...
 
virtual Expr parseExpr (const Expr &e)
 Parse the generic expression. More...
 
virtual void assignValue (const Expr &t, const Expr &val)
 Assigns t a concrete value val. Used in model generation. More...
 
virtual void assignValue (const Theorem &thm)
 Record a derived assignment to a variable (LHS). More...
 
void registerKinds (Theory *theory, std::vector< int > &kinds)
 Register new kinds with the given theory. More...
 
void unregisterKinds (Theory *theory, std::vector< int > &kinds)
 Unregister kinds for a theory. More...
 
void registerTheory (Theory *theory, std::vector< int > &kinds, bool hasSolver=false)
 Register a new theory. More...
 
void unregisterTheory (Theory *theory, std::vector< int > &kinds, bool hasSolver)
 Unregister a theory. More...
 
int getNumTheories ()
 Return the number of registered theories. More...
 
bool hasTheory (int kind)
 Test whether a kind maps to any theory. More...
 
TheorytheoryOf (int kind)
 Return the theory associated with a kind. More...
 
TheorytheoryOf (const Type &e)
 Return the theory associated with a type. More...
 
TheorytheoryOf (const Expr &e)
 Return the theory associated with an Expr. More...
 
Theorem find (const Expr &e)
 Return the theorem that e is equal to its find. More...
 
const TheoremfindRef (const Expr &e)
 Return the find as a reference: expr must have a find. More...
 
Theorem findReduce (const Expr &e)
 Return find-reduced version of e. More...
 
bool findReduced (const Expr &e)
 Return true iff e is find-reduced. More...
 
Expr findExpr (const Expr &e)
 Return the find of e, or e if it has no find. More...
 
Expr getTCC (const Expr &e)
 Compute the TCC of e, or the subtyping predicate, if e is a type. More...
 
Type getBaseType (const Expr &e)
 Compute (or look up in cache) the base type of e and return the result. More...
 
Type getBaseType (const Type &tp)
 Compute the base type from an arbitrary type. More...
 
Expr getTypePred (const Type &t, const Expr &e)
 Calls the correct theory to compute a type predicate. More...
 
Theorem updateHelper (const Expr &e)
 Update the children of the term e. More...
 
void setupCC (const Expr &e)
 Setup a term for congruence closure (must have sig and rep attributes) More...
 
void updateCC (const Theorem &e, const Expr &d)
 Update a term w.r.t. congruence closure (must be setup with setupCC()) More...
 
Theorem rewriteCC (const Expr &e)
 Rewrite a term w.r.t. congruence closure (must be setup with setupCC()) More...
 
void getModelTerm (const Expr &e, std::vector< Expr > &v)
 Calls the correct theory to get all of the terms that need to be assigned values in the concrete model. More...
 
Theorem getModelValue (const Expr &e)
 Fetch the concrete assignment to the variable during model generation. More...
 
void addSplitter (const Expr &e, int priority=0)
 Suggest a splitter to the SearchEngine. More...
 
void addGlobalLemma (const Theorem &thm, int priority=0)
 Add a global lemma. More...
 
bool isLeaf (const Expr &e)
 Test if e is an i-leaf term for the current theory. More...
 
bool isLeafIn (const Expr &e1, const Expr &e2)
 Test if e1 is an i-leaf in e2. More...
 
bool leavesAreSimp (const Expr &e)
 Test if all i-leaves of e are simplified. More...
 
Type boolType ()
 Return BOOLEAN type. More...
 
const ExprfalseExpr ()
 Return FALSE Expr. More...
 
const ExprtrueExpr ()
 Return TRUE Expr. More...
 
Expr newVar (const std::string &name, const Type &type)
 Create a new variable given its name and type. More...
 
Expr newVar (const std::string &name, const Type &type, const Expr &def)
 Create a new named expression given its name, type, and definition. More...
 
Op newFunction (const std::string &name, const Type &type, bool computeTransClosure)
 Create a new uninterpreted function. More...
 
Op lookupFunction (const std::string &name, Type *type)
 Look up a function by name. More...
 
Op newFunction (const std::string &name, const Type &type, const Expr &def)
 Create a new defined function. More...
 
Expr addBoundVar (const std::string &name, const Type &type)
 Create and add a new bound variable to the stack, for parseExprOp(). More...
 
Expr addBoundVar (const std::string &name, const Type &type, const Expr &def)
 Create and add a new bound named def to the stack, for parseExprOp(). More...
 
Expr lookupVar (const std::string &name, Type *type)
 Lookup variable and return it and its type. Return NULL Expr if it doesn't exist yet. More...
 
Type newTypeExpr (const std::string &name)
 Create a new uninterpreted type with the given name. More...
 
Type lookupTypeExpr (const std::string &name)
 Lookup type by name. Return Null if no such type exists. More...
 
Type newTypeExpr (const std::string &name, const Type &def)
 Create a new type abbreviation with the given name. More...
 
Type newSubtypeExpr (const Expr &pred, const Expr &witness)
 Create a new subtype expression. More...
 
Expr resolveID (const std::string &name)
 Resolve an identifier, for use in parseExprOp() More...
 
void installID (const std::string &name, const Expr &e)
 Install name as a new identifier associated with Expr e. More...
 
Theorem typePred (const Expr &e)
 Return BOOLEAN type. More...
 
Theorem reflexivityRule (const Expr &a)
 ==> a == a More...
 
Theorem symmetryRule (const Theorem &a1_eq_a2)
 a1 == a2 ==> a2 == a1 More...
 
Theorem transitivityRule (const Theorem &a1_eq_a2, const Theorem &a2_eq_a3)
 (a1 == a2) & (a2 == a3) ==> (a1 == a3) More...
 
Theorem substitutivityRule (const Op &op, const std::vector< Theorem > &thms)
 (c_1 == d_1) & ... & (c_n == d_n) ==> op(c_1,...,c_n) == op(d_1,...,d_n) More...
 
Theorem substitutivityRule (const Expr &e, const Theorem &t)
 Special case for unary operators. More...
 
Theorem substitutivityRule (const Expr &e, const Theorem &t1, const Theorem &t2)
 Special case for binary operators. More...
 
Theorem substitutivityRule (const Expr &e, const std::vector< unsigned > &changed, const std::vector< Theorem > &thms)
 Optimized: only positions which changed are included. More...
 
Theorem substitutivityRule (const Expr &e, int changed, const Theorem &thm)
 Optimized: only a single position changed. More...
 
Theorem iffMP (const Theorem &e1, const Theorem &e1_iff_e2)
 e1 AND (e1 IFF e2) ==> e2 More...
 
Theorem rewriteAnd (const Expr &e)
 ==> AND(e1,e2) IFF [simplified expr] More...
 
Theorem rewriteOr (const Expr &e)
 ==> OR(e1,...,en) IFF [simplified expr] More...
 
Theorem rewriteIte (const Expr &e)
 Derived rule for rewriting ITE. More...
 
Theorem renameExpr (const Expr &e)
 Derived rule to create a new name for an expression. More...
 

Private Member Functions

Theorem rewriteAux (const Expr &e)
 Auxiliary rewrites: Processing of AND and OR of equations. Returns e=e'. More...
 
Theorem rewriteAux (const Theorem &thm)
 Takes Thm(e), returns Thm(e'), where e rewrites to e' by rewriteAux. More...
 

Private Attributes

RecordsProofRulesd_rules
 

Additional Inherited Members

- Protected Attributes inherited from CVC3::Theory
bool d_theoryUsed
 

Detailed Description

This theory handles records.

Author: Daniel Wichs

Created: 7/22/03

Definition at line 51 of file theory_records.h.

Constructor & Destructor Documentation

TheoryRecords::TheoryRecords ( TheoryCore core)
TheoryRecords::~TheoryRecords ( )

Destructor

Definition at line 125 of file theory_records.cpp.

References d_rules.

Member Function Documentation

Theorem TheoryRecords::rewriteAux ( const Expr e)
private

Auxiliary rewrites: Processing of AND and OR of equations. Returns e=e'.

When a record/tuple (dis)equality is expanded into the (dis)equalities of fields, we have to perform rewrites on the resulting record terms before the simplifier kicks in.

Otherwise, if we have r1.f = r2.f, but r1=r2 was asserted before, for some complex record expressions r1 and r2, then the simplifier will substitute r2 for r1, and we get r2.f=r2.f at the end, which is not a useful fact to have.

However, r1.f and/or r2.f may rewrite to something interesting, and the equality may yield new important facts.

Definition at line 45 of file theory_records.cpp.

References AND, CVC3::Expr::arity(), EQ, CVC3::Expr::getFind(), CVC3::Expr::getKind(), CVC3::Theorem::getLHS(), CVC3::Theorem::getRHS(), CVC3::Expr::hasFind(), IFF, NOT, and OR.

Referenced by assertFact().

Theorem TheoryRecords::rewriteAux ( const Theorem thm)
private

Takes Thm(e), returns Thm(e'), where e rewrites to e' by rewriteAux.

Definition at line 91 of file theory_records.cpp.

References CVC3::Theorem::getExpr().

RecordsProofRules * TheoryRecords::createProofRules ( )

creates a reference to the proof rules

Definition at line 32 of file records_theorem_producer.cpp.

Referenced by TheoryRecords().

void TheoryRecords::assertFact ( const Theorem e)
virtual
void CVC3::TheoryRecords::checkSat ( bool  fullEffort)
inlinevirtual

empty implementation to fit theory interface

Implements CVC3::Theory.

Definition at line 69 of file theory_records.h.

Theorem TheoryRecords::rewrite ( const Expr e)
virtual
void TheoryRecords::checkType ( const Expr e)
virtual
Cardinality TheoryRecords::finiteTypeInfo ( Expr e,
Unsigned n,
bool  enumerate,
bool  computeSize 
)
virtual

Compute information related to finiteness of types.

Used by the TypeComputer defined in TheoryCore (theories should not call this funtion directly – they should use the methods in Type instead). Each theory should implement this if it contains any types that could be non-infinite.

  1. Returns Cardinality of the type (finite, infinite, or unknown)
  2. If cardinality = finite and enumerate is true, sets e to the nth element of the type if it can sets e to NULL if n is out of bounds or if unable to compute nth element
  3. If cardinality = finite and computeSize is true, sets n to the size of the type if it can sets n to 0 otherwise

Reimplemented from CVC3::Theory.

Definition at line 381 of file theory_records.cpp.

References CVC3::CARD_UNKNOWN.

void TheoryRecords::computeType ( const Expr e)
virtual
Type TheoryRecords::computeBaseType ( const Type tp)
virtual
Expr TheoryRecords::computeTypePred ( const Type t,
const Expr e 
)
virtual

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 from CVC3::Theory.

Definition at line 312 of file theory_records.cpp.

References CVC3::andExpr(), CVC3::Expr::arity(), DebugAssert, CVC3::Type::getExpr(), getFields(), CVC3::Expr::getOpKind(), CVC3::Theory::getTypePred(), CVC3::RECORD_TYPE, recordSelect(), TRACE, CVC3::TUPLE_TYPE, and tupleSelect().

void TheoryRecords::computeModelTerm ( const Expr e,
std::vector< Expr > &  v 
)
virtual

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 from CVC3::Theory.

Definition at line 261 of file theory_records.cpp.

References CVC3::Expr::arity(), CVC3::Type::getExpr(), getFields(), CVC3::Expr::getOpKind(), CVC3::Theorem::getRHS(), CVC3::Expr::getType(), CVC3::RECORD_TYPE, recordSelect(), rewrite(), CVC3::TUPLE_TYPE, and tupleSelect().

void TheoryRecords::computeModel ( const Expr e,
std::vector< Expr > &  vars 
)
virtual

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.

Parameters
eis the compound type expression to assign a value;
varsare the variables actually assigned. Normally, 'e' is the only element of vars. However, e.g. in the case of uninterpreted functions, assigning 'f' means assigning all relevant applications of 'f' to constant values (f(0), f(5), etc.). Such applications might not be known before the model is constructed (they may be of the form f(x), f(y+z), etc., where x,y,z are still unassigned).

Populating 'vars' is an opportunity for a DP to change the set of top-level "variables" to assign, if needed. In particular, it may drop 'e' from the model entirely, if it is already a concrete value by itself.

Reimplemented from CVC3::Theory.

Definition at line 281 of file theory_records.cpp.

References CVC3::Expr::arity(), CVC3::Theory::assignValue(), d_rules, DebugAssert, CVC3::RecordsProofRules::expandRecord(), CVC3::RecordsProofRules::expandTuple(), CVC3::Theory::getBaseType(), CVC3::Type::getExpr(), CVC3::Theorem::getLHS(), CVC3::Theory::getModelValue(), CVC3::Expr::getOpKind(), CVC3::Theorem::getRHS(), CVC3::RECORD_TYPE, CVC3::Theory::substitutivityRule(), CVC3::Expr::toString(), CVC3::Theory::transitivityRule(), and CVC3::TUPLE_TYPE.

Expr TheoryRecords::computeTCC ( const Expr e)
virtual

Compute and cache the TCC of e.

Parameters
eis an expression (term or formula). This function computes the TCC of e which is true iff the expression is defined.

This function computes the TCC or predicate of the top-level operator of e, and recurses into children using getTCC(), if necessary.

The default implementation is to compute TCCs recursively for all children, and return their conjunction.

Reimplemented from CVC3::Theory.

Definition at line 228 of file theory_records.cpp.

References CVC3::Theory::computeTCC(), DebugAssert, CVC3::Type::getExpr(), getField(), getFieldIndex(), getIndex(), CVC3::Expr::getOpKind(), CVC3::Expr::getType(), CVC3::Theory::getTypePred(), CVC3::RECORD, CVC3::RECORD_SELECT, CVC3::RECORD_UPDATE, CVC3::Theory::rewriteAnd(), TRACE, CVC3::TUPLE, CVC3::TUPLE_SELECT, and CVC3::TUPLE_UPDATE.

Expr TheoryRecords::parseExprOp ( const Expr e)
virtual
void TheoryRecords::setup ( const Expr e)
virtual
void TheoryRecords::update ( const Theorem e,
const Expr d 
)
virtual

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.

See also
setup

Reimplemented from CVC3::Theory.

Definition at line 561 of file theory_records.cpp.

References CVC3::Theory::assertEqualities(), DebugAssert, CVC3::Theory::find(), CVC3::Expr::getOpKind(), CVC3::Theorem::getRHS(), CVC3::Expr::hasFind(), CVC3::Theory::inconsistent(), CVC3::RECORD, rewrite(), CVC3::Theory::transitivityRule(), CVC3::TUPLE, CVC3::Theory::updateCC(), and CVC3::Theory::updateHelper().

ExprStream & TheoryRecords::print ( ExprStream os,
const Expr e 
)
virtual
bool CVC3::TheoryRecords::isRecord ( const Expr e)
inline

Test whether expr is a record literal.

Definition at line 91 of file theory_records.h.

References CVC3::Expr::getOpKind(), CVC3::Expr::isApply(), and CVC3::RECORD.

Referenced by print().

bool CVC3::TheoryRecords::isRecordType ( const Expr e)
inline

Test whether expr is a record type.

Definition at line 95 of file theory_records.h.

References CVC3::Expr::getOpKind(), CVC3::Expr::isApply(), and CVC3::RECORD_TYPE.

Referenced by CVC3::RecordsTheoremProducer::isRecordType(), isRecordType(), print(), and setup().

bool CVC3::TheoryRecords::isRecordType ( const Type t)
inline

Test whether expr is a record type.

Definition at line 99 of file theory_records.h.

References CVC3::Type::getExpr(), and isRecordType().

bool CVC3::TheoryRecords::isRecordAccess ( const Expr e)
inline

Test whether expr is a record select/update subclass.

Definition at line 103 of file theory_records.h.

References CVC3::Expr::getOpKind(), CVC3::Expr::isApply(), CVC3::RECORD_SELECT, and CVC3::RECORD_UPDATE.

Referenced by CVC3::RecordsTheoremProducer::isRecordAccess(), and print().

Expr TheoryRecords::recordExpr ( const std::vector< std::string > &  fields,
const std::vector< Expr > &  kids 
)

Create a record literal.

Definition at line 961 of file theory_records.cpp.

References CVC3::Theory::getEM().

Referenced by parseExprOp(), and CVC3::RecordsTheoremProducer::recordExpr().

Expr TheoryRecords::recordExpr ( const std::vector< Expr > &  fields,
const std::vector< Expr > &  kids 
)

Create a record literal.

Definition at line 970 of file theory_records.cpp.

References CVC3::RECORD.

Type TheoryRecords::recordType ( const std::vector< std::string > &  fields,
const std::vector< Type > &  types 
)

Create a record type.

Definition at line 977 of file theory_records.cpp.

Referenced by computeType(), parseExprOp(), CVC3::RecordsTheoremProducer::recordType(), and recordType().

Type TheoryRecords::recordType ( const std::vector< std::string > &  fields,
const std::vector< Expr > &  types 
)

Create a record type (field types are given as a vector of Expr)

Create a record type.

Definition at line 988 of file theory_records.cpp.

References CVC3::Theory::getEM(), and recordType().

Type TheoryRecords::recordType ( const std::vector< Expr > &  fields,
const std::vector< Expr > &  types 
)

Create a record type (fields and types are given as a vector of Expr)

Definition at line 997 of file theory_records.cpp.

References CVC3::RECORD_TYPE.

Expr TheoryRecords::recordSelect ( const Expr r,
const std::string &  field 
)

Create a record field select expression.

Create a record field selector expression.

Definition at line 1004 of file theory_records.cpp.

References CVC3::Theory::getEM(), and CVC3::RECORD_SELECT.

Referenced by computeModelTerm(), computeTypePred(), parseExprOp(), and CVC3::RecordsTheoremProducer::recordSelect().

Expr TheoryRecords::recordUpdate ( const Expr r,
const std::string &  field,
const Expr val 
)

Create a record field update expression.

Definition at line 1010 of file theory_records.cpp.

References CVC3::Theory::getEM(), and CVC3::RECORD_UPDATE.

Referenced by parseExprOp(), and CVC3::RecordsTheoremProducer::recordUpdate().

const vector< Expr > & TheoryRecords::getFields ( const Expr r)
const string & TheoryRecords::getField ( const Expr e,
int  i 
)
int TheoryRecords::getFieldIndex ( const Expr e,
const std::string &  field 
)

Get the field index in the record literal or type.

The field must be present in the record; otherwise it's an error.

Definition at line 1037 of file theory_records.cpp.

References DebugAssert, getFields(), and CVC3::Expr::toString().

Referenced by computeTCC(), computeType(), and CVC3::RecordsTheoremProducer::getFieldIndex().

const std::string & TheoryRecords::getField ( const Expr e)

Get the field name from the record select and update expressions.

Definition at line 1049 of file theory_records.cpp.

References DebugAssert, CVC3::Expr::getName(), CVC3::Expr::getOpExpr(), CVC3::Expr::getOpKind(), CVC3::Expr::isApply(), CVC3::RECORD_SELECT, and CVC3::RECORD_UPDATE.

Expr TheoryRecords::tupleExpr ( const std::vector< Expr > &  kids)

Create a tuple literal.

Definition at line 1058 of file theory_records.cpp.

References CVC3::Theory::getEM(), and CVC3::TUPLE.

Referenced by parseExprOp(), and CVC3::RecordsTheoremProducer::tupleExpr().

Type TheoryRecords::tupleType ( const std::vector< Type > &  types)

Create a tuple type.

Definition at line 1064 of file theory_records.cpp.

References CVC3::Theory::getEM(), and CVC3::TUPLE_TYPE.

Referenced by parseExprOp(), and CVC3::RecordsTheoremProducer::tupleType().

Type TheoryRecords::tupleType ( const std::vector< Expr > &  types)

Create a tuple type (types of components are given as Exprs)

Create a tuple type.

Definition at line 1074 of file theory_records.cpp.

References CVC3::Theory::getEM(), and CVC3::TUPLE_TYPE.

Expr TheoryRecords::tupleSelect ( const Expr tup,
int  i 
)

Create a tuple index selector expression.

Definition at line 1080 of file theory_records.cpp.

References CVC3::Theory::getEM(), and CVC3::TUPLE_SELECT.

Referenced by computeModelTerm(), computeTypePred(), parseExprOp(), and CVC3::RecordsTheoremProducer::tupleSelect().

Expr TheoryRecords::tupleUpdate ( const Expr tup,
int  i,
const Expr val 
)

Create a tuple index update expression.

Definition at line 1086 of file theory_records.cpp.

References CVC3::Theory::getEM(), and CVC3::TUPLE_UPDATE.

Referenced by parseExprOp(), and CVC3::RecordsTheoremProducer::tupleUpdate().

int TheoryRecords::getIndex ( const Expr e)
bool CVC3::TheoryRecords::isTupleAccess ( const Expr e)
inline

Test whether expr is a tuple select/update subclass.

Definition at line 147 of file theory_records.h.

References CVC3::Expr::getOpKind(), CVC3::Expr::isApply(), CVC3::TUPLE_SELECT, and CVC3::TUPLE_UPDATE.

Referenced by CVC3::RecordsTheoremProducer::isTupleAccess(), and print().

bool CVC3::TheoryRecords::isTuple ( const Expr e)
inline

Test if expr is a tuple literal.

Definition at line 151 of file theory_records.h.

References CVC3::Expr::getOpKind(), CVC3::Expr::isApply(), and CVC3::TUPLE.

bool CVC3::TheoryRecords::isTupleType ( const Expr e)
inline

Test if expr represents a tuple type.

Definition at line 153 of file theory_records.h.

References CVC3::Expr::getOpKind(), CVC3::Expr::isApply(), and CVC3::TUPLE_TYPE.

Referenced by setup().

bool CVC3::TheoryRecords::isTupleType ( const Type tp)
inline

Test if 'tp' is a tuple type.

Definition at line 156 of file theory_records.h.

References CVC3::Type::getExpr(), and isTupleType().

Referenced by isTupleType().

Member Data Documentation

RecordsProofRules* CVC3::TheoryRecords::d_rules
private

Definition at line 52 of file theory_records.h.

Referenced by assertFact(), computeModel(), rewrite(), setup(), TheoryRecords(), and ~TheoryRecords().


The documentation for this class was generated from the following files: