Created
April 27, 2026 01:04
-
-
Save hsk/b6aaf843b69e4e2ca2323801254de316 to your computer and use it in GitHub Desktop.
den.agda
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
| module den where | |
| open import Data.Nat | |
| open import Data.Nat.Properties | |
| open import Relation.Binary.PropositionalEquality using (_≡_; refl) | |
| data Expr : Set where | |
| Lit : ℕ → Expr | |
| _x_ : Expr → Expr → Expr | |
| -- 表示的意味論(denotation) | |
| [[_]] : Expr → ℕ | |
| [[ Lit n ]] = n | |
| [[ e1 x e2 ]] = [[ e1 ]] * [[ e2 ]] | |
| -- 例 | |
| example : [[ Lit 3 x Lit 2 ]] ≡ [[ Lit 2 x Lit 3 ]] | |
| example = refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment