Skip to content

Commit 68fc1d6

Browse files
traviscrossehuss
authored andcommitted
Describe and prove the reflexive ancestry relation
In the model, each scope is treated as an ancestor of itself. Let's describe this explicitly and prove it.
1 parent bb24b68 commit 68fc1d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/scoping-model.lagda.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ record Scope : Set where
115115

116116
#### Scope hierarchy
117117

118-
Scopes form a hierarchy. The `Hierarchy` module defines the ancestry relation, where `_≻_` is the parent relation and `_≻*_` is the reflexive transitive closure (ancestor relation).
118+
Scopes form a hierarchy. The `Hierarchy` module defines the ancestry relation, where `_≻_` is the parent relation and `_≻*_` is the reflexive transitive closure (ancestor relation). Each scope is treated as an ancestor of itself.
119119

120120
```agda
121121
module Hierarchy where
@@ -128,6 +128,10 @@ module Hierarchy where
128128
129129
_≻*_ : Scope → Scope → Set
130130
_≻*_ = Star _≻_
131+
132+
-- Proof that the ancestry relation is reflexive.
133+
ancestry-is-reflexive : ∀ x → x ≻* x
134+
ancestry-is-reflexive _ = Star.ε
131135
```
132136

133137
## The enclosing temporary scope

0 commit comments

Comments
 (0)