Skip to content

Commit ee87406

Browse files
committed
feat: check if rose tree has a particular atom
1 parent f3b696e commit ee87406

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Vatras/Framework/Variants.agda

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,13 @@ module _ (V : 𝕍) (A : 𝔸) {L : VariabilityLanguage V} (encoder : VariantEnc
133133
≡⟨⟩
134134
v
135135
136+
137+
-- atom containment
138+
open import Relation.Nullary.Decidable using (yes; no)
139+
open import Data.Bool using (Bool; true)
140+
open import Data.List using (or)
141+
142+
has-atom : {A i} atoms A Rose i A Bool
143+
has-atom {A , _≟_} a (b -< cs >-) with a ≟ b
144+
... | yes refl = true
145+
... | no x = or (map (has-atom b) cs)

0 commit comments

Comments
 (0)