Skip to content

Commit 5f5c68c

Browse files
committed
documentation fixes and refinements
1 parent 3d9b8e1 commit 5f5c68c

31 files changed

Lines changed: 400 additions & 367 deletions

app/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ propositional_values = lvalues
256256
nullableFormula_values :: [NullableFormula String]
257257
nullableFormula_values = lvalues
258258

259-
-- | Prints truthtables for common operators in 'PropositionalFormula's and 'NullableFormulas' (not, and, or, implies, equiv)
259+
-- | Prints truthtables for common operators in 'PropositionalFormula's and 'NullableFormula's (not, and, or, implies, equiv)
260260
showTruthtables :: IO()
261261
showTruthtables = withTerminal $ runTerminalT $
262262
do

app/examples/Example.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ import FeatureColour (FeatureFormulaColourPalette)
1414
import Control.Monad.State ( State, runState )
1515
import UUID
1616

17-
-- | An 'Example' represents a single demo showcase of feature trace recording.
18-
-- * @m@ Monad defining colours which is used for printing an examples output.
19-
-- * @g@ Grammar of the example (e.g., if the examples shows the development of Java or C++ or Haskell source code).
20-
-- * @a@ Value type of the artefacts in the 'AST's (e.g., @String@).
17+
{- | An 'Example' represents a single demo showcase of feature trace recording.
18+
19+
- @m@: Monad defining colours which is used for printing an examples output.
20+
- @g@: Grammar of the example (e.g., if the examples shows the development of Java or C++ or Haskell source code).
21+
- @a@: Value type of the artefacts in the 'AST's (e.g., @String@).
22+
-}
2123
data Example m g a = Example {
2224
-- | The name of the example to identify it.
2325
name :: String,

docs/html/AST.html

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

docs/html/ASTPrettyPrinter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* an indent generator that can generate an indent of a certain width within the context of printing a certain node (e.g., <code>(_ i -&gt; genIndent i)</code>),
55
* a function to lift strings to the output type b within the context of printing a certain node,
66
* a function print nodes, and
7-
* the AST to print.</p></div></div><div class="subs instances"><h4 class="instances details-toggle-control details-toggle" data-details-id="i:ASTPrettyPrinter">Instances</h4><details id="i:ASTPrettyPrinter" open="open"><summary class="hide-when-js-enabled">Instances details</summary><table><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:ASTPrettyPrinter:ASTPrettyPrinter:1"></span> <a href="ASTPrettyPrinter.html#t:ASTPrettyPrinter" title="ASTPrettyPrinter">ASTPrettyPrinter</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a></span> <a href="src/SimpleJava.html#line-158" class="link">Source</a> <a href="#t:ASTPrettyPrinter" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:ASTPrettyPrinter:ASTPrettyPrinter:1"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="SimpleJava.html">SimpleJava</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:prettyPrint">prettyPrint</a> :: Monoid b =&gt; b -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; Int -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; String -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; b) -&gt; <a href="AST.html#t:AST" title="AST">AST</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; b <a href="src/ASTPrettyPrinter.html#prettyPrint" class="link">Source</a> <a href="#v:prettyPrint" class="selflink">#</a></p></div></details></td></tr></table></details></div></div><div class="top"><p class="src"><a id="v:showCode" class="def">showCode</a> :: (Show a, <a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, <a href="ASTPrettyPrinter.html#t:ASTPrettyPrinter" title="ASTPrettyPrinter">ASTPrettyPrinter</a> g) =&gt; <a href="AST.html#t:AST" title="AST">AST</a> g a -&gt; String <a href="src/ASTPrettyPrinter.html#showCode" class="link">Source</a> <a href="#v:showCode" class="selflink">#</a></p><div class="doc"><p>Default implementation for pretty printing an AST to a <code>String</code>.</p></div></div><div class="top"><p class="src"><a id="v:showCodeAs" class="def">showCodeAs</a> :: (Monoid b, <a href="ASTPrettyPrinter.html#t:ASTPrettyPrinter" title="ASTPrettyPrinter">ASTPrettyPrinter</a> g) =&gt; b -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> g a -&gt; Int -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> g a -&gt; String -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> g a -&gt; b) -&gt; <a href="AST.html#t:AST" title="AST">AST</a> g a -&gt; b <a href="src/ASTPrettyPrinter.html#showCodeAs" class="link">Source</a> <a href="#v:showCodeAs" class="selflink">#</a></p><div class="doc"><p>Alias for <code><a href="ASTPrettyPrinter.html#v:prettyPrint" title="ASTPrettyPrinter">prettyPrint</a></code>.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.23.0</p></div></body></html>
7+
* the AST to print.</p></div></div><div class="subs instances"><h4 class="instances details-toggle-control details-toggle" data-details-id="i:ASTPrettyPrinter">Instances</h4><details id="i:ASTPrettyPrinter" open="open"><summary class="hide-when-js-enabled">Instances details</summary><table><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:ic:ASTPrettyPrinter:ASTPrettyPrinter:1"></span> <a href="ASTPrettyPrinter.html#t:ASTPrettyPrinter" title="ASTPrettyPrinter">ASTPrettyPrinter</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a></span> <a href="src/SimpleJava.html#line-159" class="link">Source</a> <a href="#t:ASTPrettyPrinter" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:ic:ASTPrettyPrinter:ASTPrettyPrinter:1"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="SimpleJava.html">SimpleJava</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:prettyPrint">prettyPrint</a> :: Monoid b =&gt; b -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; Int -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; String -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; b) -&gt; <a href="AST.html#t:AST" title="AST">AST</a> <a href="SimpleJava.html#t:SimpleJavaGrammar" title="SimpleJava">SimpleJavaGrammar</a> a -&gt; b <a href="src/ASTPrettyPrinter.html#prettyPrint" class="link">Source</a> <a href="#v:prettyPrint" class="selflink">#</a></p></div></details></td></tr></table></details></div></div><div class="top"><p class="src"><a id="v:showCode" class="def">showCode</a> :: (Show a, <a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, <a href="ASTPrettyPrinter.html#t:ASTPrettyPrinter" title="ASTPrettyPrinter">ASTPrettyPrinter</a> g) =&gt; <a href="AST.html#t:AST" title="AST">AST</a> g a -&gt; String <a href="src/ASTPrettyPrinter.html#showCode" class="link">Source</a> <a href="#v:showCode" class="selflink">#</a></p><div class="doc"><p>Default implementation for pretty printing an AST to a <code>String</code>.</p></div></div><div class="top"><p class="src"><a id="v:showCodeAs" class="def">showCodeAs</a> :: (Monoid b, <a href="ASTPrettyPrinter.html#t:ASTPrettyPrinter" title="ASTPrettyPrinter">ASTPrettyPrinter</a> g) =&gt; b -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> g a -&gt; Int -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> g a -&gt; String -&gt; b) -&gt; (<a href="AST.html#t:Node" title="AST">Node</a> g a -&gt; b) -&gt; <a href="AST.html#t:AST" title="AST">AST</a> g a -&gt; b <a href="src/ASTPrettyPrinter.html#showCodeAs" class="link">Source</a> <a href="#v:showCodeAs" class="selflink">#</a></p><div class="doc"><p>Alias for <code><a href="ASTPrettyPrinter.html#v:prettyPrint" title="ASTPrettyPrinter">prettyPrint</a></code>.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.23.0</p></div></body></html>

docs/html/DefaultFeatureTraceRecording.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>DefaultFeatureTraceRecording</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption empty">&nbsp;</span><ul class="links" id="page-menu"><li><a href="src/DefaultFeatureTraceRecording.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">DefaultFeatureTraceRecording</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Implementation of feature trace recording as proposed in the paper (Section 4.2).</p></div></div><div id="synopsis"><details id="syn"><summary>Synopsis</summary><ul class="details-toggle" data-details-id="syn"><li class="src short"><a href="#v:defaultFeatureTraceRecording">defaultFeatureTraceRecording</a> :: (<a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, Show a, Eq a) =&gt; <a href="FeatureTraceRecording.html#t:FeatureTraceRecording" title="FeatureTraceRecording">FeatureTraceRecording</a> g a</li><li class="src short"><a href="#v:nullifyMandatory">nullifyMandatory</a> :: <a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a -&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li><li class="src short"><a href="#v:removeTheRedundanciesWeIntroduced">removeTheRedundanciesWeIntroduced</a> :: (<a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, Eq a, Show a) =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a -&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li><li class="src short"><a href="#v:r_id">r_id</a> :: <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li><li class="src short"><a href="#v:r_trace">r_trace</a> :: Eq a =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li><li class="src short"><a href="#v:r_ins">r_ins</a> :: (Show a, Eq a) =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li><li class="src short"><a href="#v:r_del">r_del</a> :: (<a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, Eq a, Show a) =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li><li class="src short"><a href="#v:r_move">r_move</a> :: (Show a, Eq a) =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li><li class="src short"><a href="#v:r_up">r_up</a> :: (Eq a, Show a) =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a</li></ul></details></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:defaultFeatureTraceRecording" class="def">defaultFeatureTraceRecording</a> :: (<a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, Show a, Eq a) =&gt; <a href="FeatureTraceRecording.html#t:FeatureTraceRecording" title="FeatureTraceRecording">FeatureTraceRecording</a> g a <a href="src/DefaultFeatureTraceRecording.html#defaultFeatureTraceRecording" class="link">Source</a> <a href="#v:defaultFeatureTraceRecording" class="selflink">#</a></p><div class="doc"><p>This is the default implementation of feature trace recording we propose in the paper.
22
For each type of edit, we choose one of the four recording functions from R_ins, R_del, R_mov, and R_up.
3-
Next to these four functions, we support two more default recording function in this library, r_id and r_trace.
4-
We use r_id for technical reasones (e.g., folds, printing) and it does nothing.
5-
We use r_trace to manually change the feature mappings of a set of nodes without changing the source code.</p></div></div><div class="top"><p class="src"><a id="v:nullifyMandatory" class="def">nullifyMandatory</a> :: <a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a -&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a <a href="src/DefaultFeatureTraceRecording.html#nullifyMandatory" class="link">Source</a> <a href="#v:nullifyMandatory" class="selflink">#</a></p><div class="doc"><p>Sets the feature mapping of all mandatory AST nodes to <em>null</em>.</p></div></div><div class="top"><p class="src"><a id="v:removeTheRedundanciesWeIntroduced" class="def">removeTheRedundanciesWeIntroduced</a> :: (<a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, Eq a, Show a) =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a -&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a <a href="src/DefaultFeatureTraceRecording.html#removeTheRedundanciesWeIntroduced" class="link">Source</a> <a href="#v:removeTheRedundanciesWeIntroduced" class="selflink">#</a></p><div class="doc"><p>This simplifies feature traces with respect to presence conditions.
3+
Next to these four functions, we support two more default recording function in this library, <code><a href="DefaultFeatureTraceRecording.html#v:r_id" title="DefaultFeatureTraceRecording">r_id</a></code> and <code><a href="DefaultFeatureTraceRecording.html#v:r_trace" title="DefaultFeatureTraceRecording">r_trace</a></code>.
4+
We use <code><a href="DefaultFeatureTraceRecording.html#v:r_id" title="DefaultFeatureTraceRecording">r_id</a></code> for technical reasones (e.g., folds, printing) and it does nothing.
5+
We use <code><a href="DefaultFeatureTraceRecording.html#v:r_trace" title="DefaultFeatureTraceRecording">r_trace</a></code> to manually change the feature mappings of a set of nodes without changing the source code.</p></div></div><div class="top"><p class="src"><a id="v:nullifyMandatory" class="def">nullifyMandatory</a> :: <a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a -&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a <a href="src/DefaultFeatureTraceRecording.html#nullifyMandatory" class="link">Source</a> <a href="#v:nullifyMandatory" class="selflink">#</a></p><div class="doc"><p>Sets the feature mapping of all mandatory AST nodes to <em>null</em>.</p></div></div><div class="top"><p class="src"><a id="v:removeTheRedundanciesWeIntroduced" class="def">removeTheRedundanciesWeIntroduced</a> :: (<a href="Grammar.html#t:Grammar" title="Grammar">Grammar</a> g, Eq a, Show a) =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a -&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a <a href="src/DefaultFeatureTraceRecording.html#removeTheRedundanciesWeIntroduced" class="link">Source</a> <a href="#v:removeTheRedundanciesWeIntroduced" class="selflink">#</a></p><div class="doc"><p>This simplifies feature traces with respect to presence conditions.
66
See <code><a href="FeatureTrace.html#v:simplifyFeatureTrace" title="FeatureTrace">simplifyFeatureTrace</a></code> and <code><a href="Simplify.html#v:removeRedundancy" title="Simplify">removeRedundancy</a></code> for further information.</p></div></div><div class="top"><p class="src"><a id="v:r_id" class="def">r_id</a> :: <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a <a href="src/DefaultFeatureTraceRecording.html#r_id" class="link">Source</a> <a href="#v:r_id" class="selflink">#</a></p><div class="doc"><p>Feature trace recording for identity edit:
77
When nothing is changed, nothing has to be recorded.</p></div></div><div class="top"><p class="src"><a id="v:r_trace" class="def">r_trace</a> :: Eq a =&gt; <a href="FeatureTraceRecording.html#t:RecordingFunction" title="FeatureTraceRecording">RecordingFunction</a> g a <a href="src/DefaultFeatureTraceRecording.html#r_trace" class="link">Source</a> <a href="#v:r_trace" class="selflink">#</a></p><div class="doc"><p>Feature trace recording on an identity edit with non-empty delta.
88
This function allows changing feature traces manually (i.e., without actual source code changes).

0 commit comments

Comments
 (0)