diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-06-30 11:12:14 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-06-30 11:12:14 +0000 |
commit | 4375b60d5df794b2c6193f3892185ea181a0748d (patch) | |
tree | d346f9dc6bde42c3def6e0aac3b2711418e3d491 /src/util | |
parent | 4206a75e7a1635d04bb69084404a75670e164b62 (diff) |
* theory "tree" rewriting implemented and works
* added TheoryArith::preRewrite() to test and demonstrate
the use of pre-rewriting.
* array types and type checking now supported
* array type checking now supported
* theoryOf() dispatching properly to arrays now
* theories now required to implement a (simple) identify()
function that returns a string identifying them for
debugging/user output purposes
* added "builtin" theory to hold all built-in kinds and their
type rules and rewriting (currently only exploding distinct)
* fixed production build failure (regarding NodeSetDepth)
* removed an errant "using namespace std" in util/bitvector.h
(and made associated trivial fixes elsewhere)
* fixes to make unexpected exceptions more verbose in debug builds
* fixes to make multiple, cascading assertion fails simpler
* minor other fixes to comments etc.
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/Assert.h | 4 | ||||
-rw-r--r-- | src/util/Makefile.am | 3 | ||||
-rw-r--r-- | src/util/array.h | 31 | ||||
-rw-r--r-- | src/util/bitvector.h | 4 | ||||
-rw-r--r-- | src/util/triple.h | 42 |
5 files changed, 79 insertions, 5 deletions
diff --git a/src/util/Assert.h b/src/util/Assert.h index 5333817aa..0809257bf 100644 --- a/src/util/Assert.h +++ b/src/util/Assert.h @@ -211,9 +211,9 @@ extern __thread CVC4_PUBLIC const char* s_debugAssertionFailure; << "An assertion failed during stack unwinding:" << std::endl \ << AssertionException(#cond, __PRETTY_FUNCTION__, __FILE__, __LINE__, ## msg) << std::endl \ << "===========================================" << std::endl; \ - if(s_debugAssertionFailure != NULL) { \ + if(s_debugAssertionFailure != NULL) { \ Warning() << "The propagating exception is:" << std::endl \ - << s_debugAssertionFailure << std::endl \ + << s_debugAssertionFailure << std::endl \ << "===========================================" << std::endl; \ s_debugAssertionFailure = NULL; \ } \ diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 0f6fb5929..e92954340 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -32,4 +32,5 @@ libutil_la_SOURCES = \ gmp_util.h \ sexpr.h \ stats.h \ - stats.cpp + stats.cpp \ + triple.h diff --git a/src/util/array.h b/src/util/array.h new file mode 100644 index 000000000..274421249 --- /dev/null +++ b/src/util/array.h @@ -0,0 +1,31 @@ +/********************* */ +/*! \file array.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** 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 Array types. + ** + ** Array types. + **/ + +#include "cvc4_public.h" + +#ifndef __CVC4__ARRAY_H_ +#define __CVC4__ARRAY_H_ + +#include <iostream> +#include "util/Assert.h" + +// we get ArrayType right now by #including type.h. +// array.h is still useful for the auto-generated kinds #includes. +#include "expr/type.h" + +#endif /* __CVC4__ARRAY_H_ */ diff --git a/src/util/bitvector.h b/src/util/bitvector.h index 746d9aaaf..0febfddfd 100644 --- a/src/util/bitvector.h +++ b/src/util/bitvector.h @@ -17,6 +17,8 @@ ** \todo document this file **/ +#include "cvc4_public.h" + #ifndef __CVC4__BITVECTOR_H_ #define __CVC4__BITVECTOR_H_ @@ -25,8 +27,6 @@ #include "util/gmp_util.h" #include "util/integer.h" -using namespace std; - namespace CVC4 { class BitVector { diff --git a/src/util/triple.h b/src/util/triple.h new file mode 100644 index 000000000..50bf30c4a --- /dev/null +++ b/src/util/triple.h @@ -0,0 +1,42 @@ +/********************* */ +/*! \file triple.h + ** \verbatim + ** Original author: mdeters + ** Major contributors: none + ** Minor contributors (to current version): none + ** 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 Similar to std::pair<>, for triples + ** + ** Similar to std::pair<>, for triples. + **/ + +#include "cvc4_private.h" + +#ifndef __CVC4__TRIPLE_H +#define __CVC4__TRIPLE_H + +namespace CVC4 { + +template <class T1, class T2, class T3> +class triple { +public: + T1 first; + T2 second; + T3 third; +}; + +template <class T1, class T2, class T3> +inline triple<T1, T2, T3> +make_triple(const T1& t1, const T2& t2, const T3& t3) { + return triple<T1, T2, T3>(t1, t2, t3); +} + +}/* CVC4 namespace */ + +#endif /* __CVC4__TRIPLE_H */ |