-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split variants file into defs and default langs
- Loading branch information
Showing
8 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
open import Framework.V2.Definitions using (𝕍; 𝔸) | ||
module Framework.V2.Variant (V : 𝕍) (A : 𝔸) where | ||
|
||
open import Data.Fin using (Fin) | ||
open import Data.List using (List) | ||
open import Data.Nat using (ℕ; suc) | ||
|
||
open import Level using (0ℓ) | ||
open import Relation.Binary using (Setoid) | ||
import Relation.Binary.PropositionalEquality as Eq | ||
|
||
import Data.IndexedSet | ||
|
||
VariantSetoid : Setoid 0ℓ 0ℓ | ||
VariantSetoid = Eq.setoid (V A) | ||
|
||
module IVSet = Data.IndexedSet VariantSetoid | ||
|
||
IndexedVMap : Set → Set | ||
IndexedVMap I = IndexedSet I | ||
where open IVSet using (IndexedSet) | ||
|
||
{-| | ||
Variant maps constitute the semantic domain of variability languages. | ||
While we defined variant maps to be indexed sets with an arbitrary finite and non-empty index set, we directly reflect these properties | ||
via Fin (suc n) here for convenience. | ||
-} | ||
VMap : ℕ → Set | ||
VMap n = IndexedVMap (Fin (suc n)) | ||
|
||
forget-first : ∀ {n} → VMap (suc n) → VMap n | ||
forget-first set i = set (Data.Fin.suc i) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,12 @@ | ||
module Framework.V2.Variants where | ||
|
||
open import Data.Fin using (Fin) | ||
open import Data.List using (List) | ||
open import Data.Nat using (ℕ; suc) | ||
|
||
open import Level using (0ℓ) | ||
open import Relation.Binary using (Setoid) | ||
import Relation.Binary.PropositionalEquality as Eq | ||
|
||
open import Framework.V2.Definitions using (𝕍; 𝔸) | ||
open import Framework.V2.Constructs.Plain.Artifact using (Artifact) | ||
|
||
import Data.IndexedSet | ||
|
||
data GrulerVariant : 𝕍 where | ||
asset : ∀ {A : 𝔸} (a : A) → GrulerVariant A | ||
_∥_ : ∀ {A : 𝔸} (l : GrulerVariant A) → (r : GrulerVariant A) → GrulerVariant A | ||
|
||
data Rose : 𝕍 where | ||
artifact : ∀ {A : 𝔸} → Artifact A (Rose A) → Rose A | ||
|
||
VariantSetoid : 𝕍 → 𝔸 → Setoid 0ℓ 0ℓ | ||
VariantSetoid V A = Eq.setoid (V A) | ||
|
||
module IVSet (V : 𝕍) (A : 𝔸) = Data.IndexedSet (VariantSetoid V A) | ||
|
||
IndexedVMap : 𝕍 → 𝔸 → Set → Set | ||
IndexedVMap V A I = IndexedSet I | ||
where open IVSet V A using (IndexedSet) | ||
|
||
{-| | ||
Variant maps constitute the semantic domain of variability languages. | ||
While we defined variant maps to be indexed sets with an arbitrary finite and non-empty index set, we directly reflect these properties | ||
via Fin (suc n) here for convenience. | ||
-} | ||
VMap : 𝕍 → 𝔸 → ℕ → Set | ||
VMap V A n = IndexedVMap V A (Fin (suc n)) |