HAL
symbolic_state.cpp
Go to the documentation of this file.
2 
3 namespace hal
4 {
5  namespace SMT
6  {
7  SymbolicState::SymbolicState(const std::vector<BooleanFunction>& variables)
8  {
9  for (const auto& v : variables)
10  {
11  if (v.is_variable())
12  {
13  this->variable.emplace(v.clone(), v.clone());
14  }
15  }
16  }
17 
19  {
20  auto it = this->variable.find(key);
21  return (it == this->variable.end()) ? key : it->second;
22  }
23 
24  void SymbolicState::set(const BooleanFunction& key, const BooleanFunction& value)
25  {
26  if (key.is_variable())
27  {
28  this->variable.emplace(std::move(key), std::move(value));
29  }
30  }
31  } // namespace SMT
32 } // namespace hal
const BooleanFunction & get(const BooleanFunction &key) const
SymbolicState(const std::vector< BooleanFunction > &variables={})
void set(const BooleanFunction &key, const BooleanFunction &value)