Prove 'sufficiency' for if-else.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
9366ec4a97
commit
07550bc214
|
@ -52,7 +52,7 @@ _↑ˡᵉ_ l m = List.map (_↑ˡ m) l
|
||||||
_↑ʳᵉ_ : ∀ {m} n → List (Fin m × Fin m) → List (Fin (n Nat.+ m) × Fin (n Nat.+ m))
|
_↑ʳᵉ_ : ∀ {m} n → List (Fin m × Fin m) → List (Fin (n Nat.+ m) × Fin (n Nat.+ m))
|
||||||
_↑ʳᵉ_ n l = List.map (n ↑ʳ_) l
|
_↑ʳᵉ_ n l = List.map (n ↑ʳ_) l
|
||||||
|
|
||||||
infixl 5 _∙_
|
infixr 5 _∙_
|
||||||
_∙_ : Graph → Graph → Graph
|
_∙_ : Graph → Graph → Graph
|
||||||
_∙_ g₁ g₂ = record
|
_∙_ g₁ g₂ = record
|
||||||
{ size = Graph.size g₁ Nat.+ Graph.size g₂
|
{ size = Graph.size g₁ Nat.+ Graph.size g₂
|
||||||
|
@ -65,7 +65,7 @@ _∙_ g₁ g₂ = record
|
||||||
(Graph.size g₁ ↑ʳⁱ Graph.outputs g₂)
|
(Graph.size g₁ ↑ʳⁱ Graph.outputs g₂)
|
||||||
}
|
}
|
||||||
|
|
||||||
infixl 5 _↦_
|
infixr 5 _↦_
|
||||||
_↦_ : Graph → Graph → Graph
|
_↦_ : Graph → Graph → Graph
|
||||||
_↦_ g₁ g₂ = record
|
_↦_ g₁ g₂ = record
|
||||||
{ size = Graph.size g₁ Nat.+ Graph.size g₂
|
{ size = Graph.size g₁ Nat.+ Graph.size g₂
|
||||||
|
@ -84,7 +84,7 @@ loop g = record g
|
||||||
List.cartesianProduct (Graph.outputs g) (Graph.inputs g)
|
List.cartesianProduct (Graph.outputs g) (Graph.inputs g)
|
||||||
}
|
}
|
||||||
|
|
||||||
infixl 5 _skipto_
|
infixr 5 _skipto_
|
||||||
_skipto_ : Graph → Graph → Graph
|
_skipto_ : Graph → Graph → Graph
|
||||||
_skipto_ g₁ g₂ = record (g₁ ∙ g₂)
|
_skipto_ g₁ g₂ = record (g₁ ∙ g₂)
|
||||||
{ edges = Graph.edges (g₁ ∙ g₂) List.++
|
{ edges = Graph.edges (g₁ ∙ g₂) List.++
|
||||||
|
|
|
@ -112,6 +112,7 @@ Trace-loop {idx₁ = idx₁} {idx₁} (Trace-single ρ₁⇒ρ₂) = Trace-singl
|
||||||
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')
|
Trace-edge ρ₁⇒ρ (ListMemProp.∈-++⁺ˡ idx₁→idx) (Trace-loop tr')
|
||||||
|
|
||||||
|
infixr 5 _++_
|
||||||
_++_ : ∀ {g₁ g₂ : Graph} {ρ₁ ρ₂ ρ₃ : Env} →
|
_++_ : ∀ {g₁ g₂ : Graph} {ρ₁ ρ₂ ρ₃ : Env} →
|
||||||
EndToEndTrace {g₁} ρ₁ ρ₂ → EndToEndTrace {g₂} ρ₂ ρ₃ →
|
EndToEndTrace {g₁} ρ₁ ρ₂ → EndToEndTrace {g₂} ρ₂ ρ₃ →
|
||||||
EndToEndTrace {g₁ ↦ g₂} ρ₁ ρ₃
|
EndToEndTrace {g₁ ↦ g₂} ρ₁ ρ₃
|
||||||
|
@ -152,3 +153,11 @@ buildCfg-sufficient (⇒ˢ-⟨⟩ ρ₁ ρ₂ bs ρ₁,bs⇒ρ₂) =
|
||||||
Trace-singleton (ρ₁,bs⇒ρ₂ ∷ [])
|
Trace-singleton (ρ₁,bs⇒ρ₂ ∷ [])
|
||||||
buildCfg-sufficient (⇒ˢ-then ρ₁ ρ₂ ρ₃ s₁ s₂ ρ₁,s₁⇒ρ₂ ρ₂,s₂⇒ρ₃) =
|
buildCfg-sufficient (⇒ˢ-then ρ₁ ρ₂ ρ₃ s₁ s₂ ρ₁,s₁⇒ρ₂ ρ₂,s₂⇒ρ₃) =
|
||||||
buildCfg-sufficient ρ₁,s₁⇒ρ₂ ++ buildCfg-sufficient ρ₂,s₂⇒ρ₃
|
buildCfg-sufficient ρ₁,s₁⇒ρ₂ ++ buildCfg-sufficient ρ₂,s₂⇒ρ₃
|
||||||
|
buildCfg-sufficient (⇒ˢ-if-true ρ₁ ρ₂ _ _ s₁ s₂ _ _ ρ₁,s₁⇒ρ₂) =
|
||||||
|
Trace-singleton[] ρ₁ ++
|
||||||
|
(EndToEndTrace-∙ˡ (buildCfg-sufficient ρ₁,s₁⇒ρ₂)) ++
|
||||||
|
Trace-singleton[] ρ₂
|
||||||
|
buildCfg-sufficient (⇒ˢ-if-false ρ₁ ρ₂ _ s₁ s₂ _ ρ₁,s₂⇒ρ₂) =
|
||||||
|
Trace-singleton[] ρ₁ ++
|
||||||
|
(EndToEndTrace-∙ʳ {buildCfg s₁} (buildCfg-sufficient ρ₁,s₂⇒ρ₂)) ++
|
||||||
|
Trace-singleton[] ρ₂
|
||||||
|
|
Loading…
Reference in New Issue
Block a user