carl  24.04
Computer ARithmetic Library
ModelEvaluation_helper.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../Model.h"
4 
5 namespace carl {
6 namespace model {
7 
8 template<typename Rational, typename Poly>
9 Assignment<typename Poly::RootType> collectRANIR(const std::set<Variable>& vars, const Model<Rational,Poly>& model) {
11  for (auto var: vars) {
12  if (model.find(var) == model.end()) continue;
13  const ModelValue<Rational,Poly>& mv = model.evaluated(var);
14  if (mv.isRAN()) {
15  map.emplace(var, mv.asRAN());
16  }
17  }
18  return map;
19 }
20 
21 }
22 }
carl is the main namespace for the library.
std::map< Variable, T > Assignment
Definition: Common.h:13
Assignment< typename Poly::RootType > collectRANIR(const std::set< Variable > &vars, const Model< Rational, Poly > &model)
Represent a collection of assignments/mappings from variables to values.
Definition: Model.h:19
auto find(const typename Map::key_type &key) const
Definition: Model.h:102
auto end() const
Definition: Model.h:46
const ModelValue< Rational, Poly > & evaluated(const typename Map::key_type &key) const
Return the ModelValue for the given key, evaluated if it's a ModelSubstitution and evaluatable,...
Definition: Model.h:146
Represent a sum type/variant over the different kinds of values that can be assigned to the different...
Definition: ModelValue.h:56
const Poly::RootType & asRAN() const
Definition: ModelValue.h:233
bool isRAN() const
Definition: ModelValue.h:164