summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-08-03 22:38:11 +0000
committerMorgan Deters <mdeters@gmail.com>2012-08-03 22:38:11 +0000
commitc956906a5dc4cb51b4676c3bba80159cbe76fdbc (patch)
tree5a3a022ff1fae4b34ce66443a0e2bb63ca43ae24
parent8af4e7b765815a89671ac2c62554b773d4dda290 (diff)
the array-store "construle" for isConst
-rw-r--r--src/theory/arrays/kinds3
-rw-r--r--src/theory/arrays/theory_arrays_type_rules.h20
2 files changed, 22 insertions, 1 deletions
diff --git a/src/theory/arrays/kinds b/src/theory/arrays/kinds
index 4a8695ec4..7386ec5c2 100644
--- a/src/theory/arrays/kinds
+++ b/src/theory/arrays/kinds
@@ -44,4 +44,7 @@ typerule STORE ::CVC4::theory::arrays::ArrayStoreTypeRule
typerule STORE_ALL ::CVC4::theory::arrays::ArrayStoreTypeRule
typerule ARR_TABLE_FUN ::CVC4::theory::arrays::ArrayTableFunTypeRule
+# store operations that are ordered (by index) over a store-all are constant
+construle STORE ::CVC4::theory::arrays::ArrayStoreTypeRule
+
endtheory
diff --git a/src/theory/arrays/theory_arrays_type_rules.h b/src/theory/arrays/theory_arrays_type_rules.h
index ccbb37936..b130b78fd 100644
--- a/src/theory/arrays/theory_arrays_type_rules.h
+++ b/src/theory/arrays/theory_arrays_type_rules.h
@@ -65,6 +65,24 @@ struct ArrayStoreTypeRule {
}
return arrayType;
}
+
+ inline static bool computeIsConst(NodeManager* nodeManager, TNode n)
+ throw (AssertionException) {
+ Assert(n.getKind() == kind::STORE);
+ NodeManagerScope nms(nodeManager);
+
+ // TODO: test ordering of stores, and ultimate application to a store-all
+ // ALSO: ensure uniqueness of form (e.g. one constant of the array sort
+ // BOOL->INT can be represented as
+ // [false->0, default=1]
+ // and also
+ // [true->1, default=0]
+ // ..but by contract of isConst(), only one of these can be considered
+ // a "const" expression.
+
+ return false;
+ }
+
};/* struct ArrayStoreTypeRule */
struct ArrayTableFunTypeRule {
@@ -91,7 +109,7 @@ struct ArrayTableFunTypeRule {
}
return arrayType.getArrayIndexType();
}
-};/* struct ArrayStoreTypeRule */
+};/* struct ArrayTableFunTypeRule */
struct CardinalityComputer {
inline static Cardinality computeCardinality(TypeNode type) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback