Started work on array theory
authorClark Barrett <barrett@cs.nyu.edu>
Mon, 14 Jun 2010 16:06:51 +0000 (16:06 +0000)
committerClark Barrett <barrett@cs.nyu.edu>
Mon, 14 Jun 2010 16:06:51 +0000 (16:06 +0000)
src/theory/arrays/Makefile.am
src/theory/arrays/theory_arrays.cpp [new file with mode: 0644]
src/theory/arrays/theory_arrays.h
test/regress/regress0/arr1.smt [new file with mode: 0644]

index 5d3514ddac76b73e6e009f950be5bb51dd918195..813a91314d26083916a2e575c47373efc52d51b3 100644 (file)
@@ -6,6 +6,7 @@ AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN)
 noinst_LTLIBRARIES = libarrays.la
 
 libarrays_la_SOURCES = \
-       theory_arrays.h
+       theory_arrays.h \
+       theory_arrays.cpp
 
 EXTRA_DIST = kinds
diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp
new file mode 100644 (file)
index 0000000..106d1a8
--- /dev/null
@@ -0,0 +1,43 @@
+/*********************                                                        */
+/*! \file theory_arrays.cpp
+ ** \verbatim
+ ** Original author: barrett
+ ** Major contributors: 
+ ** Minor contributors (to current version): 
+ ** This file is part of the CVC4 prototype.
+ ** Copyright (c) 2009, 2010  The Analysis of Computer Systems Group (ACSys)
+ ** Courant Institute of Mathematical Sciences
+ ** New York University
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.\endverbatim
+ **
+ ** \brief Implementation of the theory of arrays.
+ **
+ ** Implementation of the theory of arrays.
+ **/
+
+#include "theory/arrays/theory_arrays.h"
+#include "expr/kind.h"
+
+using namespace std;
+using namespace CVC4;
+using namespace CVC4::kind;
+using namespace CVC4::context;
+using namespace CVC4::theory;
+using namespace CVC4::theory::arrays;
+
+TheoryArrays::TheoryArrays(Context* c, OutputChannel& out) :
+  Theory(c, out)
+{
+}
+
+TheoryArrays::~TheoryArrays() {
+}
+
+void TheoryArrays::check(Effort e) {
+  while(!done()) {
+    Node assertion = get();
+    Debug("arrays") << "TheoryArrays::check(): " << assertion << endl;
+  }
+  Debug("arrays") << "TheoryArrays::check(): done" << endl;
+}
index 6ab0fac904772dcbc16e980be72880ab67ebf4ca..52e63831c0b41248c6d35dcf86213fd8c65f6a36 100644 (file)
 #define __CVC4__THEORY__ARRAYS__THEORY_ARRAYS_H
 
 #include "theory/theory.h"
-#include "context/context.h"
+
+namespace context {
+class Context;
+}
 
 namespace CVC4 {
 namespace theory {
@@ -30,15 +33,13 @@ namespace arrays {
 
 class TheoryArrays : public Theory {
 public:
-  TheoryArrays(context::Context* c, OutputChannel& out) :
-    Theory(c, out) {
-  }
-
-  void preRegisterTerm(TNode n) { Unimplemented(); }
-  void registerTerm(TNode n) { Unimplemented(); }
-  void check(Effort e) { Unimplemented(); }
-  void propagate(Effort e) { Unimplemented(); }
-  void explain(TNode n, Effort e) { Unimplemented(); }
+  TheoryArrays(context::Context* c, OutputChannel& out);
+  ~TheoryArrays();
+  void preRegisterTerm(TNode n) { }
+  void registerTerm(TNode n) { }
+  void check(Effort e);
+  void propagate(Effort e) { }
+  void explain(TNode n, Effort e) { }
 };
 
 }/* CVC4::theory::arrays namespace */
diff --git a/test/regress/regress0/arr1.smt b/test/regress/regress0/arr1.smt
new file mode 100644 (file)
index 0000000..55ca996
--- /dev/null
@@ -0,0 +1,7 @@
+(benchmark simple_arr
+  :logic QF_AX
+  :status unsat
+  :extrafuns ((a Array))
+  :extrafuns ((i1 Index) (i2 Index))
+  :formula (not (implies (= i1 i2) (= (select a i1) (select a i2))))
+)