License | GNU LGPLv3 |
---|---|
Maintainer | paul.bittner@uni-ulm.de |
Safe Haskell | None |
Module of the main
function to run demos and print meta-information.
Synopsis
- data CodePrintStyle
- data TraceDisplay
- data TraceStyle
- data OutputFormat = OutputFormat {}
- userFormat :: OutputFormat
- userFormatDetailed :: OutputFormat
- astFormat :: OutputFormat
- tikzFormat :: OutputFormat
- main :: IO ()
- showExamples :: OutputFormat -> IO ()
- headline :: MonadColorPrinter m => String -> m ()
- runStepwise :: (MonadColorPrinter m, Grammar g, ASTPrettyPrinter g) => OutputFormat -> State UUID (Example m g String) -> m ()
- printASTWithTrace :: (MonadColorPrinter m, Grammar g, ASTPrettyPrinter g, Show a, Eq a) => OutputFormat -> FeatureFormulaColourPalette m -> AST g a -> FeatureTrace g a -> Doc (Attribute m)
- printTraces :: (MonadColorPrinter m, Grammar g, ASTPrettyPrinter g, Show a, Eq a) => OutputFormat -> Example m g a -> [Version g a] -> Doc (Attribute m)
- alsoShowInitialStateInHistory :: History g a -> History g a
- propositional_values :: [PropositionalFormula String]
- nullableFormula_values :: [NullableFormula String]
- showTruthtables :: IO ()
Documentation
data CodePrintStyle Source #
Style defining how to print AST
s.
ShowAST | Prints the |
ShowCode | Prints the |
ShowTikz | Print the |
Instances
Show CodePrintStyle Source # | |
Defined in Main showsPrec :: Int -> CodePrintStyle -> ShowS show :: CodePrintStyle -> String showList :: [CodePrintStyle] -> ShowS |
data TraceDisplay Source #
Format defining whether to FeatureTrace
s or presence conditions (pc
).
Trace | Show the feature mapping of each node (i.e., the formula a node is directly annotated with). |
PC | Show the presence condition of each node (i.e., the conjunction of its feature mapping with all feature mappings inherited from ancestors). |
Instances
Eq TraceDisplay Source # | |
Defined in Main (==) :: TraceDisplay -> TraceDisplay -> Bool (/=) :: TraceDisplay -> TraceDisplay -> Bool | |
Show TraceDisplay Source # | |
Defined in Main showsPrec :: Int -> TraceDisplay -> ShowS show :: TraceDisplay -> String showList :: [TraceDisplay] -> ShowS |
data TraceStyle Source #
Style defining how to print FeatureTrace
s.
Text | Show feature mapping formulas as plain text. |
Colour | Encode features as colours to visualize feature mappings by colouring source code. |
None | Do not show feature traces at all. |
Instances
Eq TraceStyle Source # | |
Defined in Main (==) :: TraceStyle -> TraceStyle -> Bool (/=) :: TraceStyle -> TraceStyle -> Bool | |
Show TraceStyle Source # | |
Defined in Main showsPrec :: Int -> TraceStyle -> ShowS show :: TraceStyle -> String showList :: [TraceStyle] -> ShowS |
data OutputFormat Source #
Format in which code and (recorded) feature mappings should be printed to the terminal.
OutputFormat | |
|
userFormat :: OutputFormat Source #
The perspective of the developer, who is editing code while traces are recorded in the background This is the format used in the figures in the paper.
userFormatDetailed :: OutputFormat Source #
A variation of userFormat
where traces and presence conditions can be investigated seperately at the same time.
Code is coloured in the colour of its trace while presence conditions are indicated by coloured lines on the left.
astFormat :: OutputFormat Source #
Shows the AST
of the source code with FeatureTrace
s as formulas.
tikzFormat :: OutputFormat Source #
Tikz export of AST
with FeatureTrace
s.
Used for figures in the paper.
Entry point of the demo.
The main method will run and print the output of all examples (Alice, Bob, and the edit patterns).
You can change the format of the printed source code and feature mappings by changing the format
parameter inside main
.
Additionally, you might want to look at the truthtable of the ternary logic by Sobocinski we use (by uncommenting the line showTruthtables
).
showExamples :: OutputFormat -> IO () Source #
Runs the motivating example from the paper and examples for all edit patterns with the given OutputFormat
.
First, runs Alice's example where she records feature traces upon editing the pop method of a class Stack in Java (Figure 1 in the paper).
Second, shows how Bob could propagate Alice's edits and recorded feature traces to his variant as envisioned in future research.
Third, shows an instance of each edit pattern from our evaluation.
headline :: MonadColorPrinter m => String -> m () Source #
Turns the given text into a headline in the terminal. We indicate headlines with a red background.
runStepwise :: (MonadColorPrinter m, Grammar g, ASTPrettyPrinter g) => OutputFormat -> State UUID (Example m g String) -> m () Source #
Runs the given Example
in the given OutputFormat
step by step (i.e., showing all intermediate results).
printASTWithTrace :: (MonadColorPrinter m, Grammar g, ASTPrettyPrinter g, Show a, Eq a) => OutputFormat -> FeatureFormulaColourPalette m -> AST g a -> FeatureTrace g a -> Doc (Attribute m) Source #
Prints the given AST
with the given FeatureTrace
s in the given OutputFormat
.
If the OutputFormat
mandates to visualize feature mappings as colours (see TraceStyle
),
the given FeatureFormulaColourPalette
will be used to assign colours to feature formulas.
printTraces :: (MonadColorPrinter m, Grammar g, ASTPrettyPrinter g, Show a, Eq a) => OutputFormat -> Example m g a -> [Version g a] -> Doc (Attribute m) Source #
Prints the given list of versions that were produced from the given example.
alsoShowInitialStateInHistory :: History g a -> History g a Source #
Helper function to show the initial state of the given history in printTraces
.
Prepends an identity edit and dummy FeatureContext
.
The context could be anything and thus is set to Nothing
(null).
propositional_values :: [PropositionalFormula String] Source #
Helper function to help with type inference.
Returns all atomic values of a PropositionalFormula
(over strings).
nullableFormula_values :: [NullableFormula String] Source #
Helper function to help with type inference.
Returns all atomic values of a NullableFormula
(over strings).
showTruthtables :: IO () Source #
Prints truthtables for common operators in PropositionalFormula
s and NullableFormula
s (not, and, or, implies, equiv)