cvc4-1.4
c_interface.h File Reference
Include dependency graph for c_interface.h:

Go to the source code of this file.

Functions

VC vc_createValidityChecker (Flags flags)
 Flags can be NULL.
 
Flags vc_createFlags ()
 Create validity checker's flags.
 
void vc_destroyValidityChecker (VC vc)
 Destroy the validity checker.
 
void vc_deleteFlags (Flags flags)
 Delete the flags.
 
void vc_deleteType (Type t)
 Delete type.
 
void vc_deleteExpr (Expr e)
 Delete expression.
 
void vc_deleteOp (Op op)
 Delete operator.
 
void vc_deleteVector (Expr *e)
 Delete vector of expressions.
 
void vc_deleteTypeVector (Type *e)
 Delete vector of types.
 
void vc_setBoolFlag (Flags flags, char *name, int val)
 Set a boolean flag to true or false.
 
void vc_setIntFlag (Flags flags, char *name, int val)
 Set an integer flag to the given value.
 
void vc_setStringFlag (Flags flags, char *name, char *val)
 Set a string flag to the given value.
 
void vc_setStrSeqFlag (Flags flags, char *name, char *str, int val)
 Add a (string, bool) pair to the multy-string flag.
 
Type vc_boolType (VC vc)
 
Type vc_realType (VC vc)
 
Type vc_intType (VC vc)
 
Type vc_subRangeType (VC vc, int lowerEnd, int upperEnd)
 Create a subrange type.
 
Type vc_subtypeType (VC vc, Expr pred, Expr witness)
 Creates a subtype defined by the given predicate.
 
Type vc_tupleType2 (VC vc, Type type0, Type type1)
 
Type vc_tupleType3 (VC vc, Type type0, Type type1, Type type2)
 
Type vc_tupleTypeN (VC vc, Type *types, int numTypes)
 Create a tuple type. 'types' is an array of types of length numTypes.
 
Type vc_recordType1 (VC vc, char *field, Type type)
 
Type vc_recordType2 (VC vc, char *field0, Type type0, char *field1, Type type1)
 
Type vc_recordType3 (VC vc, char *field0, Type type0, char *field1, Type type1, char *field2, Type type2)
 
Type vc_recordTypeN (VC vc, char **fields, Type *types, int numFields)
 Create a record type.
 
Type vc_dataType1 (VC vc, char *name, char *constructor, int arity, char **selectors, Expr *types)
 Single datatype, single constructor.
 
Type vc_dataTypeN (VC vc, char *name, int numCons, char **constructors, int *arities, char ***selectors, Expr **types)
 Single datatype, multiple constructors.
 
Typevc_dataTypeMN (VC vc, int numTypes, char **names, int *numCons, char ***constructors, int **arities, char ****selectors, Expr ***types)
 Multiple datatypes.
 
Type vc_arrayType (VC vc, Type typeIndex, Type typeData)
 Create an array type.
 
Type vc_bvType (VC vc, int n)
 Create a bitvector type of length n.
 
Type vc_funType1 (VC vc, Type a1, Type typeRan)
 Create a function type with 1 argument.
 
Type vc_funType2 (VC vc, Type a1, Type a2, Type typeRan)
 Create a function type with 2 arguments.
 
Type vc_funType3 (VC vc, Type a1, Type a2, Type a3, Type typeRan)
 Create a function type with 3 arguments.
 
Type vc_funTypeN (VC vc, Type *args, Type typeRan, int numArgs)
 Create a function type with N arguments.
 
Type vc_createType (VC vc, char *typeName)
 Create an uninterpreted named type.
 
Type vc_lookupType (VC vc, char *typeName)
 Lookup a user-defined (uninterpreted) type by name.
 
ExprManagervc_getEM (VC vc)
 Return the ExprManager.
 
Expr vc_varExpr (VC vc, char *name, Type type)
 Create a variable with a given name and type.
 
Expr vc_varExprDef (VC vc, char *name, Type type, Expr def)
 Create a variable with a given name, type, and value.
 
Expr vc_lookupVar (VC vc, char *name, Type *type)
 Get the expression and type associated with a name.
 
Type vc_getType (VC vc, Expr e)
 Get the type of the Expr.
 
Type vc_getBaseType (VC vc, Expr e)
 Get the largest supertype of the Expr.
 
Type vc_getBaseTypeOfType (VC vc, Type t)
 Get the largest supertype of the Type.
 
Expr vc_getTypePred (VC vc, Type t, Expr e)
 Get the subtype predicate.
 
Expr vc_stringExpr (VC vc, char *str)
 Create a string Expr.
 
Expr vc_idExpr (VC vc, char *name)
 Create an ID Expr.
 
Expr vc_listExpr (VC vc, int numKids, Expr *kids)
 Create a list Expr.
 
void vc_printExpr (VC vc, Expr e)
 Expr vc_parseExpr(VC vc, char* s);.
 
char * vc_printExprString (VC vc, Expr e)
 Print e into a char*.
 
void vc_deleteString (char *str)
 Delete char* returned by previous function.
 
void vc_printExprFile (VC vc, Expr e, int fd)
 Print 'e' into an open file descriptor.
 
Expr vc_importExpr (VC vc, Expr e)
 Import the Expr from another instance of VC.
 
Type vc_importType (Type t)
 Import the Type from another instance of VC.
 
Expr vc_eqExpr (VC vc, Expr child0, Expr child1)
 Create an equality expression. The two children must have the same type.
 
Expr vc_distinctExpr (VC vc, Expr *children, int numChildren)
 Create an all distinct expression. All children must ahve the same type.
 
Expr vc_trueExpr (VC vc)
 
Expr vc_falseExpr (VC vc)
 
Expr vc_notExpr (VC vc, Expr child)
 
Expr vc_andExpr (VC vc, Expr left, Expr right)
 
Expr vc_andExprN (VC vc, Expr *children, int numChildren)
 
Expr vc_orExpr (VC vc, Expr left, Expr right)
 
Expr vc_orExprN (VC vc, Expr *children, int numChildren)
 
Expr vc_impliesExpr (VC vc, Expr hyp, Expr conc)
 
