Created
June 2, 2018 20:27
-
-
Save gallais/8a689a20373d643896a643ef10eefc88 to your computer and use it in GitHub Desktop.
Names with offsets
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
open import Data.String.Base | |
open import Data.Nat.Base | |
open import Data.List.Base | |
open import Relation.Binary.PropositionalEquality | |
infix 5 _at_ | |
record Variable : Set where | |
constructor _at_ | |
field name : String | |
offset : ℕ | |
open Variable public | |
infix 3 _∈_ | |
data _∈_ : Variable → List String → Set where | |
here : ∀ {s xs} → s at 0 ∈ s ∷ xs | |
next : ∀ {s t xs} → s ∈ xs → name s ≢ t → s ∈ t ∷ xs | |
skip : ∀ {s n xs} → s at n ∈ xs → s at suc n ∈ s ∷ xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment