dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
PlaistedGreenbaumCnfizer.h
1
8#pragma once
9
10#include <vector>
11
12#include "dlinear/symbolic/FormulaVisitor.h"
13#include "dlinear/symbolic/NaiveCnfizer.h"
14#include "dlinear/symbolic/Nnfizer.h"
15#include "dlinear/symbolic/literal.h"
16#include "dlinear/symbolic/symbolic.h"
17#include "dlinear/util/Config.h"
18
19namespace dlinear {
20
28class PlaistedGreenbaumCnfizer : public FormulaVisitor<std::vector<Formula> &, std::vector<Variable> &> {
29 public:
35 : FormulaVisitor{config, "PlaistedGreenbaumCnfizer"}, nnfizer_{config}, naive_cnfizer_{config} {}
36
42 [[nodiscard]] std::pair<std::vector<Formula>, std::vector<Variable>> Process(const Formula &f) const;
43 [[nodiscard]] std::pair<std::vector<Formula>, std::vector<Variable>> operator()(const Formula &f) const;
44
45 private:
46 [[nodiscard]] Formula VisitConjunction(const Formula &f, std::vector<Formula> &aux,
47 std::vector<Variable> &vars) const override;
48 [[nodiscard]] Formula VisitDisjunction(const Formula &f, std::vector<Formula> &aux,
49 std::vector<Variable> &vars) const override;
50 [[nodiscard]] Formula VisitNegation(const Formula &f, std::vector<Formula> &aux,
51 std::vector<Variable> &vars) const override;
52 [[nodiscard]] Formula VisitForall(const Formula &f, std::vector<Formula> &aux,
53 std::vector<Variable> &vars) const override;
54
55 const Nnfizer nnfizer_;
56 const NaiveCnfizer
58};
59
60} // namespace dlinear
Simple dataclass used to store the configuration of the program.
Definition Config.h:38
This base class provides all the methods expected to visit the underlying formula and return a modifi...
Transforms a symbolic formula f into a CNF formula by preserving its semantics.
Implementation of NNF (Negation Normal Form) conversion.
Definition Nnfizer.h:24
Plaisted-Greenbaum transformation is a method to convert a formula into an equi-satisfiable vector of...
const NaiveCnfizer naive_cnfizer_
Naive CNFizer. Used to transform nested formulas inside universal quantification.
std::pair< std::vector< Formula >, std::vector< Variable > > Process(const Formula &f) const
Convert a f into an equi-satisfiable formula f' in CNF.
PlaistedGreenbaumCnfizer(const Config &config)
Construct a new PlaistedGreenbaumCnfizer object with the given config.
Represents a symbolic form of a first-order logic formula.
Global namespace for the dlinear library.