1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Expand definitions for floating-point arithmetic. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__THEORY__FP__FP_EXPAND_DEFS_H |
19 |
|
#define CVC5__THEORY__FP__FP_EXPAND_DEFS_H |
20 |
|
|
21 |
|
#include "context/cdhashmap.h" |
22 |
|
#include "expr/node.h" |
23 |
|
#include "proof/trust_node.h" |
24 |
|
|
25 |
|
namespace cvc5 { |
26 |
|
namespace theory { |
27 |
|
namespace fp { |
28 |
|
|
29 |
|
/** |
30 |
|
* Module responsibile for expanding definitions for the FP theory. |
31 |
|
*/ |
32 |
9912 |
class FpExpandDefs |
33 |
|
{ |
34 |
|
using PairTypeNodeHashFunction = PairHashFunction<TypeNode, |
35 |
|
TypeNode, |
36 |
|
std::hash<TypeNode>, |
37 |
|
std::hash<TypeNode>>; |
38 |
|
/** Uninterpreted functions for undefined cases of non-total operators. */ |
39 |
|
using ComparisonUFMap = context::CDHashMap<TypeNode, Node>; |
40 |
|
/** Uninterpreted functions for lazy handling of conversions. */ |
41 |
|
using ConversionUFMap = context:: |
42 |
|
CDHashMap<std::pair<TypeNode, TypeNode>, Node, PairTypeNodeHashFunction>; |
43 |
|
|
44 |
|
public: |
45 |
|
FpExpandDefs(context::UserContext* u); |
46 |
|
/** expand definitions in node */ |
47 |
|
TrustNode expandDefinition(Node node); |
48 |
|
|
49 |
|
private: |
50 |
|
/** TODO: document (projects issue #265) */ |
51 |
|
Node minUF(Node); |
52 |
|
Node maxUF(Node); |
53 |
|
Node toUBVUF(Node); |
54 |
|
Node toSBVUF(Node); |
55 |
|
Node toRealUF(Node); |
56 |
|
Node abstractRealToFloat(Node); |
57 |
|
Node abstractFloatToReal(Node); |
58 |
|
ComparisonUFMap d_minMap; |
59 |
|
ComparisonUFMap d_maxMap; |
60 |
|
ConversionUFMap d_toUBVMap; |
61 |
|
ConversionUFMap d_toSBVMap; |
62 |
|
ComparisonUFMap d_toRealMap; |
63 |
|
}; /* class TheoryFp */ |
64 |
|
|
65 |
|
} // namespace fp |
66 |
|
} // namespace theory |
67 |
|
} // namespace cvc5 |
68 |
|
|
69 |
|
#endif /* CVC5__THEORY__FP__THEORY_FP_H */ |