Pre: add ConjoiningClauses::bind_value.

This commit is contained in:
Richard Newman 2017-06-05 19:59:53 -07:00 committed by Richard Newman
parent 13e27c83e2
commit 899e5d0971

View file

@ -330,6 +330,12 @@ impl ConjoiningClauses {
} }
impl ConjoiningClauses { impl ConjoiningClauses {
/// Be careful with this. It'll overwrite existing bindings.
pub fn bind_value(&mut self, var: &Variable, value: TypedValue) {
self.constrain_var_to_type(var.clone(), value.value_type());
self.value_bindings.insert(var.clone(), value);
}
pub fn bound_value(&self, var: &Variable) -> Option<TypedValue> { pub fn bound_value(&self, var: &Variable) -> Option<TypedValue> {
self.value_bindings.get(var).cloned() self.value_bindings.get(var).cloned()
} }