Tentative start on proving correctness

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-04-30 19:20:02 -07:00
parent ccb7abc501
commit 112a5087ef
2 changed files with 15 additions and 0 deletions

View File

@ -2,6 +2,7 @@ module Language.Semantics where
open import Language.Base open import Language.Base
open import Agda.Primitive using (lsuc)
open import Data.Integer using (; +_) renaming (_+_ to _+ᶻ_; _-_ to _-ᶻ_) open import Data.Integer using (; +_) renaming (_+_ to _+ᶻ_; _-_ to _-ᶻ_)
open import Data.Product using (_×_; _,_) open import Data.Product using (_×_; _,_)
open import Data.String using (String) open import Data.String using (String)
@ -10,6 +11,9 @@ open import Data.Nat using ()
open import Relation.Nullary using (¬_) open import Relation.Nullary using (¬_)
open import Relation.Binary.PropositionalEquality using (_≡_) open import Relation.Binary.PropositionalEquality using (_≡_)
open import Lattice
open import Utils using (_⇒_)
data Value : Set where data Value : Set where
↑ᶻ : Value ↑ᶻ : Value
@ -58,3 +62,10 @@ data _,_⇒ˢ_ : Env → Stmt → Env → Set where
⇒ˢ-while-false : (ρ : Env) (e : Expr) (s : Stmt) ⇒ˢ-while-false : (ρ : Env) (e : Expr) (s : Stmt)
ρ , e ⇒ᵉ (↑ᶻ (+ 0)) ρ , e ⇒ᵉ (↑ᶻ (+ 0))
ρ , (while e repeat s) ⇒ˢ ρ ρ , (while e repeat s) ⇒ˢ ρ
record LatticeInterpretation {l} {L : Set l} {_≈_ : L L Set l}
{_⊔_ : L L L} {_⊓_ : L L L}
(isLattice : IsLattice L _≈_ _⊔_ _⊓_) : Set (lsuc l) where
field
⟦_⟧ : L Value Set
⟦⟧-respects-≈ : {l₁ l₂ : L} l₁ l₂ l₁ l₂

View File

@ -81,3 +81,7 @@ concat-∈ : ∀ {a} {A : Set a} {x : A} {l : List A} {ls : List (List A)} →
x l l ls x foldr _++_ [] ls x l l ls x foldr _++_ [] ls
concat-∈ x∈l (here refl) = ListMemProp.∈-++⁺ˡ x∈l concat-∈ x∈l (here refl) = ListMemProp.∈-++⁺ˡ x∈l
concat-∈ {ls = l' ls'} x∈l (there l∈ls') = ListMemProp.∈-++⁺ʳ l' (concat-∈ x∈l l∈ls') concat-∈ {ls = l' ls'} x∈l (there l∈ls') = ListMemProp.∈-++⁺ʳ l' (concat-∈ x∈l l∈ls')
_⇒_ : {a p₁ p₂} {A : Set a} (P : A Set p₁) (Q : A Set p₂)
Set (a ⊔ℓ p₁ ⊔ℓ p₂)
_⇒_ P Q = a P a Q a