[−][src]Function canrun_collections::lmap::is_superset
pub fn is_superset<'a, K, V, A, B, D>(a: A, b: B) -> Goal<'a, D> where
K: Debug + Eq + Hash + UnifyIn<'a, D> + 'a,
V: Debug + UnifyIn<'a, D> + 'a,
A: IntoVal<LMap<K, V>>,
B: IntoVal<LMap<K, V>>,
D: DomainType<'a, LMap<K, V>> + DomainType<'a, K> + DomainType<'a, V> + 'a,
Assert that LMap
a
is a superset of LMap
b
.
This means that all of the keys in b
unify with keys in a
AND the
corresponding values also unify. This is the opposite of is_subset
.
Example:
use canrun::{var, Goal}; use canrun_collections::lmap::{lmap, is_superset}; use canrun_collections::example::Collections; let x = var(); let goal: Goal<Collections> = is_superset(lmap! {x => 2, 3 => 4}, lmap! {1 => 2}); let results: Vec<_> = goal.query(x).collect(); assert_eq!(results, vec![1]);