diff --git a/Language/Properties.agda b/Language/Properties.agda index 6e147ab..b2f14fd 100644 --- a/Language/Properties.agda +++ b/Language/Properties.agda @@ -106,12 +106,40 @@ Trace-↦ʳ {g₁} {g₂} {idx₁} (Trace-edge ρ₁⇒ρ idx₁→idx tr') (ListMemProp.∈-++⁺ˡ (x∈xs⇒fx∈fxs (Graph.size g₁ ↑ʳ_) idx₁→idx))) (Trace-↦ʳ {g₁} {g₂} tr') -Trace-loop : ∀ {g₁ : Graph} {idx₁ idx₂ : Graph.Index g₁} {ρ₁ ρ₂ : Env} → - Trace {g₁} idx₁ idx₂ ρ₁ ρ₂ → Trace {loop g₁} idx₁ idx₂ ρ₁ ρ₂ +Trace-loop : ∀ {g : Graph} {idx₁ idx₂ : Graph.Index g} {ρ₁ ρ₂ : Env} → + Trace {g} idx₁ idx₂ ρ₁ ρ₂ → Trace {loop g} idx₁ idx₂ ρ₁ ρ₂ Trace-loop {idx₁ = idx₁} {idx₁} (Trace-single ρ₁⇒ρ₂) = Trace-single ρ₁⇒ρ₂ -Trace-loop {g₁} {idx₁} (Trace-edge ρ₁⇒ρ idx₁→idx tr') = +Trace-loop {g} {idx₁} (Trace-edge ρ₁⇒ρ idx₁→idx tr') = Trace-edge ρ₁⇒ρ (ListMemProp.∈-++⁺ˡ idx₁→idx) (Trace-loop tr') +EndToEndTrace-loop : ∀ {g : Graph} {ρ₁ ρ₂ : Env} → + EndToEndTrace {g} ρ₁ ρ₂ → EndToEndTrace {loop g} ρ₁ ρ₂ +EndToEndTrace-loop etr = record + { idx₁ = EndToEndTrace.idx₁ etr + ; idx₁∈inputs = EndToEndTrace.idx₁∈inputs etr + ; idx₂ = EndToEndTrace.idx₂ etr + ; idx₂∈outputs = EndToEndTrace.idx₂∈outputs etr + ; trace = Trace-loop (EndToEndTrace.trace etr) + } + +EndToEndTrace-loop² : ∀ {g : Graph} {ρ₁ ρ₂ ρ₃ : Env} → + EndToEndTrace {loop g} ρ₁ ρ₂ → + EndToEndTrace {loop g} ρ₂ ρ₃ → + EndToEndTrace {loop g} ρ₁ ρ₃ +EndToEndTrace-loop² {g} etr₁ etr₂ = record + { idx₁ = EndToEndTrace.idx₁ etr₁ + ; idx₁∈inputs = EndToEndTrace.idx₁∈inputs etr₁ + ; idx₂ = EndToEndTrace.idx₂ etr₂ + ; idx₂∈outputs = EndToEndTrace.idx₂∈outputs etr₂ + ; trace = + let + o∈tr₁ = EndToEndTrace.idx₂∈outputs etr₁ + i∈tr₂ = EndToEndTrace.idx₁∈inputs etr₂ + oi∈es = ListMemProp.∈-++⁺ʳ (Graph.edges g) (∈-cartesianProduct o∈tr₁ i∈tr₂) + in + EndToEndTrace.trace etr₁ ++⟨ oi∈es ⟩ EndToEndTrace.trace etr₂ + } + infixr 5 _++_ _++_ : ∀ {g₁ g₂ : Graph} {ρ₁ ρ₂ ρ₃ : Env} → EndToEndTrace {g₁} ρ₁ ρ₂ → EndToEndTrace {g₂} ρ₂ ρ₃ →