Expr vc_iffExpr (VC vc, Expr left, Expr right)
 
Expr vc_iteExpr (VC vc, Expr ifpart, Expr thenpart, Expr elsepart)
 
Expr vc_substExpr (VC vc, Expr e, Expr *oldTerms, int numOldTerms, Expr *newTerms, int numNewTerms)
 
Op vc_createOp (VC vc, char *name, Type type)
 Create an operator from a function with a given name and type.
 
Op vc_createOpDef (VC vc, char *name, Type type, Expr def)
 Create a named user-defined function with a given type.
 
Op vc_lookupOp (VC vc, char *name, Type *type)
 Lookup an operator by name.
 
Expr vc_funExpr1 (VC vc, Op op, Expr child)
 Create expressions with a user-defined operator.
 
Expr vc_funExpr2 (VC vc, Op op, Expr left, Expr right)
 
Expr vc_funExpr3 (VC vc, Op op, Expr child0, Expr child1, Expr child2)
 
Expr vc_funExprN (VC vc, Op op, Expr *children, int numChildren)
 
Expr vc_ratExpr (VC vc, int n, int d)
 Create a rational number with numerator n and denominator d.
 
Expr vc_ratExprFromStr (VC vc, char *n, char *d, int base)
 Create a rational number n/d; n and d are given as strings.
 
Expr vc_ratExprFromStr1 (VC vc, char *n, int base)
 Create a rational from a single string.
 
Expr vc_uminusExpr (VC vc, Expr child)
 Unary minus. Child must have a numeric type.
 
Expr vc_plusExpr (VC vc, Expr left, Expr right)
 
Expr vc_plusExprN (VC vc, Expr *children, int numChildren)
 
Expr vc_minusExpr (VC vc, Expr left, Expr right)
 
Expr vc_multExpr (VC vc, Expr left, Expr right)
 
Expr vc_powExpr (VC vc, Expr pow, Expr base)
 
Expr vc_divideExpr (VC vc, Expr numerator, Expr denominator)
 
Expr vc_ltExpr (VC vc, Expr left, Expr right)
 
Expr vc_leExpr (VC vc, Expr left, Expr right)
 
Expr vc_gtExpr (VC vc, Expr left, Expr right)
 
Expr vc_geExpr (VC vc, Expr left, Expr right)
 
Expr vc_recordExpr1 (VC vc, char *field, Expr expr)
 
Expr vc_recordExpr2 (VC vc, char *field0, Expr expr0, char *field1, Expr expr1)
 
Expr vc_recordExpr3 (VC vc, char *field0, Expr expr0, char *field1, Expr expr1, char *field2, Expr expr2)
 
Expr vc_recordExprN (VC vc, char **fields, Expr *exprs, int numFields)
 
Expr vc_recSelectExpr (VC vc, Expr record, char *field)
 Create an expression representing the selection of a field from a record.
 
Expr vc_recUpdateExpr (VC vc, Expr record, char *field, Expr newValue)
 Record update; equivalent to "record WITH .field := newValue".
 
Expr vc_readExpr (VC vc, Expr array, Expr index)
 Create an expression for the value of array at the given index.
 
Expr vc_writeExpr (VC vc, Expr array, Expr index, Expr newValue)
 Array update; equivalent to "array WITH [index] := newValue".
 
Type vc_bv32Type (VC vc)
 
Expr vc_bvConstExprFromStr (VC vc, char *binary_repr)
 
Expr vc_bvConstExprFromInt (VC vc, int n_bits, unsigned int value)
 
Expr vc_bv32ConstExprFromInt (VC vc, unsigned int value)
 
Expr vc_bvConstExprFromLL (VC vc, int n_bits, unsigned long value)
 
Expr vc_bvConcatExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvConcatExprN (VC vc, Expr *children, int numChildren)
 
Expr vc_bvExtract (VC vc, Expr child, int high_bit_no, int low_bit_no)
 
Expr vc_bvBoolExtract (VC vc, Expr child, int bit_no)
 
Expr vc_bvNotExpr (VC vc, Expr child)
 
Expr vc_bvAndExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvOrExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvXorExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvLtExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvLeExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvGtExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvGeExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSLtExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSLeExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSGtExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSGeExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSignExtend (VC vc, Expr child, int nbits)
 
Expr vc_bvUMinusExpr (VC vc, Expr child)
 
Expr vc_bvPlusExpr (VC vc, int n_bits, Expr left, Expr right)
 
Expr vc_bv32PlusExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvMinusExpr (VC vc, int n_bits, Expr left, Expr right)
 
Expr vc_bv32MinusExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvMultExpr (VC vc, int n_bits, Expr left, Expr right)
 
Expr vc_bv32MultExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvUDivExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvURemExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSDivExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSRemExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvSModExpr (VC vc, Expr left, Expr right)
 
Expr vc_bvLeftShiftExpr (VC vc, int sh_amt, Expr child)
 
Expr vc_bvRightShiftExpr (VC vc, int sh_amt, Expr child)
 
Expr vc_bv32LeftShiftExpr (VC vc, int sh_amt, Expr child)
 
Expr vc_bv32RightShiftExpr (VC vc, int sh_amt, Expr child)
 
Expr vc_bvVar32LeftShiftExpr (VC vc, Expr sh_amt, Expr child)
 
Expr vc_bvVar32RightShiftExpr (VC vc, Expr sh_amt, Expr child)
 
Expr vc_bvVar32DivByPowOfTwoExpr (VC vc, Expr child, Expr rhs)
 
Expr vc_bvCreateMemoryArray (VC vc, char *arrayName)
 
Expr vc_bvReadMemoryArray (VC vc, Expr array, Expr byteIndex, int numOfBytes)
 
Expr vc_bvWriteToMemoryArray (VC vc, Expr array, Expr byteIndex, Expr element, int numOfBytes)
 
Expr vc_tupleExprN (VC vc, Expr *children, int numChildren)
 Create a tuple expression.
 
Expr vc_tupleSelectExpr (VC vc, Expr tuple, int index)
 Tuple select; equivalent to "tuple.n", where n is an numeral (e.g. tup.5)
 
Expr vc_tupleUpdateExpr (VC vc, Expr tuple, int index, Expr newValue)
 Tuple update; equivalent to "tuple WITH index := newValue".
 
Expr vc_datatypeConsExpr (VC vc, char *constructor, int numArgs, Expr *args)
 Datatype constructor expression.
 
Expr vc_datatypeSelExpr (VC vc, char *selector, Expr arg)
 Datatype selector expression.
 
Expr vc_datatypeTestExpr (VC vc, char *constructor, Expr arg)
 Datatype tester expression.
 
Expr vc_boundVarExpr (VC vc, char *name, char *uid, Type type)
 Create a bound variable.
 
Type vc_forallExpr (VC vc, Expr *Bvars, int numBvars, Expr f)
 Create a FORALL quantifier.
 
void vc_setTriggers (VC vc, Expr e, int numTrigs, Expr *triggers)
 Set triggers for a forallExpr.
 
Expr vc_existsExpr (VC vc, Expr *Bvars, int numBvars, Expr f)
 Create an EXISTS quantifier.
 
Op vc_lambdaExpr (VC vc, int numVars, Expr *vars, Expr body)
 Lambda-expression.
 
void vc_setResourceLimit (VC vc, unsigned limit)
 Set the resource limit (0==unlimited, 1==exhausted).
 
void vc_assertFormula (VC vc, Expr e)
 Assert a new formula in the current context.
 
void vc_registerAtom (VC vc, Expr e)
 Register an atomic formula of interest.
 
Expr vc_getImpliedLiteral (VC vc)
 Return next literal implied by last assertion. Null if none.
 
Expr vc_simplify (VC vc, Expr e)
 Simplify e with respect to the current context.
 
int vc_query (VC vc, Expr e)
 Check validity of e in the current context.
 
int vc_checkContinue (VC vc)
 Get the next model.
 
int vc_restart (VC vc, Expr e)
 Restart the most recent query with e as an additional assertion.
 
void vc_returnFromCheck (VC vc)
 Returns to context immediately before last invalid query.
 
Exprvc_getUserAssumptions (VC vc, int *size)
 Get assumptions made by the user in this and all previous contexts.
 
Exprvc_getInternalAssumptions (VC vc, int *size)
 Get assumptions made internally in this and all previous contexts.
 
Exprvc_getAssumptions (VC vc, int *size)
 Get all assumptions made in this and all previous contexts.
 
Expr vc_getProofAssumptions (VC vc)
 
Expr vc_getProofQuery (VC vc)
 
Exprvc_getAssumptionsUsed (VC vc, int *size)
 Returns the set of assumptions used in the proof of queried formula.
 
Exprvc_getCounterExample (VC vc, int *size)
 Return the counterexample after a failed query.
 
Exprvc_getConcreteModel (VC vc, int *size)
 Will assign concrete values to all user created variables.
 
int vc_inconsistent (VC vc, Expr **assumptions, int *size)
 
char * vc_incomplete (VC vc)
 Returns non-NULL if the invalid result from last query() is imprecise.
 
Expr vc_getProof (VC vc)
 Returns the proof for the last proven query.
 
Expr vc_getProofOfFile (VC vc, char *filename)
 Returns the proof of a .cvc file, if it is valid.
 
Expr vc_getTCC (VC vc)
 Returns the TCC of the last assumption or query.
 
Exprvc_getAssumptionsTCC (VC vc, int *size)
 Return the set of assumptions used in the proof of the last TCC.
 
Expr vc_getProofTCC (VC vc)
 Returns the proof of TCC of the last assumption or query.
 
Expr vc_getClosure (VC vc)
 After successful query, return its closure |- Gamma => phi.
 
Expr vc_getProofClosure (VC vc)
 Construct a proof of the query closure |- Gamma => phi.
 
int vc_stackLevel (VC vc)
 Returns the current stack level. Initial level is 0.
 
void vc_push (VC vc)
 Checkpoint the current context and increase the scope level.
 
void vc_pop (VC vc)
 Restore the current context to its state at the last checkpoint.
 
void vc_popto (VC vc, int stackLevel)
 Restore the current context to the given stackLevel.
 
Contextvc_getCurrentContext (VC vc)
 Get the current context.
 
int vc_compare_exprs (Expr e1, Expr e2)
 Compares two expressions.
 
char * vc_exprString (Expr e)
 Convert Expr to string.
 
char * vc_typeString (Type t)
 Convert Type to string.
 
int vc_isClosure (Expr e)
 
int vc_isQuantifier (Expr e)
 
int vc_isLambda (Expr e)
 
Expr vc_isVar (Expr e)
 
int vc_arity (Expr e)
 
int vc_getKind (Expr e)
 
Expr vc_getChild (Expr e, int i)
 
int vc_getNumVars (Expr e)
 
Expr vc_getVar (Expr e, int i)
 
Expr vc_getBody (Expr e)
 
Expr vc_getExistential (Expr e)
 
Expr vc_getFun (VC vc, Expr e)
 
Expr vc_toExpr (Type t)
 
const char * vc_getKindString (VC vc, int kind)
 Translate a kind int to a string.
 
int vc_getKindInt (VC vc, char *kind_name)
 Translate a kind string to an int.
 
int vc_getInt (Expr e)
 Return an int from a rational expression.
 
int vc_getBVInt (VC vc, Expr e)
 Return an int from a constant bitvector expression.
 
unsigned int vc_getBVUnsigned (VC vc, Expr e)
 Return an unsigned int from a constant bitvector expression.
 
int vc_get_error_status ()
 
void vc_reset_error_status ()
 
char * vc_get_error_string ()
 
void vc_print_statistics (VC vc)
 Print statistics.
 

Detailed Description

Authors: Clark Barrett Cristian Cadar

Created: Thu Jun 5 10:34:02 2003


License to use, copy, modify, sell and/or distribute this software and its documentation for any purpose is hereby granted without royalty, subject to the terms and conditions defined in the COPYING file provided with this distribution.


Definition in file c_interface.h.

Function Documentation

◆ vc_andExpr()

Expr vc_andExpr ( VC vc,
Expr left,
Expr right )

◆ vc_andExprN()

Expr vc_andExprN ( VC vc,
Expr * children,
int numChildren )

◆ vc_arity()

int vc_arity ( Expr e)

◆ vc_arrayType()

Type vc_arrayType ( VC vc,
Type typeIndex,
Type typeData )

Create an array type.

◆ vc_assertFormula()

void vc_assertFormula ( VC vc,
Expr e )

Assert a new formula in the current context.

The formula must have Boolean type.

◆ vc_boolType()

Type vc_boolType ( VC vc)

◆ vc_boundVarExpr()

Expr vc_boundVarExpr ( VC vc,
char * name,
char * uid,
Type type )

Create a bound variable.

Parameters
vcthe validity checker
name
uidis a fresh unique string to distinguish this variable from other bound variables with the same name
type

◆ vc_bv32ConstExprFromInt()

Expr vc_bv32ConstExprFromInt ( VC vc,
unsigned int value )

◆ vc_bv32LeftShiftExpr()

Expr vc_bv32LeftShiftExpr ( VC vc,
int sh_amt,
Expr child )

◆ vc_bv32MinusExpr()

Expr vc_bv32MinusExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bv32MultExpr()

Expr vc_bv32MultExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bv32PlusExpr()

Expr vc_bv32PlusExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bv32RightShiftExpr()

Expr vc_bv32RightShiftExpr ( VC vc,
int sh_amt,
Expr child )

◆ vc_bv32Type()

Type vc_bv32Type ( VC vc)

◆ vc_bvAndExpr()

Expr vc_bvAndExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvBoolExtract()

Expr vc_bvBoolExtract ( VC vc,
Expr child,
int bit_no )

◆ vc_bvConcatExpr()

Expr vc_bvConcatExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvConcatExprN()

Expr vc_bvConcatExprN ( VC vc,
Expr * children,
int numChildren )

◆ vc_bvConstExprFromInt()

Expr vc_bvConstExprFromInt ( VC vc,
int n_bits,
unsigned int value )

◆ vc_bvConstExprFromLL()

Expr vc_bvConstExprFromLL ( VC vc,
int n_bits,
unsigned long value )

◆ vc_bvConstExprFromStr()

Expr vc_bvConstExprFromStr ( VC vc,
char * binary_repr )

◆ vc_bvCreateMemoryArray()

Expr vc_bvCreateMemoryArray ( VC vc,
char * arrayName )

◆ vc_bvExtract()

Expr vc_bvExtract ( VC vc,
Expr child,
int high_bit_no,
int low_bit_no )

◆ vc_bvGeExpr()

Expr vc_bvGeExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvGtExpr()

Expr vc_bvGtExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvLeExpr()

Expr vc_bvLeExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvLeftShiftExpr()

Expr vc_bvLeftShiftExpr ( VC vc,
int sh_amt,
Expr child )

◆ vc_bvLtExpr()

Expr vc_bvLtExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvMinusExpr()

Expr vc_bvMinusExpr ( VC vc,
int n_bits,
Expr left,
Expr right )

◆ vc_bvMultExpr()

Expr vc_bvMultExpr ( VC vc,
int n_bits,
Expr left,
Expr right )

◆ vc_bvNotExpr()

Expr vc_bvNotExpr ( VC vc,
Expr child )

◆ vc_bvOrExpr()

Expr vc_bvOrExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvPlusExpr()

Expr vc_bvPlusExpr ( VC vc,
int n_bits,
Expr left,
Expr right )

◆ vc_bvReadMemoryArray()

Expr vc_bvReadMemoryArray ( VC vc,
Expr array,
Expr byteIndex,
int numOfBytes )

◆ vc_bvRightShiftExpr()

Expr vc_bvRightShiftExpr ( VC vc,
int sh_amt,
Expr child )

◆ vc_bvSDivExpr()

Expr vc_bvSDivExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvSGeExpr()

Expr vc_bvSGeExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvSGtExpr()

Expr vc_bvSGtExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvSignExtend()

Expr vc_bvSignExtend ( VC vc,
Expr child,
int nbits )

◆ vc_bvSLeExpr()

Expr vc_bvSLeExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvSLtExpr()

Expr vc_bvSLtExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvSModExpr()

Expr vc_bvSModExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvSRemExpr()

Expr vc_bvSRemExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvType()

Type vc_bvType ( VC vc,
int n )

Create a bitvector type of length n.

◆ vc_bvUDivExpr()

Expr vc_bvUDivExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvUMinusExpr()

Expr vc_bvUMinusExpr ( VC vc,
Expr child )

◆ vc_bvURemExpr()

Expr vc_bvURemExpr ( VC vc,
Expr left,
Expr right )

◆ vc_bvVar32DivByPowOfTwoExpr()

Expr vc_bvVar32DivByPowOfTwoExpr ( VC vc,
Expr child,
Expr rhs )

◆ vc_bvVar32LeftShiftExpr()

Expr vc_bvVar32LeftShiftExpr ( VC vc,
Expr sh_amt,
Expr child )

◆ vc_bvVar32RightShiftExpr()

Expr vc_bvVar32RightShiftExpr ( VC vc,
Expr sh_amt,
Expr child )

◆ vc_bvWriteToMemoryArray()

Expr vc_bvWriteToMemoryArray ( VC vc,
Expr array,
Expr byteIndex,
Expr element,
int numOfBytes )

◆ vc_bvXorExpr()

Expr vc_bvXorExpr ( VC vc,
Expr left,
Expr right )

◆ vc_checkContinue()

int vc_checkContinue ( VC vc)

Get the next model.

This method should only be called after a query which returns 0. Its return values are as for vc_query().

◆ vc_compare_exprs()

int vc_compare_exprs ( Expr e1,
Expr e2 )

Compares two expressions.

If e1 < e2, e1==e2, and e1 > e2, it returns -1, 0, 1 respectively. A return value of -100 signals an error (refer to vc_get_error_string() for details).

Can't be 'compare' because already defined in ocaml

◆ vc_createFlags()

Flags vc_createFlags ( )

Create validity checker's flags.

◆ vc_createOp()

Op vc_createOp ( VC vc,
char * name,
Type type )

Create an operator from a function with a given name and type.

Name is given as an ID Expr, and the type must be a function type.

◆ vc_createOpDef()

Op vc_createOpDef ( VC vc,
char * name,
Type type,
Expr def )

Create a named user-defined function with a given type.

◆ vc_createType()

Type vc_createType ( VC vc,
char * typeName )

Create an uninterpreted named type.

◆ vc_createValidityChecker()

VC vc_createValidityChecker ( Flags flags)

Flags can be NULL.

◆ vc_dataType1()

Type vc_dataType1 ( VC vc,
char * name,
char * constructor,
int arity,
char ** selectors,
Expr * types )

Single datatype, single constructor.

The types are either type exressions (obtained from a type with getExpr()) or string expressions containing the name of (one of) the dataType(s) being defined.

◆ vc_datatypeConsExpr()

Expr vc_datatypeConsExpr ( VC vc,
char * constructor,
int numArgs,
Expr * args )

Datatype constructor expression.

◆ vc_dataTypeMN()

Type * vc_dataTypeMN ( VC vc,
int numTypes,
char ** names,
int * numCons,
char *** constructors,
int ** arities,
char **** selectors,
Expr *** types )

Multiple datatypes.

The types are either type exressions (obtained from a type with getExpr()) or string expressions containing the name of (one of) the dataType(s) being defined. Returns an array of size numTypes which must be freed by calling vc_deleteTypeVector.

◆ vc_dataTypeN()

Type vc_dataTypeN ( VC vc,
char * name,
int numCons,
char ** constructors,
int * arities,
char *** selectors,
Expr ** types )

Single datatype, multiple constructors.

The types are either type exressions (obtained from a type with getExpr()) or string expressions containing the name of (one of) the dataType(s) being defined.

◆ vc_datatypeSelExpr()

Expr vc_datatypeSelExpr ( VC vc,
char * selector,
Expr arg )

Datatype selector expression.

◆ vc_datatypeTestExpr()

Expr vc_datatypeTestExpr ( VC vc,
char * constructor,
Expr arg )

Datatype tester expression.

◆ vc_deleteExpr()

void vc_deleteExpr ( Expr e)

Delete expression.

◆ vc_deleteFlags()

void vc_deleteFlags ( Flags flags)

Delete the flags.

◆ vc_deleteOp()

void vc_deleteOp ( Op op)

Delete operator.

◆ vc_deleteString()

void vc_deleteString ( char * str)

Delete char* returned by previous function.

◆ vc_deleteType()

void vc_deleteType ( Type t)

Delete type.

◆ vc_deleteTypeVector()

void vc_deleteTypeVector ( Type * e)

Delete vector of types.

◆ vc_deleteVector()

void vc_deleteVector ( Expr * e)

Delete vector of expressions.

◆ vc_destroyValidityChecker()

void vc_destroyValidityChecker ( VC vc)

Destroy the validity checker.

Must be called after all other objects are deleted, except the flags

◆ vc_distinctExpr()

Expr vc_distinctExpr ( VC vc,
Expr * children,
int numChildren )

Create an all distinct expression. All children must ahve the same type.

◆ vc_divideExpr()

Expr vc_divideExpr ( VC vc,
Expr numerator,
Expr denominator )

◆ vc_eqExpr()

Expr vc_eqExpr ( VC vc,
Expr child0,
Expr child1 )

Create an equality expression. The two children must have the same type.

◆ vc_existsExpr()

Expr vc_existsExpr ( VC vc,
Expr * Bvars,
int numBvars,
Expr f )

Create an EXISTS quantifier.

Bvars is an array of bound variables of length numBvars.

◆ vc_exprString()

char * vc_exprString ( Expr e)

Convert Expr to string.

◆ vc_falseExpr()

Expr vc_falseExpr ( VC vc)

◆ vc_forallExpr()

Type vc_forallExpr ( VC vc,
Expr * Bvars,
int numBvars,
Expr f )

Create a FORALL quantifier.

Bvars is an array of bound variables of length numBvars.

◆ vc_funExpr1()

Expr vc_funExpr1 ( VC vc,
Op op,
Expr child )

Create expressions with a user-defined operator.

op must have a function type.

◆ vc_funExpr2()

Expr vc_funExpr2 ( VC vc,
Op op,
Expr left,
Expr right )

◆ vc_funExpr3()

Expr vc_funExpr3 ( VC vc,
Op op,
Expr child0,
Expr child1,
Expr child2 )

◆ vc_funExprN()

Expr vc_funExprN ( VC vc,
Op op,
Expr * children,
int numChildren )

◆ vc_funType1()

Type vc_funType1 ( VC vc,
Type a1,
Type typeRan )

Create a function type with 1 argument.

◆ vc_funType2()

Type vc_funType2 ( VC vc,
Type a1,
Type a2,
Type typeRan )

Create a function type with 2 arguments.

◆ vc_funType3()

Type vc_funType3 ( VC vc,
Type a1,
Type a2,
Type a3,
Type typeRan )

Create a function type with 3 arguments.

◆ vc_funTypeN()

Type vc_funTypeN ( VC vc,
Type * args,
Type typeRan,
int numArgs )

Create a function type with N arguments.

◆ vc_geExpr()

Expr vc_geExpr ( VC vc,
Expr left,
Expr right )

◆ vc_get_error_status()

int vc_get_error_status ( )

◆ vc_get_error_string()

char * vc_get_error_string ( )

◆ vc_getAssumptions()

Expr * vc_getAssumptions ( VC vc,
int * size )

Get all assumptions made in this and all previous contexts.

The caller is responsible for freeing the array when finished with it by calling vc_deleteVector.

◆ vc_getAssumptionsTCC()

Expr * vc_getAssumptionsTCC ( VC vc,
int * size )

Return the set of assumptions used in the proof of the last TCC.

