License | GNU LGPLv3 |
---|---|
Maintainer | paul.bittner@uni-ulm.de |
Safe Haskell | None |
Data types and functions for feature traces and presence conditions.
Synopsis
- type FeatureTrace g a = Node g a -> FeatureFormula
- emptyTrace :: FeatureTrace g a
- simplifyFeatureTrace :: (Grammar g, Show a, Eq a) => FeatureTrace g a -> AST g a -> FeatureTrace g a
- simplifyFeatureTraceOfNodes :: (Grammar g, Show a, Eq a) => FeatureTrace g a -> AST g a -> Set (Node g a) -> FeatureTrace g a
- pc :: (Grammar g, Show a, Eq a) => AST g a -> FeatureTrace g a -> Node g a -> FeatureFormula
- pc_parentpart :: (Grammar g, Show a, Eq a) => AST g a -> FeatureTrace g a -> Node g a -> FeatureFormula
- prettyPrint :: (Grammar g, Show a) => FeatureTrace g a -> AST g a -> String
Documentation
type FeatureTrace g a = Node g a -> FeatureFormula Source #
A feature trace (or feature mapping) assigns a nullable propositional formula over features to each node in an AST
.
(See Definition 3.1 in the paper).
emptyTrace :: FeatureTrace g a Source #
A feature trace with no information.
It assigns null (Nothing
) to each node.
This feature trace serves as a possible starting point for feature trace recording (e.g., when no domain knowledge was documented in a software project).
simplifyFeatureTrace :: (Grammar g, Show a, Eq a) => FeatureTrace g a -> AST g a -> FeatureTrace g a Source #
simplifyFeatureTraceOfNodes :: (Grammar g, Show a, Eq a) => FeatureTrace g a -> AST g a -> Set (Node g a) -> FeatureTrace g a Source #
Simplifies the feature mappings for all nodes in the given set from the given AST.
The given set is assumed to be a subset of the nodes in the tree.
For further information, see simplifyFeatureTrace
.
pc :: (Grammar g, Show a, Eq a) => AST g a -> FeatureTrace g a -> Node g a -> FeatureFormula Source #
Calculates the presence condition of a node (third argument) in the given tree (first argument) with the given feature traces (second argument). See Equation 1 in the paper.
pc_parentpart :: (Grammar g, Show a, Eq a) => AST g a -> FeatureTrace g a -> Node g a -> FeatureFormula Source #
Calculates the parental part of the presence condition of a node (third argument) in the given tree (first argument) with the given feature traces (second argument). Crashes when the given node is not in the given tree. (This should be more helpful for debugging instead of just returning Nothing.)
prettyPrint :: (Grammar g, Show a) => FeatureTrace g a -> AST g a -> String Source #
Pretty print the AST
and annotate all nodes with their feature mappings.