SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Explanation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../OCStatistics.h"
4 
7 
8 namespace smtrat {
9 namespace mcsat {
10 namespace onecellcad {
11 /**
12  * @brief OneCell Explanation
13 
14 ## Rationale
15 To better understand the CAD implementation this document concisely explains
16 important CAD terminology from the literature and high-level implementation
17 design decisions. Low-level design decisions for structs and classes are found
18 in the implementation files themselves.
19 
20 ## Universe
21 The n-dimensional space in which a CADCell exists. The universe has n axes
22 (=std basis vectors), numbered 0 to n-1, and each axis is associated with one
23 variable.
24 
25 ## Variables order
26 A variable order like x,y,z tell us that the universe is 3-dimensional, gives
27 a name to the each coordinate axis (thus also defines an axis ordering), tells
28 us how to interpret a point like (5,2,1), and allows us to define properties
29 like "level" for points and polynomials and "cylindrical" for CADCells.
30 
31 ## Level of a point
32 Number of components that a point has but interpreted with respect to the first
33 variables in a variable ordering. E.g., if the universe has 3 axes/variables
34 like x,y,z in that (increasing) order, then a point of level 2 has exactly
35 2 components representing the coordinates for the first two variables, x and y.
36 
37 ## Level of a polynomial
38 The number/index of the highest variable, with respect to a variable
39 ordering, that appears with a positive degree in a polynomial. E.g., if the
40 universe has 3 axes/variables like x,y,z in that (increasing) order, then
41 a polynomial of level 2 at most mentions the first 2 variables, x and y, and
42 definitely mentions second variable y but no "higher" variable like z .
43 
44 ## CADCell
45 A "cylindric algebraic cell" exists in an n-dimensional vector space called a
46 "universe". A cell is a subspace of that universe with a possibly lower
47 dimension and is "cylindric" only with respect to a specific variable
48 ordering, numbered 0 to n-1.
49 A cell is "algebraic", because its boundaries are represented by polynomials.
50 Along each axis a cell is bound by either an non-empty open interval, called a
51 "sector" and represented by two polynomials, or by a closed point-interval,
52 called a "section" and represented by one polynomial.
53 E.g. a section along axis k, said to be of "level k", requires a polynomial
54 instead of a fixed number, because the fixed number can vary depending on the
55 position along the (lower dimensional) axes 0 to k-1. This is why a section of
56 level k is represented by a multivariate polynomial of "level k" (uses only the
57 first k variables in the variable ordering). If we replace the first k-1
58 variables in that polynomial by specific numbers, we are left with a univariate
59 polynomial whose root is then the fixed boundary number along axis k (if that
60 polynomial has multiple roots, we also need to specify precisely which one of
61 those represents the fixed boundary number). A different position, i.e., a
62 different variable replacement, yields a possibly different univariate
63 polynomial with a different root.
64 
65 ## Level of a sector/section
66 The number of the axis (with respect to some variable ordering that defines the
67 same axis ordering) for which a sector/section defines the bounds. This number
68 is also the level of the polynomial(s) inside the sector/section.
69 
70 ## Open CADCell
71 A cell is "open" if it only consists of sectors, i.e., it is open along all
72 axes and is therefore a subspace with the same dimension as its universe.
73 
74  */
75 namespace recursive {
76 
78  static constexpr bool cover_nullification = true;
79 };
81  static constexpr bool cover_nullification = false;
82 };
83 struct NoHeuristic {
84  static constexpr int heuristic = 0;
85 };
87  static constexpr int heuristic = 1;
88 };
90  static constexpr int heuristic = 2;
91 };
92 
93 
94 template<class Setting1, class Setting2>
95 struct Explanation {
96  std::optional<mcsat::Explanation>
97  operator()(const mcsat::Bookkeeping& trail, // current assignment state
98  carl::Variable var,
99  const FormulasT& trailLiterals, bool) const;
100 };
101 
102 } // namespace recursive
103 } // namespace onecellcad
104 } // namespace mcsat
105 } // namespace smtrat
Represent the trail, i.e.
Definition: Bookkeeping.h:19
int var(Lit p)
Definition: SolverTypes.h:64
Class to create the formulas for axioms.
carl::Formulas< Poly > FormulasT
Definition: types.h:39
std::optional< mcsat::Explanation > operator()(const mcsat::Bookkeeping &trail, carl::Variable var, const FormulasT &trailLiterals, bool) const
Definition: Explanation.cpp:19