The caller is responsible for freeing the array when finished with it by calling vc_deleteVector.

◆ vc_getAssumptionsUsed()

Expr * vc_getAssumptionsUsed ( VC vc,
int * size )

Returns the set of assumptions used in the proof of queried formula.

It returns a subset of getAssumptions(). If the last query was false or there has not yet been a query, it does nothing. The caller is responsible for freeing the array when finished with it by calling vc_deleteVector.

◆ vc_getBaseType()

Type vc_getBaseType ( VC vc,
Expr e )

Get the largest supertype of the Expr.

◆ vc_getBaseTypeOfType()

Type vc_getBaseTypeOfType ( VC vc,
Type t )

Get the largest supertype of the Type.

◆ vc_getBody()

Expr vc_getBody ( Expr e)

◆ vc_getBVInt()

int vc_getBVInt ( VC vc,
Expr e )

Return an int from a constant bitvector expression.

◆ vc_getBVUnsigned()

unsigned int vc_getBVUnsigned ( VC vc,
Expr e )

Return an unsigned int from a constant bitvector expression.

◆ vc_getChild()

Expr vc_getChild ( Expr e,
int i )

◆ vc_getClosure()

Expr vc_getClosure ( VC vc)

After successful query, return its closure |- Gamma => phi.

Turn a valid query Gamma |- phi into an implication |- Gamma => phi.

Returns Null Expr if last query was invalid.

◆ vc_getConcreteModel()

Expr * vc_getConcreteModel ( VC vc,
int * size )

Will assign concrete values to all user created variables.

This function should only be called after a query which return false. Returns an array of Exprs with size *size. The caller is responsible for freeing the array when finished with it by calling vc_deleteVector.

◆ vc_getCounterExample()

Expr * vc_getCounterExample ( VC vc,
int * size )

Return the counterexample after a failed query.

This method should only be called after a query which returns false. It will try to return the simplest possible set of assertions which are sufficient to make the queried expression false. The caller is responsible for freeing the array when finished with it by calling vc_deleteVector.

◆ vc_getCurrentContext()

Context * vc_getCurrentContext ( VC vc)

Get the current context.

◆ vc_getEM()

ExprManager * vc_getEM ( VC vc)

Return the ExprManager.

◆ vc_getExistential()

Expr vc_getExistential ( Expr e)

◆ vc_getFun()

Expr vc_getFun ( VC vc,
Expr e )

◆ vc_getImpliedLiteral()

Expr vc_getImpliedLiteral ( VC vc)

Return next literal implied by last assertion. Null if none.

Returned literals are either registered atomic formulas or their negation

◆ vc_getInt()

int vc_getInt ( Expr e)

Return an int from a rational expression.

◆ vc_getInternalAssumptions()

Expr * vc_getInternalAssumptions ( VC vc,
int * size )

Get assumptions made internally in this and all previous contexts.

Internal assumptions are literals assumed by the sat solver. The caller is responsible for freeing the array when finished with it by calling vc_deleteVector.

◆ vc_getKind()

int vc_getKind ( Expr e)

◆ vc_getKindInt()

int vc_getKindInt ( VC vc,
char * kind_name )

Translate a kind string to an int.

◆ vc_getKindString()

const char * vc_getKindString ( VC vc,
int kind )

Translate a kind int to a string.

◆ vc_getNumVars()

int vc_getNumVars ( Expr e)

◆ vc_getProof()

Expr vc_getProof ( VC vc)

Returns the proof for the last proven query.

◆ vc_getProofAssumptions()

Expr vc_getProofAssumptions ( VC vc)

◆ vc_getProofClosure()

Expr vc_getProofClosure ( VC vc)

Construct a proof of the query closure |- Gamma => phi.

Returns Null if last query was Invalid.

◆ vc_getProofOfFile()

Expr vc_getProofOfFile ( VC vc,
char * filename )

Returns the proof of a .cvc file, if it is valid.

◆ vc_getProofQuery()

Expr vc_getProofQuery ( VC vc)

◆ vc_getProofTCC()

Expr vc_getProofTCC ( VC vc)

Returns the proof of TCC of the last assumption or query.

Returns Null Expr if no assumptions or queries were performed.

◆ vc_getTCC()

Expr vc_getTCC ( VC vc)

Returns the TCC of the last assumption or query.

Returns Null Expr if no assumptions or queries were performed.

◆ vc_getType()

Type vc_getType ( VC vc,
Expr e )

Get the type of the Expr.

◆ vc_getTypePred()

Expr vc_getTypePred ( VC vc,
Type t,
Expr e )

Get the subtype predicate.

◆ vc_getUserAssumptions()

Expr * vc_getUserAssumptions ( VC vc,
int * size )

Get assumptions made by the user in this and all previous contexts.

User assumptions are created either by calls to assertFormula or by a call to query. In the latter case, the negated query is added as an assumption. The caller is responsible for freeing the array when finished with it.

◆ vc_getVar()

Expr vc_getVar ( Expr e,
int i )

◆ vc_gtExpr()

Expr vc_gtExpr ( VC vc,
Expr left,
Expr right )

◆ vc_idExpr()

Expr vc_idExpr ( VC vc,
char * name )

Create an ID Expr.

◆ vc_iffExpr()

Expr vc_iffExpr ( VC vc,
Expr left,
Expr right )

◆ vc_impliesExpr()

Expr vc_impliesExpr ( VC vc,
Expr hyp,
Expr conc )

◆ vc_importExpr()

Expr vc_importExpr ( VC vc,
Expr e )

Import the Expr from another instance of VC.

When expressions need to be passed among several instances of VC, they need to be explicitly imported into the corresponding instance using this method. The return result is an identical expression that belongs to the current instance of VC, and can be safely used as part of more complex expressions from the same instance.

Parameters
vcis the instance to be imported into
eis the expression created using a different (not vc) instance

◆ vc_importType()

Type vc_importType ( Type t)

Import the Type from another instance of VC.

See also
vc_importExpr()

◆ vc_incomplete()

char * vc_incomplete ( VC vc)

Returns non-NULL if the invalid result from last query() is imprecise.

