dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
TseitinCnfizer.h
1
8#pragma once
9
10#include <map>
11#include <vector>
12
13#include "dlinear/symbolic/FormulaVisitor.h"
14#include "dlinear/symbolic/NaiveCnfizer.h"
15#include "dlinear/symbolic/literal.h"
16#include "dlinear/symbolic/symbolic.h"
17#include "dlinear/util/Config.h"
18
19namespace dlinear {
20
27class TseitinCnfizer : public FormulaVisitor<std::map<Variable, Formula> &> {
28 public:
33 explicit TseitinCnfizer(const Config &config) : FormulaVisitor{config, "TseitinCnfizer"}, naive_cnfizer_{config_} {}
34
40 [[nodiscard]] std::vector<Formula> Process(const Formula &f) const;
41 [[nodiscard]] std::vector<Formula> operator()(const Formula &f) const;
42
43 private:
44 [[nodiscard]] Formula VisitConjunction(const Formula &f, std::map<Variable, Formula> &map) const override;
45 [[nodiscard]] Formula VisitDisjunction(const Formula &f, std::map<Variable, Formula> &map) const override;
46 [[nodiscard]] Formula VisitNegation(const Formula &f, std::map<Variable, Formula> &map) const override;
47 [[nodiscard]] Formula VisitForall(const Formula &f, std::map<Variable, Formula> &map) const override;
48
50};
51
52} // 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.
Tsietin transformation is a method to convert a formula into an equi-satisfiable vector of formulae i...
const NaiveCnfizer naive_cnfizer_
Naive CNFizer. Transforms nested formulas inside universal quantification.
TseitinCnfizer(const Config &config)
Construct a new TseitinCnfizer object with the given config.
std::vector< Formula > Process(const Formula &f) const
Convert f into an equi-satisfiable formula in CNF.
Represents a symbolic form of a first-order logic formula.
Global namespace for the dlinear library.
std::set< Formula > map(const std::set< Formula > &formulas, const std::function< Formula(const Formula &)> &func)
Given formulas = {f₁, ..., fₙ} and a func : Formula → Formula, map(formulas, func) returns a set {fun...
Definition symbolic.cpp:47