30 template<
typename Pol>
40 for (
const auto& term: poly) {
60 std::optional<std::pair<Formula<Pol>,
Pol>>
parse() {
61 if (!
mIn.is_open())
return std::nullopt;
64 if (!file)
return std::nullopt;
66 for (
const auto& cons: file->constraints) {
67 auto lhs =
convert(std::get<0>(cons));
69 Number rhs = std::get<2>(cons);
71 constraints.emplace_back(std::move(pbc));
75 for (
const auto& term: file->objective) {
76 objective +=
Number(term.first) * term.second;
78 return std::make_pair(std::move(resC), std::move(objective));
A small wrapper that configures logging for carl.
MultivariatePolynomial< Rational > Pol
std::vector< Formula< Poly > > Formulas
Variable fresh_boolean_variable() noexcept
std::optional< OPBFile > parseOPBFile(std::ifstream &in)
std::vector< std::pair< int, carl::Variable > > OPBPolynomial
std::tuple< OPBPolynomial, Relation, int > OPBConstraint
A Variable represents an algebraic variable that can be used throughout carl.
T type
A type associated with the type.
Represent a polynomial (in)equality against zero.
Represent an SMT formula, which can be an atom for some background theory or a boolean combination of...
std::vector< OPBConstraint > constraints
OPBFile(OPBPolynomial obj)
OPBFile(OPBPolynomial obj, std::vector< OPBConstraint > cons)
carl::MultivariatePolynomial< Number > convert(const std::vector< std::pair< int, carl::Variable >> &poly)
typename UnderlyingNumberType< Pol >::type Number
std::map< carl::Variable, carl::Variable > variableCache
OPBImporter(const std::string &filename)
std::optional< std::pair< Formula< Pol >, Pol > > parse()