The return value is filled with the reasons for incompleteness (it is intended to be shown to the end user). The caller is responsible for freeing the string returned by calling vc_deleteString.

◆ vc_inconsistent()

int vc_inconsistent ( VC vc,
Expr ** assumptions,
int * size )

Also returns a minimal set of assertions used to determine the inconsistency. The caller is responsible for freeing the array when finished with it by calling vc_deleteVector.

◆ vc_intType()

Type vc_intType ( VC vc)

◆ vc_isClosure()

int vc_isClosure ( Expr e)

◆ vc_isLambda()

int vc_isLambda ( Expr e)

◆ vc_isQuantifier()

int vc_isQuantifier ( Expr e)

◆ vc_isVar()

Expr vc_isVar ( Expr e)

◆ vc_iteExpr()

Expr vc_iteExpr ( VC vc,
Expr ifpart,
Expr thenpart,
Expr elsepart )

◆ vc_lambdaExpr()

Op vc_lambdaExpr ( VC vc,
int numVars,
Expr * vars,
Expr body )

Lambda-expression.

◆ vc_leExpr()

Expr vc_leExpr ( VC vc,
Expr left,
Expr right )

◆ vc_listExpr()

Expr vc_listExpr ( VC vc,
int numKids,
Expr * kids )

Create a list Expr.

Intermediate representation for DP-specific expressions. Normally, the first element of the list is a string Expr representing an operator, and the rest of the list are the arguments. For example,

kids.push_back(vc->stringExpr("PLUS")); kids.push_back(x); // x and y are previously created Exprs kids.push_back(y); Expr lst = vc->listExpr(kids);

Or, alternatively (using its overloaded version):

Expr lst = vc->listExpr("PLUS", x, y);

or

vector<Expr> summands; summands.push_back(x); summands.push_back(y); ... Expr lst = vc->listExpr("PLUS", summands);

◆ vc_lookupOp()

Op vc_lookupOp ( VC vc,
char * name,
Type * type )

Lookup an operator by name.

Returns the operator and the type if the operator exists. Returns NULL otherwise

◆ vc_lookupType()

Type vc_lookupType ( VC vc,
char * typeName )

Lookup a user-defined (uninterpreted) type by name.

◆ vc_lookupVar()

Expr vc_lookupVar ( VC vc,
char * name,
Type * type )

Get the expression and type associated with a name.

If there is no such Expr, a NULL Expr is returned.

◆ vc_ltExpr()

Expr vc_ltExpr ( VC vc,
Expr left,
Expr right )

◆ vc_minusExpr()

Expr vc_minusExpr ( VC vc,
Expr left,
Expr right )

◆ vc_multExpr()

Expr vc_multExpr ( VC vc,
Expr left,
Expr right )

◆ vc_notExpr()

Expr vc_notExpr ( VC vc,
Expr child )

◆ vc_orExpr()

Expr vc_orExpr ( VC vc,
Expr left,
Expr right )

◆ vc_orExprN()

Expr vc_orExprN ( VC vc,
Expr * children,
int numChildren )

◆ vc_plusExpr()

Expr vc_plusExpr ( VC vc,
Expr left,
Expr right )

◆ vc_plusExprN()

Expr vc_plusExprN ( VC vc,
Expr * children,
int numChildren )

◆ vc_pop()

void vc_pop ( VC vc)

Restore the current context to its state at the last checkpoint.

◆ vc_popto()

void vc_popto ( VC vc,
int stackLevel )

Restore the current context to the given stackLevel.

stackLevel must be less than or equal to the current stack level.

◆ vc_powExpr()

Expr vc_powExpr ( VC vc,
Expr pow,
Expr base )

◆ vc_print_statistics()

void vc_print_statistics ( VC vc)

Print statistics.

◆ vc_printExpr()

void vc_printExpr ( VC vc,
Expr e )

Expr vc_parseExpr(VC vc, char* s);.

◆ vc_printExprFile()

void vc_printExprFile ( VC vc,
Expr e,
int fd )

Print 'e' into an open file descriptor.

◆ vc_printExprString()

char * vc_printExprString ( VC vc,
Expr e )

Print e into a char*.

Note that the ownership of the char* is given to the caller which should free the memory when it is done with it. This can be done by calling vc_deleteString.

◆ vc_push()

void vc_push ( VC vc)

Checkpoint the current context and increase the scope level.

◆ vc_query()

int vc_query ( VC vc,
Expr e )

Check validity of e in the current context.

Possible results are: 0 = invalid, 1 = valid, 2 = abort, 3 = unknown, -100 = exception (type error, internal error, etc). If the result is 1, then the resulting context is the same as the starting context. If the result is 0 or 3, then the resulting context is a context in which e is false (though the context may be inconsistent in the case of an unknown result). e must have Boolean type. In the case of a result of -100, refer to vc_get_error_string() to see what went wrong.

◆ vc_ratExpr()

Expr vc_ratExpr ( VC vc,
int n,
int d )

Create a rational number with numerator n and denominator d.

d cannot be 0.

◆ vc_ratExprFromStr()

Expr vc_ratExprFromStr ( VC vc,
char * n,
char * d,
int base )

Create a rational number n/d; n and d are given as strings.

n and d are converted to arbitrary-precision integers according to the given base. d cannot be 0.

◆ vc_ratExprFromStr1()

Expr vc_ratExprFromStr1 ( VC vc,
char * n,
int base )

Create a rational from a single string.

Parameters
vcthe validity checker
ncan be a string containing an integer, a pair of integers "nnn/ddd", or a number in the fixed or floating point format.
baseis the base in which to interpret the string.

◆ vc_readExpr()

Expr vc_readExpr ( VC vc,
Expr array,
Expr index )

Create an expression for the value of array at the given index.

◆ vc_realType()

Type vc_realType ( VC vc)

◆ vc_recordExpr1()

Expr vc_recordExpr1 ( VC vc,
char * field,
Expr expr )

◆ vc_recordExpr2()

Expr vc_recordExpr2 ( VC vc,
char * field0,
Expr expr0,
char * field1,
Expr expr1 )

◆ vc_recordExpr3()

