summaryrefslogtreecommitdiff
path: root/src/theory/fp/fp_converter.h
diff options
context:
space:
mode:
authorMartin <martin.brain@cs.ox.ac.uk>2017-10-10 07:21:26 +0100
committerAndres Noetzli <andres.noetzli@gmail.com>2017-10-09 23:21:26 -0700
commit8c860213ca3a43e1fe483accb4b2b928ae14028e (patch)
tree4383636a3c88e1cde14e78b9ee4f04f46952c392 /src/theory/fp/fp_converter.h
parent96a0bc3b022b67b5ab79bf2ab087573c65a8d248 (diff)
Add skeleton of the FP theory solver (#1130)
This commit adds the skeleton of the theory solver using a dummy version of the converter (fp_converter.{h,cpp}). The converter is a class that is used to produce bit-vector expressions equivalent to floating-point ones. The commit sets up the equality engine and the infrastructure for interacting with the main theory components. The majority of this code is still agnostic to how the conversion is actually implemented / what kind of theory solver this is. This is pretty much the template code you need to write any kind of theory solver. This includes equality reasoning and so should be able to solve some basic problems.
Diffstat (limited to 'src/theory/fp/fp_converter.h')
-rw-r--r--src/theory/fp/fp_converter.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/theory/fp/fp_converter.h b/src/theory/fp/fp_converter.h
new file mode 100644
index 000000000..8a054e03a
--- /dev/null
+++ b/src/theory/fp/fp_converter.h
@@ -0,0 +1,55 @@
+/********************* */
+/*! \file fp_converter.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Martin Brain
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief Converts floating-point nodes to bit-vector expressions.
+ **
+ ** Uses the symfpu library to convert from floating-point operations to
+ ** bit-vectors and propositions allowing the theory to be solved by
+ ** 'bit-blasting'.
+ **/
+
+#include "cvc4_private.h"
+
+#ifndef __CVC4__THEORY__FP__FP_CONVERTER_H
+#define __CVC4__THEORY__FP__FP_CONVERTER_H
+
+#include "context/cdhashmap.h"
+#include "context/cdlist.h"
+#include "theory/valuation.h"
+#include "util/floatingpoint.h"
+#include "util/hash.h"
+
+namespace CVC4 {
+namespace theory {
+namespace fp {
+
+typedef PairHashFunction<TypeNode, TypeNode, TypeNodeHashFunction,
+ TypeNodeHashFunction>
+ PairTypeNodeHashFunction;
+
+class FpConverter {
+ public:
+ context::CDList<Node> d_additionalAssertions;
+
+ FpConverter(context::UserContext *);
+
+ /** Adds a node to the conversion, returns the converted node */
+ Node convert(TNode);
+
+ /** Gives the node representing the value of a given variable */
+ Node getValue(Valuation &, TNode);
+};
+
+} // namespace fp
+} // namespace theory
+} // namespace CVC4
+
+#endif /* __CVC4__THEORY__FP__THEORY_FP_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback