| IFF_TOK { $kind = CVC4::kind::IFF; }
| EQUAL_TOK { $kind = CVC4::kind::EQUAL; }
| DISTINCT_TOK { $kind = CVC4::kind::DISTINCT; }
- // NOTE: Theory operators go here
+ // Arithmetic
| GREATER_THAN_TOK
{ $kind = CVC4::kind::GT; }
| GREATER_THAN_TOK EQUAL_TOK
| BVSLE_TOK { $kind = CVC4::kind::BITVECTOR_SLE; }
| BVSGT_TOK { $kind = CVC4::kind::BITVECTOR_SGT; }
| BVSGE_TOK { $kind = CVC4::kind::BITVECTOR_SGE; }
- /* TODO: lt, gt, plus, minus, etc. */
+ // NOTE: Theory operators go here
+ | SELECT_TOK { $kind = CVC4::kind::SELECT; }
+ | STORE_TOK { $kind = CVC4::kind::STORE; }
;
/**
PIPE_TOK : '|';
PLUS_TOK : '+';
POUND_TOK : '#';
+SELECT_TOK : 'select';
STAR_TOK : '*';
+STORE_TOK : 'store';
TILDE_TOK : '~';
XOR_TOK : 'xor';
*/
void Smt::addTheory(Theory theory) {
switch(theory) {
+ case THEORY_ARRAYS:
+ case THEORY_ARRAYS_EX: {
+ Type indexType = mkSort("Index");
+ Type elementTYpe = mkSort("Element");
+
+ // FIXME: should be defineType("Array",arrayType(indexType,elementType))
+ // but arrayType isn't defined
+ mkSort("Array");
+
+ addOperator(kind::SELECT);
+ addOperator(kind::STORE);
+ break;
+ }
+
case THEORY_EMPTY:
mkSort("U");
break;
d_logic = toLogic(name);
switch(d_logic) {
+ case QF_AX:
+ addTheory(THEORY_ARRAYS_EX);
+ break;
+
case QF_IDL:
case QF_LIA:
case QF_NIA:
case AUFNIRA:
case QF_AUFBV:
case QF_AUFLIA:
- case QF_AX:
case QF_BV:
Unhandled(name);
}
| STAR_TOK { $kind = CVC4::kind::MULT; }
| TILDE_TOK { $kind = CVC4::kind::UMINUS; }
| MINUS_TOK { $kind = CVC4::kind::MINUS; }
+ | SELECT_TOK { $kind = CVC4::kind::SELECT; }
+ | STORE_TOK { $kind = CVC4::kind::STORE; }
// NOTE: Theory operators go here
;
PIPE_TOK : '|';
PLUS_TOK : '+';
POUND_TOK : '#';
+SELECT_TOK : 'select';
STAR_TOK : '*';
+STORE_TOK : 'store';
TILDE_TOK : '~';
XOR_TOK : 'xor';
addOperator(kind::XOR);
break;
+ case THEORY_ARRAYS:
+ // FIXME: should define a paramterized type 'Array' with 2 arguments
+ mkSort("Array");
+
+ addOperator(kind::SELECT);
+ addOperator(kind::STORE);
+ break;
+
case THEORY_REALS_INTS:
defineType("Real", getExprManager()->realType());
// falling-through on purpose, to add Ints part of RealsInts
/* No extra symbols necessary */
break;
+ case Smt::QF_AX:
+ addTheory(THEORY_ARRAYS);
+ break;
+
case Smt::QF_IDL:
case Smt::QF_LIA:
case Smt::QF_NIA:
case Smt::AUFNIRA:
case Smt::QF_AUFBV:
case Smt::QF_AUFLIA:
- case Smt::QF_AX:
case Smt::QF_BV:
Unhandled(name);
}
#
theory ::CVC4::theory::arrays::TheoryArrays "theory_arrays.h"
+operator SELECT 2 "array select"
+operator STORE 3 "array store"