diff options
author | Greg Brown <greg.brown@cl.cam.ac.uk> | 2022-02-21 17:47:09 +0000 |
---|---|---|
committer | Greg Brown <greg.brown@cl.cam.ac.uk> | 2022-02-21 17:47:09 +0000 |
commit | ba8844eb5d1af155e6be1bfd78c27043e2b5c436 (patch) | |
tree | 136639bed983bd2be0f54b04464c5f26f2b813c5 /src/Helium/Semantics/Denotational | |
parent | 91cd436bce90fbcf863ecf4c1256bf4ef8769428 (diff) |
Replace tup with cons and nil
Diffstat (limited to 'src/Helium/Semantics/Denotational')
-rw-r--r-- | src/Helium/Semantics/Denotational/Core.agda | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Helium/Semantics/Denotational/Core.agda b/src/Helium/Semantics/Denotational/Core.agda index ff5a56d..df16874 100644 --- a/src/Helium/Semantics/Denotational/Core.agda +++ b/src/Helium/Semantics/Denotational/Core.agda @@ -244,9 +244,8 @@ module Expression apply {suc k} {_ ∷ ms} f xs = apply (λ x → f (tupHead (Vec.map fin ms) xs ∷ x)) (tupTail (Vec.map fin ms) xs) ⟦ asInt e ⟧ᵉ σ γ = Fin.toℕ (⟦ e ⟧ᵉ σ γ) ℤ′.×′ 1ℤ - ⟦ tup [] ⟧ᵉ σ γ = _ - ⟦ tup (e ∷ []) ⟧ᵉ σ γ = ⟦ e ⟧ᵉ σ γ - ⟦ tup (e ∷ e′ ∷ es) ⟧ᵉ σ γ = ⟦ e ⟧ᵉ σ γ , ⟦ tup (e′ ∷ es) ⟧ᵉ σ γ + ⟦ nil ⟧ᵉ σ γ = _ + ⟦ cons {ts = ts} e e₁ ⟧ᵉ σ γ = tupCons ts (⟦ e ⟧ᵉ σ γ) (⟦ e₁ ⟧ᵉ σ γ) ⟦ head {ts = ts} e ⟧ᵉ σ γ = tupHead ts (⟦ e ⟧ᵉ σ γ) ⟦ tail {ts = ts} e ⟧ᵉ σ γ = tupTail ts (⟦ e ⟧ᵉ σ γ) ⟦ call f e ⟧ᵉ σ γ = ⟦ f ⟧ᶠ σ (⟦ e ⟧ᵉ′ σ γ) @@ -291,9 +290,9 @@ module Expression let i = ⟦ e₂ ⟧ᵉ σ γ update a (spliced t (P.proj₁ v) (P.proj₂ v) i) σ γ update (cast {t = t} eq e) v σ γ = update e (casted t (≡.sym eq) v) σ γ - update (tup {es = []} x) vs σ γ = σ , γ - update (tup {ts = _ ∷ ts} {es = _ ∷ _} (x ∷ xs)) vs σ γ = do - let σ′ , γ′ = update x (tupHead ts vs) σ γ - update (tup xs) (tupTail ts vs) σ′ γ′ + update nil v σ γ = σ , γ + update (cons {ts = ts} e e₁) vs σ γ = do + let σ′ , γ′ = update e (tupHead ts vs) σ γ + update e₁ (tupTail ts vs) σ′ γ′ update (head {ts = ts} {e = e} a) v σ γ = update a (tupCons ts v (tupTail ts (⟦ e ⟧ᵉ σ γ))) σ γ update (tail {ts = ts} {e = e} a) v σ γ = update a (tupCons ts (tupHead ts (⟦ e ⟧ᵉ σ γ)) v) σ γ |