summaryrefslogtreecommitdiff
path: root/src/Helium/Semantics/Axiomatic/Term.agda
diff options
context:
space:
mode:
authorGreg Brown <greg.brown@cl.cam.ac.uk>2022-03-08 16:23:39 +0000
committerGreg Brown <greg.brown@cl.cam.ac.uk>2022-03-08 16:27:38 +0000
commit2ed2b3f6007ad497fc331c079ee2f74724b00669 (patch)
tree23119abbe1e7d26b98d3c8ebfe9cb660c0386975 /src/Helium/Semantics/Axiomatic/Term.agda
parente3bfd6aa1594a84be897d7a50e882d3a2c54067a (diff)
Add semantics of Hoare logic terms.
Diffstat (limited to 'src/Helium/Semantics/Axiomatic/Term.agda')
-rw-r--r--src/Helium/Semantics/Axiomatic/Term.agda11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Helium/Semantics/Axiomatic/Term.agda b/src/Helium/Semantics/Axiomatic/Term.agda
index 1ccef89..c7c2797 100644
--- a/src/Helium/Semantics/Axiomatic/Term.agda
+++ b/src/Helium/Semantics/Axiomatic/Term.agda
@@ -355,3 +355,14 @@ module _ (2≉0 : 2≉0) where
subst t (Code.cons ref ref₁) t′ = subst (subst t ref (func₁ proj₁ t′)) ref₁ (func₁ proj₂ t′)
subst t (Code.head {e = e} ref) t′ = subst t ref (func₂ _,_ t′ (func₁ proj₂ (ℰ e)))
subst t (Code.tail {t = τ} {e = e} ref) t′ = subst t ref (func₂ {t₁ = τ} _,_ (func₁ proj₁ (ℰ e)) t′)
+
+⟦_⟧ : Term Σ Γ Δ t → ⟦ Σ ⟧ₜ′ → ⟦ Γ ⟧ₜ′ → ⟦ Δ ⟧ₜ′ → ⟦ t ⟧ₜ
+⟦_⟧′ : ∀ {ts} → All (Term Σ Γ Δ) {n} ts → ⟦ Σ ⟧ₜ′ → ⟦ Γ ⟧ₜ′ → ⟦ Δ ⟧ₜ′ → ⟦ ts ⟧ₜ′
+
+⟦ state i ⟧ σ γ δ = fetch i σ
+⟦ var i ⟧ σ γ δ = fetch i γ
+⟦ meta i ⟧ σ γ δ = fetch i δ
+⟦ func f ts ⟧ σ γ δ = f (⟦ ts ⟧′ σ γ δ)
+
+⟦ [] ⟧′ σ γ δ = _
+⟦ t ∷ ts ⟧′ σ γ δ = ⟦ t ⟧ σ γ δ , ⟦ ts ⟧′ σ γ δ