Skip to content

Instantly share code, notes, and snippets.

@nachivpn
Created October 15, 2017 08:31
Show Gist options
  • Save nachivpn/77d27b90519d59368247877e982974d6 to your computer and use it in GitHub Desktop.
Save nachivpn/77d27b90519d59368247877e982974d6 to your computer and use it in GitHub Desktop.
¬[_] : ∀ {a b : Name} → Dec (a ≡ b) → Set
¬[ (yes x₁) ] = ⊥
¬[ (no x₁) ] = ⊤
data _,_∈x_ (n : Name) (p : Pointer) : Env → Set where
zero : ∀ {xs} → n , p ∈x ((n , p) ∷ xs)
suc : ∀ {n' : Name} { p' : Pointer} {xs} {pr : ¬[ n == n' ]}
→ n , p ∈x xs → n , p ∈x ((n' , p') ∷ xs)
private
env : Env
env = (y , 5) ∷ (x , 1) ∷ (z , 0) ∷(x , 0 ) ∷ []
p₁' : x , 1 ∈x env
p₁' = suc zero
-- type checker complains! :D
-- p₂' : x , 0 ∈x env
-- p₂' = suc (suc (suc zero))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment