Last active
January 26, 2022 23:43
-
-
Save bond15/422c5eb62326e6e4ccf1a9aca9a577ad to your computer and use it in GitHub Desktop.
PolyWiringDiagrams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --guardedness #-} | |
module tutorial where | |
open import Poly | |
open import Data.Product | |
open import Dynamics | |
open Systems | |
postulate A B C D S T : Set | |
box₁ : Poly | |
box₁ = B ▹ λ _ → A × C | |
box₂ : Poly | |
box₂ = (C × D) ▹ λ _ → B | |
box₃ : Poly | |
box₃ = D ▹ (λ _ → A) | |
composeBoxes : Poly[ box₁ ⊗ₚ box₂ , box₃ ] | |
composeBoxes = | |
(λ{ (b , c , d) → d}) -- map outputs to outputs | |
⇒ₚ | |
λ{(b , c , _) a → (a , c) , b} -- map inputs to inputs | |
postulate impl₁ : Sys S box₁ | |
postulate impl₂ : Sys T box₂ | |
impl₃ : Sys (S × T) (box₃) | |
impl₃ = (impl₁ ⊗ₛ impl₂) ∘ₛ composeBoxes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment