(
nested: &mut Iterative<'b, S, u64>,
context: &mut I,
target: Var,
left: AttributeBinding,
right: AttributeBinding,
)
| 32 | } |
| 33 | |
| 34 | fn attribute_attribute<'b, T, I, S>( |
| 35 | nested: &mut Iterative<'b, S, u64>, |
| 36 | context: &mut I, |
| 37 | target: Var, |
| 38 | left: AttributeBinding, |
| 39 | right: AttributeBinding, |
| 40 | ) -> (Implemented<'b, S>, ShutdownHandle) |
| 41 | where |
| 42 | T: Timestamp + Lattice, |
| 43 | I: ImplContext<T>, |
| 44 | S: Scope<Timestamp = T>, |
| 45 | { |
| 46 | let mut variables = Vec::with_capacity(3); |
| 47 | variables.push(target); |
| 48 | |
| 49 | let (left_arranged, shutdown_left) = { |
| 50 | let (mut index, shutdown_button) = if target == left.variables.0 { |
| 51 | variables.push(left.variables.1); |
| 52 | context |
| 53 | .forward_propose(&left.source_attribute) |
| 54 | .expect("forward propose trace does not exist") |
| 55 | .import_core(&nested.parent, &left.source_attribute) |
| 56 | } else if target == left.variables.1 { |
| 57 | variables.push(left.variables.0); |
| 58 | context |
| 59 | .reverse_propose(&left.source_attribute) |
| 60 | .expect("reverse propose trace does not exist") |
| 61 | .import_core(&nested.parent, &left.source_attribute) |
| 62 | } else { |
| 63 | panic!("Unbound target variable in Attribute<->Attribute join."); |
| 64 | }; |
| 65 | |
| 66 | let frontier = index.trace.advance_frontier().to_vec(); |
| 67 | let forwarded = index.enter_at(nested, move |_, _, time| { |
| 68 | let mut forwarded = time.clone(); |
| 69 | forwarded.advance_by(&frontier); |
| 70 | Product::new(forwarded, 0) |
| 71 | }); |
| 72 | |
| 73 | (forwarded, shutdown_button) |
| 74 | }; |
| 75 | |
| 76 | let (right_arranged, shutdown_right) = { |
| 77 | let (mut index, shutdown_button) = if target == right.variables.0 { |
| 78 | variables.push(right.variables.1); |
| 79 | context |
| 80 | .forward_propose(&right.source_attribute) |
| 81 | .expect("forward propose trace does not exist") |
| 82 | .import_core(&nested.parent, &right.source_attribute) |
| 83 | } else if target == right.variables.1 { |
| 84 | variables.push(right.variables.0); |
| 85 | context |
| 86 | .reverse_propose(&right.source_attribute) |
| 87 | .expect("reverse propose trace does not exist") |
| 88 | .import_core(&nested.parent, &right.source_attribute) |
| 89 | } else { |
| 90 | panic!("Unbound target variable in Attribute<->Attribute join."); |
| 91 | }; |
no test coverage detected