@@ -10,7 +10,7 @@ open import Size using (Size; ↑_; ∞)
1010
1111open import Framework.Definitions using (𝕍; 𝔸; atoms)
1212open import Framework.VariabilityLanguage
13- open import Construct.Artifact as At using (_-<_>-; map-children) renaming (Syntax to Artifact; Construct to ArtifactC)
13+ open import Construct.Artifact as At using (map-children) renaming (Syntax to Artifact; Construct to ArtifactC)
1414
1515open import Data.EqIndexedSet
1616
@@ -24,6 +24,8 @@ data Rose : Size → 𝕍 where
2424rose-leaf : ∀ {A : 𝔸} → atoms A → Rose ∞ A
2525rose-leaf {A} a = rose (At.leaf a)
2626
27+ pattern _-<_>- a cs = rose (a At.-< cs >-)
28+
2729-- Variants are also variability languages
2830Variant-is-VL : ∀ (V : 𝕍) → VariabilityLanguage V
2931Variant-is-VL V = ⟪ V , ⊤ , (λ e c → e) ⟫
@@ -33,7 +35,7 @@ open import Data.Maybe using (nothing; just)
3335open import Relation.Binary.PropositionalEquality as Peq using (_≡_; _≗_; refl)
3436open Peq.≡-Reasoning
3537
36- children-equality : ∀ {A : 𝔸} {a₁ a₂ : atoms A} {cs₁ cs₂ : List (Rose ∞ A)} → rose ( a₁ -< cs₁ >-) ≡ rose ( a₂ -< cs₂ >-) → cs₁ ≡ cs₂
38+ children-equality : ∀ {A : 𝔸} {a₁ a₂ : atoms A} {cs₁ cs₂ : List (Rose ∞ A)} → a₁ -< cs₁ >- ≡ a₂ -< cs₂ >- → cs₁ ≡ cs₂
3739children-equality refl = refl
3840
3941Artifact∈ₛRose : Artifact ∈ₛ Rose ∞
@@ -49,8 +51,8 @@ RoseVL = Variant-is-VL (Rose ∞)
4951
5052open import Data.String using (String; _++_; intersperse)
5153show-rose : ∀ {i} {A} → (atoms A → String) → Rose i A → String
52- show-rose show-a (rose ( a -< [] >-) ) = show-a a
53- show-rose show-a (rose ( a -< es@(_ ∷ _) >-) ) = show-a a ++ "-<" ++ (intersperse ", " (map (show-rose show-a) es)) ++ ">-"
54+ show-rose show-a (a -< [] >-) = show-a a
55+ show-rose show-a (a -< es@(_ ∷ _) >-) = show-a a ++ "-<" ++ (intersperse ", " (map (show-rose show-a) es)) ++ ">-"
5456
5557
5658-- Variants can be encoded into other variability language.
@@ -123,24 +125,24 @@ rose-encoder Γ has c = record
123125 ⟦_⟧ₚ = pcong ArtifactC Γ
124126
125127 h : ∀ (v : Rose ∞ A) (j : Config Γ) → ⟦ t v ⟧ j ≡ v
126- h (rose (a -< cs >-)) j =
128+ h (rose (a At. -< cs >-)) j =
127129 begin
128- ⟦ cons (C∈ₛΓ has) (map-children t (a -< cs >-)) ⟧ j
129- ≡⟨ resistant has (map-children t (a -< cs >-)) j ⟩
130- (cons (C∈ₛV has) ∘ ⟦ map-children t (a -< cs >-)⟧ₚ) j
130+ ⟦ cons (C∈ₛΓ has) (map-children t (a At. -< cs >-)) ⟧ j
131+ ≡⟨ resistant has (map-children t (a At. -< cs >-)) j ⟩
132+ (cons (C∈ₛV has) ∘ ⟦ map-children t (a At. -< cs >-)⟧ₚ) j
131133 ≡⟨⟩
132- cons (C∈ₛV has) (⟦ map-children t (a -< cs >-) ⟧ₚ j)
134+ cons (C∈ₛV has) (⟦ map-children t (a At. -< cs >-) ⟧ₚ j)
133135 ≡⟨⟩
134- (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (map-children t (a -< cs >-))
136+ (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (map-children t (a At. -< cs >-))
135137 ≡⟨⟩
136- (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (a -< map t cs >-)
137- -- ≡⟨ Peq.cong (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (Peq.cong (a -<_>-) {!!}) ⟩
138- -- (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (a -< cs >-)
138+ (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (a At. -< map t cs >-)
139+ -- ≡⟨ Peq.cong (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (Peq.cong (a At. -<_>-) {!!}) ⟩
140+ -- (cons (C∈ₛV has) ∘ flip ⟦_⟧ₚ j) (a At. -< cs >-)
139141 ≡⟨ {!!} ⟩
140142 -- ≡⟨ bar _ ⟩
141- -- rose (pcong ArtifactC Γ (a -< map t cs >-) j)
142- -- ≡⟨ Peq.cong rose {!preservation ppp (a -< map t cs >-)!} ⟩
143- rose (a -< cs >-)
143+ -- rose (pcong ArtifactC Γ (a At. -< map t cs >-) j)
144+ -- ≡⟨ Peq.cong rose {!preservation ppp (a At. -< map t cs >-)!} ⟩
145+ rose (a At. -< cs >-)
144146 ∎
145147 where
146148 module _ where
@@ -150,8 +152,8 @@ rose-encoder Γ has c = record
150152
151153 -- unprovable
152154 -- Imagine our domain A is pairs (a , b)
153- -- Then cons could take an '(a , b) -< cs >-'
154- -- and encode it as a 'rose ((b , a) -< cs >-)'
155+ -- Then cons could take an '(a , b) At. -< cs >-'
156+ -- and encode it as a 'rose ((b , a) At. -< cs >-)'
155157 -- for which exists an inverse snoc that just has
156158 -- to swap the arguments in the pair again.
157159 -- So we need a stronger axiom here that syntax
@@ -163,8 +165,8 @@ rose-encoder Γ has c = record
163165 sno : oc ∘ rose ≗ just
164166 sno a rewrite Peq.sym (bar a) = id-l (C∈ₛV has) a
165167
166- foo : co (a -< cs >-) ≡ rose (a -< cs >-)
167- foo = bar (a -< cs >-)
168+ foo : co (a At. -< cs >-) ≡ rose (a At. -< cs >-)
169+ foo = bar (a At. -< cs >-)
168170
169171 -- lp : ∀ (e : Rose ∞ A) → ⟦ e ⟧ᵥ ⊆[ confi ] ⟦ t e ⟧
170172 -- lp (rose x) i =
0 commit comments