10 #include <carl-formula/model/Assignment.h>
20 switch( carl::satisfied_by(fwo.
formula(),
Model(_assignment)) )
40 if (res.is_false())
return 0;
41 if (!res.is_true())
result = 2;
100 assert( _formula !=
end() );
103 return super::erase( _formula );
108 assert( _formula !=
end() );
109 if( !_formula->hasOrigins() )
return true;
110 auto& origs = *_formula->mOrigins;
111 auto iter = origs.begin();
112 while( iter != origs.end() )
116 if (iter != --origs.end())
118 *iter = origs.back();
134 _formula->mOrigins =
nullptr;
142 assert( _formula !=
end() );
143 if( !_formula->hasOrigins() )
return true;
144 if( _formula->mOrigins == _origins )
146 _formula->mOrigins =
nullptr;
149 auto& origs = *_formula->mOrigins;
150 for(
auto& orig : *_origins )
152 auto iter =
std::find( origs.begin(), origs.end(), orig );
153 if( iter != origs.end() )
155 *iter = origs.back();
161 _formula->mOrigins =
nullptr;
170 mProperties |= carl::PROP_IS_PURE_CONJUNCTION | carl::PROP_IS_LITERAL_CONJUNCTION | carl::PROP_IS_IN_CNF | carl::PROP_IS_IN_NNF;
173 carl::Condition subFormulaConds = fwo.
formula().properties();
174 if( !(carl::PROP_IS_A_CLAUSE<=subFormulaConds) )
180 else if( !(carl::PROP_IS_AN_ATOM<=subFormulaConds) )
182 if( !(carl::PROP_IS_IN_NNF<=subFormulaConds) )
184 mProperties |= (subFormulaConds & carl::WEAK_CONDITIONS);
189 std::pair<ModuleInput::iterator,bool>
ModuleInput::add(
const FormulaT& _formula,
bool _hasSingleOrigin,
const FormulaT& _origin,
const std::shared_ptr<std::vector<FormulaT>>& _origins,
bool _mightBeConjunction )
193 std::pair<iterator,bool> res = std::pair<iterator,bool>(
end(),
false);
194 auto formulaIter = _formula.subformulas().begin();
195 while( !res.second && formulaIter != _formula.subformulas().end() )
197 res =
add( *formulaIter, _hasSingleOrigin, _origin, _origins );
200 while( formulaIter != _formula.subformulas().end() )
202 add( *formulaIter, _hasSingleOrigin, _origin, _origins );
213 if( _hasSingleOrigin )
215 std::shared_ptr<std::vector<FormulaT>> vecOfOrigs = std::shared_ptr<std::vector<FormulaT>>(
new std::vector<FormulaT>() );
216 vecOfOrigs->push_back( _origin );
217 emplace_back( _formula, std::move( vecOfOrigs ) );
221 emplace_back( _formula, _origins );
225 return make_pair( pos,
true );
229 if( _hasSingleOrigin )
231 if( !iter->hasOrigins() )
233 iter->mOrigins = std::shared_ptr<std::vector<FormulaT>>(
new std::vector<FormulaT>() );
235 iter->mOrigins->push_back( _origin );
236 return make_pair( iter,
false );
238 if( _origins !=
nullptr )
240 if( iter->hasOrigins() )
242 iter->mOrigins = std::shared_ptr<std::vector<FormulaT>>(
new std::vector<FormulaT>( *iter->mOrigins ) );
243 iter->mOrigins->insert( iter->mOrigins->end(), _origins->begin(), _origins->end() );
247 iter->mOrigins = _origins;
250 return make_pair( iter,
false );
255 template<
typename AnnotationType>
static bool find(V &ts, const T &t)
bool substitute(const FormulaT &constr, const carl::Variable var, const carl::vs::Term< Poly > &term, FormulaT &result)
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
carl::Assignment< Rational > RationalAssignment
carl::Model< Rational, Poly > Model
void annotateFormula(const FormulaT &, const std::vector< AnnotationType > &)
#define SMTRAT_LOG_DEBUG(channel, msg)