Expr vc_recordExpr3 ( VC vc,
char * field0,
Expr expr0,
char * field1,
Expr expr1,
char * field2,
Expr expr2 )

◆ vc_recordExprN()

Expr vc_recordExprN ( VC vc,
char ** fields,
Expr * exprs,
int numFields )

◆ vc_recordType1()

Type vc_recordType1 ( VC vc,
char * field,
Type type )

◆ vc_recordType2()

Type vc_recordType2 ( VC vc,
char * field0,
Type type0,
char * field1,
Type type1 )

◆ vc_recordType3()

Type vc_recordType3 ( VC vc,
char * field0,
Type type0,
char * field1,
Type type1,
char * field2,
Type type2 )

◆ vc_recordTypeN()

Type vc_recordTypeN ( VC vc,
char ** fields,
Type * types,
int numFields )

Create a record type.

'fields' and 'types' are arrays of length numFields.

◆ vc_recSelectExpr()

Expr vc_recSelectExpr ( VC vc,
Expr record,
char * field )

Create an expression representing the selection of a field from a record.

◆ vc_recUpdateExpr()

Expr vc_recUpdateExpr ( VC vc,
Expr record,
char * field,
Expr newValue )

Record update; equivalent to "record WITH .field := newValue".

◆ vc_registerAtom()

void vc_registerAtom ( VC vc,
Expr e )

Register an atomic formula of interest.

Registered atoms are tracked by the decision procedures. If one of them is deduced to be true or false, it is added to a list of implied literals. Implied literals can be retrieved with the getImpliedLiteral function

◆ vc_reset_error_status()

void vc_reset_error_status ( )

◆ vc_restart()

int vc_restart ( VC vc,
Expr e )

Restart the most recent query with e as an additional assertion.

This method should only be called after a query which returns 0. Its return values are as for vc_query().

◆ vc_returnFromCheck()

void vc_returnFromCheck ( VC vc)

Returns to context immediately before last invalid query.

This method should only be called after a query which returns 0.

◆ vc_setBoolFlag()

void vc_setBoolFlag ( Flags flags,
char * name,
int val )

Set a boolean flag to true or false.

◆ vc_setIntFlag()

void vc_setIntFlag ( Flags flags,
char * name,
int val )

Set an integer flag to the given value.

◆ vc_setResourceLimit()

void vc_setResourceLimit ( VC vc,
unsigned limit )

Set the resource limit (0==unlimited, 1==exhausted).

Currently, the limit is the total number of processed facts.

◆ vc_setStringFlag()

void vc_setStringFlag ( Flags flags,
char * name,
char * val )

Set a string flag to the given value.

◆ vc_setStrSeqFlag()

void vc_setStrSeqFlag ( Flags flags,
char * name,
char * str,
int val )

Add a (string, bool) pair to the multy-string flag.

◆ vc_setTriggers()

void vc_setTriggers ( VC vc,
Expr e,
int numTrigs,
Expr * triggers )

Set triggers for a forallExpr.

◆ vc_simplify()

Expr vc_simplify ( VC vc,
Expr e )

Simplify e with respect to the current context.

◆ vc_stackLevel()

int vc_stackLevel ( VC vc)

Returns the current stack level. Initial level is 0.

◆ vc_stringExpr()

Expr vc_stringExpr ( VC vc,
char * str )

Create a string Expr.

◆ vc_subRangeType()

Type vc_subRangeType ( VC vc,
int lowerEnd,
int upperEnd )

Create a subrange type.

◆ vc_substExpr()

Expr vc_substExpr ( VC vc,
Expr e,
Expr * oldTerms,
int numOldTerms,
Expr * newTerms,
int numNewTerms )

◆ vc_subtypeType()

Type vc_subtypeType ( VC vc,
Expr pred,
Expr witness )

Creates a subtype defined by the given predicate.

Parameters
vcthe validity checker
predis a predicate taking one argument of type T and returning Boolean. The resulting type is a subtype of T whose elements x are those satisfying the predicate pred(x).
witnessis an expression of type T for which pred holds (if a Null expression is passed as a witness, cvc will try to prove $\exists x. pred(x))$. if the witness check fails, a TypecheckException is thrown.

◆ vc_toExpr()

Expr vc_toExpr ( Type t)

◆ vc_trueExpr()

Expr vc_trueExpr ( VC vc)

◆ vc_tupleExprN()

Expr vc_tupleExprN ( VC vc,
Expr * children,
int numChildren )

Create a tuple expression.

'children' is an array of elements of length numChildren

◆ vc_tupleSelectExpr()

Expr vc_tupleSelectExpr ( VC vc,
Expr tuple,
int index )

Tuple select; equivalent to "tuple.n", where n is an numeral (e.g. tup.5)

◆ vc_tupleType2()

Type vc_tupleType2 ( VC vc,
Type type0,
Type type1 )

◆ vc_tupleType3()

Type vc_tupleType3 ( VC vc,
Type type0,
Type type1,
Type type2 )

◆ vc_tupleTypeN()

Type vc_tupleTypeN ( VC vc,
Type * types,
int numTypes )

Create a tuple type. 'types' is an array of types of length numTypes.

◆ vc_tupleUpdateExpr()

Expr vc_tupleUpdateExpr ( VC vc,
Expr tuple,
int index,
Expr newValue )

Tuple update; equivalent to "tuple WITH index := newValue".

◆ vc_typeString()

char * vc_typeString ( Type t)

Convert Type to string.

◆ vc_uminusExpr()

Expr vc_uminusExpr ( VC vc,
Expr child )

Unary minus. Child must have a numeric type.

◆ vc_varExpr()

Expr vc_varExpr ( VC vc,
char * name,
Type type )

Create a variable with a given name and type.

The type cannot be a function type.

◆ vc_varExprDef()

Expr vc_varExprDef ( VC vc,
char * name,
Type type,
Expr def )

Create a variable with a given name, type, and value.

◆ vc_writeExpr()

Expr vc_writeExpr ( VC vc,
Expr array,
Expr index,
Expr newValue )

Array update; equivalent to "array WITH [index] := newValue".