fn derive_output_key(a: &Relation, b: &Relation) -> Vec<Var> {
    let a_vars_set: HashSet<Var> = a.0.iter().cloned().collect();
    a.0.iter().cloned()
        .chain(b.0.iter().filter(|var| !a_vars_set.contains(&var)).cloned())
        .collect()
}
/// The output key is a vector containing the union of vars in
/// relations a and b ordered as vars in a as they are ordered in a,
/// followed by vars only in b as they are (relatively) ordered in b.
The output key is a vector containing the union of vars in
relations a and b ordered as vars in a as they are ordered in a,
followed by vars only in b as they are (relatively) ordered in b.
The output key is a vector containing the union of vars in relations a and b ordered as vars in a as they are ordered in a followed by vars only in b as they are ( relatively ) ordered in b .
fn derive_output_key(a: &Relation, b: &Relation) -> Vec<Var> {
    let a_vars_set: HashSet<Var> = a.0.iter().cloned().collect();
    a.0.iter().cloned()
        .chain(b.0.iter().filter(|var| !a_vars_set.contains(&var)).cloned())
        .collect()
}
fn derive_output_key ( a : & Relation , b : & Relation ) -> Vec < Var > { let a_vars_set : HashSet < Var > = a . 0 . iter ( ) . cloned ( ) . collect ( ) ; a . 0 . iter ( ) . cloned ( ) . chain ( b . 0 . iter ( ) . filter ( | var | ! a_vars_set . contains ( & var ) ) . cloned ( ) ) . collect ( ) }
The output key is a vector containing the union of vars in
relations a and b ordered as vars in a as they are ordered in a,
followed by vars only in b as they are (relatively) ordered in b.
The output key is a vector containing the union of vars in relations a and b ordered as vars in a as they are ordered in a followed by vars only in b as they are ( relatively ) ordered in b .
a
&Relation
b
&Relation
a
&Relation
b
&Relation