c_interface.h
Go to the documentation of this file.
/*****************************************************************************/
/*****************************************************************************/
#include "cvc4_public.h"
#ifndef _cvc3__include__c_interface_h_
#define _cvc3__include__c_interface_h_
#include "bindings/compat/c/c_interface_defs.h"
VC vc_createValidityChecker(Flags flags);
Flags vc_createFlags();
void vc_destroyValidityChecker(VC vc);
void vc_deleteFlags(Flags flags);
void vc_deleteType(Type t);
void vc_deleteExpr(Expr e);
void vc_deleteOp(Op op);
void vc_deleteVector(Expr* e);
void vc_deleteTypeVector(Type* e);
// Setting the flags
void vc_setBoolFlag(Flags flags, char* name, int val);
void vc_setIntFlag(Flags flags, char* name, int val);
void vc_setStringFlag(Flags flags, char* name, char* val);
void vc_setStrSeqFlag(Flags flags, char* name, char* str, int val);
// Basic types
Type vc_boolType(VC vc);
Type vc_realType(VC vc);
Type vc_intType(VC vc);
Type vc_subRangeType(VC vc, int lowerEnd, int upperEnd);
Type vc_subtypeType(VC vc, Expr pred, Expr witness);
// Tuple types
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);
// Record types
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);
// Datatypes
Type vc_dataType1(VC vc, char* name, char* constructor, int arity,
char** selectors, Expr* types);
Type vc_dataTypeN(VC vc, char* name, int numCons, char** constructors,
int* arities, char*** selectors, Expr** types);
Type* vc_dataTypeMN(VC vc, int numTypes, char** names,
int* numCons, char*** constructors,
int** arities, char**** selectors,
Expr*** types);
Type vc_arrayType(VC vc, Type typeIndex, Type typeData);
Type vc_bvType(VC vc, int n);
Type vc_funType1(VC vc, Type a1, Type typeRan);
Type vc_funType2(VC vc, Type a1, Type a2, Type typeRan);
Type vc_funType3(VC vc, Type a1, Type a2, Type a3, Type typeRan);
Type vc_funTypeN(VC vc, Type* args, Type typeRan, int numArgs);
// User-defined types
Type vc_createType(VC vc, char* typeName);
Type vc_lookupType(VC vc, char* typeName);
// Expr manipulation methods //
ExprManager* vc_getEM(VC vc);
Expr vc_varExpr(VC vc, char* name, Type type);
Expr vc_varExprDef(VC vc, char* name, Type type,
Expr def);
Expr vc_lookupVar(VC vc, char* name, Type* type);
Type vc_getType(VC vc, Expr e);
Type vc_getBaseType(VC vc, Expr e);
Type vc_getBaseTypeOfType(VC vc, Type t);
Expr vc_getTypePred(VC vc, Type t, Expr e);
Expr vc_stringExpr(VC vc, char* str);
Expr vc_idExpr(VC vc, char* name);
Expr vc_listExpr(VC vc, int numKids, Expr* kids);
// Expr I/O
void vc_printExpr(VC vc, Expr e);
char* vc_printExprString(VC vc, Expr e);
void vc_deleteString(char* str);
void vc_printExprFile(VC vc, Expr e, int fd);
Expr vc_importExpr(VC vc, Expr e);
Type vc_importType(Type t);
Expr vc_eqExpr(VC vc, Expr child0, Expr child1);
Expr vc_distinctExpr(VC vc, Expr* children, int numChildren);
// Boolean expressions
// The following functions create Boolean expressions. The children provided
// as arguments must be of type Boolean.
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);
// Substitution
// Substitutes oldTerms for newTerms in e.
// This function doesn't actually exist in ValidityChecker interface,
// but it does in Expr, and its functionality is needed in the C interface.
// For consistency, it is represented here as if it were in ValidityChecker.
Expr vc_substExpr(VC vc, Expr e,
Expr* oldTerms, int numOldTerms,
Expr* newTerms, int numNewTerms);
// User-defined (uninterpreted) functions.
Op vc_createOp(VC vc, char* name, Type type);
Op vc_createOpDef(VC vc, char* name, Type type, Expr def);
Op vc_lookupOp(VC vc, char* name, Type* type);
Expr vc_funExpr1(VC vc, Op op, Expr child);
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);
// Arithmetic
Expr vc_ratExpr(VC vc, int n, int d);
Expr vc_ratExprFromStr(VC vc, char* n, char* d, int base);
Expr vc_ratExprFromStr1(VC vc, char* n, int base);
Expr vc_uminusExpr(VC vc, Expr child);
// plus, minus, mult. Children must have numeric types.
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);
// The following functions create less-than, less-than or equal,
// greater-than, and greater-than or equal expressions of type Boolean.
// Their arguments must be of numeric types.
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);
// Records
// Create record literals;
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);
Expr vc_recUpdateExpr(VC vc, Expr record, char* field, Expr newValue);
// Arrays
Expr vc_readExpr(VC vc, Expr array, Expr index);
Expr vc_writeExpr(VC vc, Expr array, Expr index, Expr newValue);
// Bitvectors
// Additional type constructor
Type vc_bv32Type(VC vc);
// Bitvector constants
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);
// Concat and extract
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);
// Bitwise Boolean operators: Negation, And, Or, Xor
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);
// Unsigned bitvector inequalities
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);
// Signed bitvector inequalities
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);
// Sign-extend child to a total of nbits bits
Expr vc_bvSignExtend(VC vc, Expr child, int nbits);
// Bitvector arithmetic: unary minus, plus, subtract, multiply
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);
// Shift operators
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);
/*C pointer support: C interface to support C memory arrays in CVC3 */
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);
// Tuples
Expr vc_tupleExprN(VC vc, Expr* children, int numChildren);
Expr vc_tupleSelectExpr(VC vc, Expr tuple, int index);
Expr vc_tupleUpdateExpr(VC vc, Expr tuple, int index, Expr newValue);
// Datatypes
Expr vc_datatypeConsExpr(VC vc, char* constructor, int numArgs, Expr* args);
Expr vc_datatypeSelExpr(VC vc, char* selector, Expr arg);
Expr vc_datatypeTestExpr(VC vc, char* constructor, Expr arg);
// Quantifiers
Expr vc_boundVarExpr(VC vc, char* name, char *uid, Type type);
Type vc_forallExpr(VC vc, Expr* Bvars, int numBvars, Expr f);
void vc_setTriggers(VC vc, Expr e, int numTrigs, Expr* triggers);
Expr vc_existsExpr(VC vc, Expr* Bvars, int numBvars, Expr f);
Op vc_lambdaExpr(VC vc, int numVars, Expr* vars, Expr body);
// Context-related methods //
void vc_setResourceLimit(VC vc, unsigned limit);
void vc_assertFormula(VC vc, Expr e);
void vc_registerAtom(VC vc, Expr e);
Expr vc_getImpliedLiteral(VC vc);
Expr vc_simplify(VC vc, Expr e);
int vc_query(VC vc, Expr e);
int vc_checkContinue(VC vc);
int vc_restart(VC vc, Expr e);
void vc_returnFromCheck(VC vc);
Expr* vc_getUserAssumptions(VC vc, int* size);
Expr* vc_getInternalAssumptions(VC vc, int* size);
Expr* vc_getAssumptions(VC vc, int* size);
//yeting, for proof translation, get the assumptions used.
//the assumptions used are different from the user assumptions.
//the assumptions used are preprocessed if 'preprocess' is ena
Expr vc_getProofAssumptions(VC vc);
//yeting, for proof translation,
Expr vc_getProofQuery(VC vc);
Expr* vc_getAssumptionsUsed(VC vc, int* size);
Expr* vc_getCounterExample(VC vc, int* size);
Expr* vc_getConcreteModel(VC vc, int* size);
// Returns true if the current context is inconsistent.
int vc_inconsistent(VC vc, Expr** assumptions, int* size);
char* vc_incomplete(VC vc);
Expr vc_getProof(VC vc);
Expr vc_getProofOfFile(VC vc, char * filename);
Expr vc_getTCC(VC vc);
Expr* vc_getAssumptionsTCC(VC vc, int* size);
Expr vc_getProofTCC(VC vc);
Expr vc_getClosure(VC vc);
Expr vc_getProofClosure(VC vc);
int vc_stackLevel(VC vc);
void vc_push(VC vc);
void vc_pop(VC vc);
void vc_popto(VC vc, int stackLevel);
Context* vc_getCurrentContext(VC vc);
/* ---------------------------------------------------------------------- */
/* Util */
/* ---------------------------------------------------------------------- */
// Order
int vc_compare_exprs(Expr e1,Expr e2);
// Printing
char* vc_exprString(Expr e);
char* vc_typeString(Type t);
// What kind of Expr?
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);
int vc_getKindInt(VC vc,char* kind_name);
int vc_getInt(Expr e);
int vc_getBVInt(VC vc, Expr e);
unsigned int vc_getBVUnsigned(VC vc, Expr e);
// Debug
int vc_get_error_status();
void vc_reset_error_status();
char* vc_get_error_string();
void vc_print_statistics(VC vc);
#endif
vc_bvGeExpr
Expr vc_bvGeExpr(VC vc, Expr left, Expr right)
vc_getNumVars
int vc_getNumVars(Expr e)
vc_bv32RightShiftExpr
Expr vc_bv32RightShiftExpr(VC vc, int sh_amt, Expr child)
vc_subtypeType
Type vc_subtypeType(VC vc, Expr pred, Expr witness)
Creates a subtype defined by the given predicate.
vc_isLambda
int vc_isLambda(Expr e)
vc_dataTypeN
Type vc_dataTypeN(VC vc, char *name, int numCons, char **constructors, int *arities, char ***selectors, Expr **types)
Single datatype, multiple constructors.
vc_orExprN
Expr vc_orExprN(VC vc, Expr *children, int numChildren)
vc_funExpr3
Expr vc_funExpr3(VC vc, Op op, Expr child0, Expr child1, Expr child2)
vc_getProofAssumptions
Expr vc_getProofAssumptions(VC vc)
vc_reset_error_status
void vc_reset_error_status()
vc_inconsistent
int vc_inconsistent(VC vc, Expr **assumptions, int *size)
vc_arrayType
Type vc_arrayType(VC vc, Type typeIndex, Type typeData)
Create an array type.
vc_setStringFlag
void vc_setStringFlag(Flags flags, char *name, char *val)
Set a string flag to the given value.
vc_get_error_string
char * vc_get_error_string()
vc_impliesExpr
Expr vc_impliesExpr(VC vc, Expr hyp, Expr conc)
vc_bvAndExpr
Expr vc_bvAndExpr(VC vc, Expr left, Expr right)
vc_powExpr
Expr vc_powExpr(VC vc, Expr pow, Expr base)
vc_listExpr
Expr vc_listExpr(VC vc, int numKids, Expr *kids)
Create a list Expr.
vc_getCurrentContext
Context * vc_getCurrentContext(VC vc)
Get the current context.
vc_ratExpr
Expr vc_ratExpr(VC vc, int n, int d)
Create a rational number with numerator n and denominator d.
vc_bvSModExpr
Expr vc_bvSModExpr(VC vc, Expr left, Expr right)
vc_funTypeN
Type vc_funTypeN(VC vc, Type *args, Type typeRan, int numArgs)
Create a function type with N arguments.
vc_destroyValidityChecker
void vc_destroyValidityChecker(VC vc)
Destroy the validity checker.
vc_varExpr
Expr vc_varExpr(VC vc, char *name, Type type)
Create a variable with a given name and type.
vc_ltExpr
Expr vc_ltExpr(VC vc, Expr left, Expr right)
vc_getFun
Expr vc_getFun(VC vc, Expr e)
vc_bvSDivExpr
Expr vc_bvSDivExpr(VC vc, Expr left, Expr right)
vc_deleteExpr
void vc_deleteExpr(Expr e)
Delete expression.
vc_bvExtract
Expr vc_bvExtract(VC vc, Expr child, int high_bit_no, int low_bit_no)
vc_bv32PlusExpr
Expr vc_bv32PlusExpr(VC vc, Expr left, Expr right)
vc_eqExpr
Expr vc_eqExpr(VC vc, Expr child0, Expr child1)
Create an equality expression. The two children must have the same type.
vc_bv32MinusExpr
Expr vc_bv32MinusExpr(VC vc, Expr left, Expr right)
vc_intType
Type vc_intType(VC vc)
vc_forallExpr
Type vc_forallExpr(VC vc, Expr *Bvars, int numBvars, Expr f)
Create a FORALL quantifier.
vc_substExpr
Expr vc_substExpr(VC vc, Expr e, Expr *oldTerms, int numOldTerms, Expr *newTerms, int numNewTerms)
vc_bv32Type
Type vc_bv32Type(VC vc)
vc_bvSLtExpr
Expr vc_bvSLtExpr(VC vc, Expr left, Expr right)
vc_getKindString
const char * vc_getKindString(VC vc, int kind)
Translate a kind int to a string.
vc_typeString
char * vc_typeString(Type t)
Convert Type to string.
vc_bvVar32RightShiftExpr
Expr vc_bvVar32RightShiftExpr(VC vc, Expr sh_amt, Expr child)
vc_tupleType3
Type vc_tupleType3(VC vc, Type type0, Type type1, Type type2)
vc_compare_exprs
int vc_compare_exprs(Expr e1, Expr e2)
Compares two expressions.
vc_getChild
Expr vc_getChild(Expr e, int i)
vc_bvConcatExprN
Expr vc_bvConcatExprN(VC vc, Expr *children, int numChildren)
vc_plusExpr
Expr vc_plusExpr(VC vc, Expr left, Expr right)
vc_stringExpr
Expr vc_stringExpr(VC vc, char *str)
Create a string Expr.
vc_getAssumptionsTCC
Expr * vc_getAssumptionsTCC(VC vc, int *size)
Return the set of assumptions used in the proof of the last TCC.
vc_distinctExpr
Expr vc_distinctExpr(VC vc, Expr *children, int numChildren)
Create an all distinct expression. All children must ahve the same type.
vc_registerAtom
void vc_registerAtom(VC vc, Expr e)
Register an atomic formula of interest.
vc_recordType1
Type vc_recordType1(VC vc, char *field, Type type)
vc_bvReadMemoryArray
Expr vc_bvReadMemoryArray(VC vc, Expr array, Expr byteIndex, int numOfBytes)
vc_tupleType2
Type vc_tupleType2(VC vc, Type type0, Type type1)
vc_printExprString
char * vc_printExprString(VC vc, Expr e)
Print e into a char*.
vc_funExprN
Expr vc_funExprN(VC vc, Op op, Expr *children, int numChildren)
vc_dataType1
Type vc_dataType1(VC vc, char *name, char *constructor, int arity, char **selectors, Expr *types)
Single datatype, single constructor.
vc_bvLeftShiftExpr
Expr vc_bvLeftShiftExpr(VC vc, int sh_amt, Expr child)
vc_getAssumptionsUsed
Expr * vc_getAssumptionsUsed(VC vc, int *size)
Returns the set of assumptions used in the proof of queried formula.
vc_isVar
Expr vc_isVar(Expr e)
vc_getProof
Expr vc_getProof(VC vc)
Returns the proof for the last proven query.
vc_bvVar32DivByPowOfTwoExpr
Expr vc_bvVar32DivByPowOfTwoExpr(VC vc, Expr child, Expr rhs)
vc_multExpr
Expr vc_multExpr(VC vc, Expr left, Expr right)
vc_createFlags
Flags vc_createFlags()
Create validity checker's flags.
vc_getUserAssumptions
Expr * vc_getUserAssumptions(VC vc, int *size)
Get assumptions made by the user in this and all previous contexts.
vc_bvSignExtend
Expr vc_bvSignExtend(VC vc, Expr child, int nbits)
vc_deleteVector
void vc_deleteVector(Expr *e)
Delete vector of expressions.
vc_getProofClosure
Expr vc_getProofClosure(VC vc)
Construct a proof of the query closure |- Gamma => phi.
vc_setTriggers
void vc_setTriggers(VC vc, Expr e, int numTrigs, Expr *triggers)
Set triggers for a forallExpr.
vc_setIntFlag
void vc_setIntFlag(Flags flags, char *name, int val)
Set an integer flag to the given value.
vc_readExpr
Expr vc_readExpr(VC vc, Expr array, Expr index)
Create an expression for the value of array at the given index.
vc_boolType
Type vc_boolType(VC vc)
vc_arity
int vc_arity(Expr e)
vc_getBVInt
int vc_getBVInt(VC vc, Expr e)
Return an int from a constant bitvector expression.
vc_existsExpr
Expr vc_existsExpr(VC vc, Expr *Bvars, int numBvars, Expr f)
Create an EXISTS quantifier.
vc_bvSLeExpr
Expr vc_bvSLeExpr(VC vc, Expr left, Expr right)
vc_writeExpr
Expr vc_writeExpr(VC vc, Expr array, Expr index, Expr newValue)
Array update; equivalent to "array WITH [index] := newValue".
vc_bvMultExpr
Expr vc_bvMultExpr(VC vc, int n_bits, Expr left, Expr right)
vc_funType1
Type vc_funType1(VC vc, Type a1, Type typeRan)
Create a function type with 1 argument.
vc_recordTypeN
Type vc_recordTypeN(VC vc, char **fields, Type *types, int numFields)
Create a record type.
vc_print_statistics
void vc_print_statistics(VC vc)
Print statistics.
vc_funExpr2
Expr vc_funExpr2(VC vc, Op op, Expr left, Expr right)
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_setResourceLimit
void vc_setResourceLimit(VC vc, unsigned limit)
Set the resource limit (0==unlimited, 1==exhausted).
vc_bvSGtExpr
Expr vc_bvSGtExpr(VC vc, Expr left, Expr right)
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_toExpr
Expr vc_toExpr(Type t)
vc_getInternalAssumptions
Expr * vc_getInternalAssumptions(VC vc, int *size)
Get assumptions made internally in this and all previous contexts.
vc_importExpr
Expr vc_importExpr(VC vc, Expr e)
Import the Expr from another instance of VC.
vc_popto
void vc_popto(VC vc, int stackLevel)
Restore the current context to the given stackLevel.
vc_subRangeType
Type vc_subRangeType(VC vc, int lowerEnd, int upperEnd)
Create a subrange type.
vc_boundVarExpr
Expr vc_boundVarExpr(VC vc, char *name, char *uid, Type type)
Create a bound variable.
vc_bvURemExpr
Expr vc_bvURemExpr(VC vc, Expr left, Expr right)
vc_printExprFile
void vc_printExprFile(VC vc, Expr e, int fd)
Print 'e' into an open file descriptor.
vc_createType
Type vc_createType(VC vc, char *typeName)
Create an uninterpreted named type.
vc_andExpr
Expr vc_andExpr(VC vc, Expr left, Expr right)
vc_getType
Type vc_getType(VC vc, Expr e)
Get the type of the Expr.
vc_andExprN
Expr vc_andExprN(VC vc, Expr *children, int numChildren)
vc_datatypeTestExpr
Expr vc_datatypeTestExpr(VC vc, char *constructor, Expr arg)
Datatype tester expression.
vc_falseExpr
Expr vc_falseExpr(VC vc)
vc_getProofQuery
Expr vc_getProofQuery(VC vc)
vc_recordExprN
Expr vc_recordExprN(VC vc, char **fields, Expr *exprs, int numFields)
vc_bvType
Type vc_bvType(VC vc, int n)
Create a bitvector type of length n.
vc_orExpr
Expr vc_orExpr(VC vc, Expr left, Expr right)
vc_funType2
Type vc_funType2(VC vc, Type a1, Type a2, Type typeRan)
Create a function type with 2 arguments.
vc_lookupOp
Op vc_lookupOp(VC vc, char *name, Type *type)
Lookup an operator by name.
vc_createValidityChecker
VC vc_createValidityChecker(Flags flags)
Flags can be NULL.
vc_restart
int vc_restart(VC vc, Expr e)
Restart the most recent query with e as an additional assertion.
vc_bvGtExpr
Expr vc_bvGtExpr(VC vc, Expr left, Expr right)
vc_bvConstExprFromStr
Expr vc_bvConstExprFromStr(VC vc, char *binary_repr)
vc_getClosure
Expr vc_getClosure(VC vc)
After successful query, return its closure |- Gamma => phi.
vc_returnFromCheck
void vc_returnFromCheck(VC vc)
Returns to context immediately before last invalid query.
vc_bvUDivExpr
Expr vc_bvUDivExpr(VC vc, Expr left, Expr right)
vc_getCounterExample
Expr * vc_getCounterExample(VC vc, int *size)
Return the counterexample after a failed query.
vc_getInt
int vc_getInt(Expr e)
Return an int from a rational expression.
vc_exprString
char * vc_exprString(Expr e)
Convert Expr to string.
vc_recordType3
Type vc_recordType3(VC vc, char *field0, Type type0, char *field1, Type type1, char *field2, Type type2)
vc_recordExpr1
Expr vc_recordExpr1(VC vc, char *field, Expr expr)
vc_recUpdateExpr
Expr vc_recUpdateExpr(VC vc, Expr record, char *field, Expr newValue)
Record update; equivalent to "record WITH .field := newValue".
vc_plusExprN
Expr vc_plusExprN(VC vc, Expr *children, int numChildren)
vc_bvPlusExpr
Expr vc_bvPlusExpr(VC vc, int n_bits, Expr left, Expr right)
vc_isQuantifier
int vc_isQuantifier(Expr e)
vc_getProofOfFile
Expr vc_getProofOfFile(VC vc, char *filename)
Returns the proof of a .cvc file, if it is valid.
vc_dataTypeMN
Type * vc_dataTypeMN(VC vc, int numTypes, char **names, int *numCons, char ***constructors, int **arities, char ****selectors, Expr ***types)
Multiple datatypes.
vc_incomplete
char * vc_incomplete(VC vc)
Returns non-NULL if the invalid result from last query() is imprecise.
vc_ratExprFromStr1
Expr vc_ratExprFromStr1(VC vc, char *n, int base)
Create a rational from a single string.
vc_getExistential
Expr vc_getExistential(Expr e)
vc_push
void vc_push(VC vc)
Checkpoint the current context and increase the scope level.
vc_bvLeExpr
Expr vc_bvLeExpr(VC vc, Expr left, Expr right)
vc_getImpliedLiteral
Expr vc_getImpliedLiteral(VC vc)
Return next literal implied by last assertion. Null if none.
vc_realType
Type vc_realType(VC vc)
vc_getVar
Expr vc_getVar(Expr e, int i)
vc_bvBoolExtract
Expr vc_bvBoolExtract(VC vc, Expr child, int bit_no)
vc_iffExpr
Expr vc_iffExpr(VC vc, Expr left, Expr right)
vc_recordExpr2
Expr vc_recordExpr2(VC vc, char *field0, Expr expr0, char *field1, Expr expr1)
vc_bv32LeftShiftExpr
Expr vc_bv32LeftShiftExpr(VC vc, int sh_amt, Expr child)
vc_leExpr
Expr vc_leExpr(VC vc, Expr left, Expr right)
vc_bvSRemExpr
Expr vc_bvSRemExpr(VC vc, Expr left, Expr right)
vc_deleteFlags
void vc_deleteFlags(Flags flags)
Delete the flags.
vc_importType
Type vc_importType(Type t)
Import the Type from another instance of VC.
vc_getAssumptions
Expr * vc_getAssumptions(VC vc, int *size)
Get all assumptions made in this and all previous contexts.
vc_setStrSeqFlag
void vc_setStrSeqFlag(Flags flags, char *name, char *str, int val)
Add a (string, bool) pair to the multy-string flag.
vc_varExprDef
Expr vc_varExprDef(VC vc, char *name, Type type, Expr def)
Create a variable with a given name, type, and value.
vc_funType3
Type vc_funType3(VC vc, Type a1, Type a2, Type a3, Type typeRan)
Create a function type with 3 arguments.
vc_bvCreateMemoryArray
Expr vc_bvCreateMemoryArray(VC vc, char *arrayName)
vc_bvSGeExpr
Expr vc_bvSGeExpr(VC vc, Expr left, Expr right)
vc_bvConstExprFromLL
Expr vc_bvConstExprFromLL(VC vc, int n_bits, unsigned long value)
vc_uminusExpr
Expr vc_uminusExpr(VC vc, Expr child)
Unary minus. Child must have a numeric type.
vc_getBody
Expr vc_getBody(Expr e)
vc_recordExpr3
Expr vc_recordExpr3(VC vc, char *field0, Expr expr0, char *field1, Expr expr1, char *field2, Expr expr2)
vc_isClosure
int vc_isClosure(Expr e)
vc_createOpDef
Op vc_createOpDef(VC vc, char *name, Type type, Expr def)
Create a named user-defined function with a given type.
vc_getTCC
Expr vc_getTCC(VC vc)
Returns the TCC of the last assumption or query.
vc_trueExpr
Expr vc_trueExpr(VC vc)
vc_getBVUnsigned
unsigned int vc_getBVUnsigned(VC vc, Expr e)
Return an unsigned int from a constant bitvector expression.
vc_datatypeConsExpr
Expr vc_datatypeConsExpr(VC vc, char *constructor, int numArgs, Expr *args)
Datatype constructor expression.
vc_bvWriteToMemoryArray
Expr vc_bvWriteToMemoryArray(VC vc, Expr array, Expr byteIndex, Expr element, int numOfBytes)
vc_bvConstExprFromInt
Expr vc_bvConstExprFromInt(VC vc, int n_bits, unsigned int value)
vc_stackLevel
int vc_stackLevel(VC vc)
Returns the current stack level. Initial level is 0.
vc_lookupVar
Expr vc_lookupVar(VC vc, char *name, Type *type)
Get the expression and type associated with a name.
vc_getBaseType
Type vc_getBaseType(VC vc, Expr e)
Get the largest supertype of the Expr.
vc_recordType2
Type vc_recordType2(VC vc, char *field0, Type type0, char *field1, Type type1)
vc_idExpr
Expr vc_idExpr(VC vc, char *name)
Create an ID Expr.
vc_getKind
int vc_getKind(Expr e)
vc_iteExpr
Expr vc_iteExpr(VC vc, Expr ifpart, Expr thenpart, Expr elsepart)
vc_minusExpr
Expr vc_minusExpr(VC vc, Expr left, Expr right)
vc_getBaseTypeOfType
Type vc_getBaseTypeOfType(VC vc, Type t)
Get the largest supertype of the Type.
vc_bvVar32LeftShiftExpr
Expr vc_bvVar32LeftShiftExpr(VC vc, Expr sh_amt, Expr child)
vc_query
int vc_query(VC vc, Expr e)
Check validity of e in the current context.
vc_get_error_status
int vc_get_error_status()
vc_getTypePred
Expr vc_getTypePred(VC vc, Type t, Expr e)
Get the subtype predicate.
vc_bvLtExpr
Expr vc_bvLtExpr(VC vc, Expr left, Expr right)
vc_deleteOp
void vc_deleteOp(Op op)
Delete operator.
vc_getKindInt
int vc_getKindInt(VC vc, char *kind_name)
Translate a kind string to an int.
vc_geExpr
Expr vc_geExpr(VC vc, Expr left, Expr right)
vc_funExpr1
Expr vc_funExpr1(VC vc, Op op, Expr child)
Create expressions with a user-defined operator.
vc_createOp
Op vc_createOp(VC vc, char *name, Type type)
Create an operator from a function with a given name and type.
vc_getConcreteModel
Expr * vc_getConcreteModel(VC vc, int *size)
Will assign concrete values to all user created variables.
vc_checkContinue
int vc_checkContinue(VC vc)
Get the next model.
vc_deleteTypeVector
void vc_deleteTypeVector(Type *e)
Delete vector of types.
vc_divideExpr
Expr vc_divideExpr(VC vc, Expr numerator, Expr denominator)
vc_deleteString
void vc_deleteString(char *str)
Delete char* returned by previous function.
vc_lookupType
Type vc_lookupType(VC vc, char *typeName)
Lookup a user-defined (uninterpreted) type by name.
vc_tupleUpdateExpr
Expr vc_tupleUpdateExpr(VC vc, Expr tuple, int index, Expr newValue)
Tuple update; equivalent to "tuple WITH index := newValue".
vc_bv32MultExpr
Expr vc_bv32MultExpr(VC vc, Expr left, Expr right)
vc_setBoolFlag
void vc_setBoolFlag(Flags flags, char *name, int val)
Set a boolean flag to true or false.
vc_assertFormula
void vc_assertFormula(VC vc, Expr e)
Assert a new formula in the current context.
vc_bvXorExpr
Expr vc_bvXorExpr(VC vc, Expr left, Expr right)
vc_bvOrExpr
Expr vc_bvOrExpr(VC vc, Expr left, Expr right)
vc_gtExpr
Expr vc_gtExpr(VC vc, Expr left, Expr right)
vc_getEM
ExprManager * vc_getEM(VC vc)
Return the ExprManager.
vc_bvMinusExpr
Expr vc_bvMinusExpr(VC vc, int n_bits, Expr left, Expr right)
vc_tupleExprN
Expr vc_tupleExprN(VC vc, Expr *children, int numChildren)
Create a tuple expression.
vc_bvNotExpr
Expr vc_bvNotExpr(VC vc, Expr child)
vc_recSelectExpr
Expr vc_recSelectExpr(VC vc, Expr record, char *field)
Create an expression representing the selection of a field from a record.
vc_bvRightShiftExpr
Expr vc_bvRightShiftExpr(VC vc, int sh_amt, Expr child)
vc_getProofTCC
Expr vc_getProofTCC(VC vc)
Returns the proof of TCC of the last assumption or query.
vc_bvUMinusExpr
Expr vc_bvUMinusExpr(VC vc, Expr child)
vc_lambdaExpr
Op vc_lambdaExpr(VC vc, int numVars, Expr *vars, Expr body)
Lambda-expression.
vc_deleteType
void vc_deleteType(Type t)
Delete type.
vc_bv32ConstExprFromInt
Expr vc_bv32ConstExprFromInt(VC vc, unsigned int value)
vc_notExpr
Expr vc_notExpr(VC vc, Expr child)
vc_datatypeSelExpr
Expr vc_datatypeSelExpr(VC vc, char *selector, Expr arg)
Datatype selector expression.
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.
vc_pop
void vc_pop(VC vc)
Restore the current context to its state at the last checkpoint.
vc_bvConcatExpr
Expr vc_bvConcatExpr(VC vc, Expr left, Expr right)
vc_simplify
Expr vc_simplify(VC vc, Expr e)
Simplify e with respect to the current context.
vc_printExpr
void vc_printExpr(VC vc, Expr e)
Expr vc_parseExpr(VC vc, char* s);.
c_interface_defs.h
Context
void * Context
Definition c_interface_defs.h:42
Expr
void * Expr
Definition c_interface_defs.h:46
Flags
void * Flags
Definition c_interface_defs.h:44
Op
void * Op
Definition c_interface_defs.h:47
Type
void * Type
Definition c_interface_defs.h:48
ExprManager
void * ExprManager
Definition c_interface_defs.h:43
VC
void * VC
Definition c_interface_defs.h:41
cvc4_public.h
Macros that should be defined everywhere during the building of the libraries and driver binary,...