<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Subtree</string-name>
        </contrib>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Port</p>
    </sec>
    <sec id="sec-2">
      <title>2.1 Input Metamodel: Truth Tables</title>
      <p>The input metamodel is shown on Figure 1. The TruthTable class is as the root of the model, and contains
a collection of Ports and Rows. Ports come in two types: InputPorts and OutputPorts. Rows contain
sequences of Cells, which assign values to the InputPorts and OutputPorts of the table.</p>
      <p>Automated EMF opposite references are used liberally in the metamodel to simplify the specification of the
transformation. owner is used to access the container from several child objects (e.g. the TruthTable of a
Row), and it is possible to see which cells referenced a specific Port.</p>
      <p>A sample model is shown on Table 1. The truth table has four InputPorts named A to D, and one
OutputPort named S. The first Row contains only 3 Cells, specifying that if A and B are 0, then S should be 0.
2.2</p>
    </sec>
    <sec id="sec-3">
      <title>Output Metamodel: Binary Decision Trees</title>
      <p>The original output metamodel from the ATL Zoo version is shown on Figure 2. The BDD class is the root of the
model, and contains the root of the Tree and a collection of Ports. Similarly to the Truth Tables metamodel,
there are InputPorts and OutputPorts.</p>
      <p>Figure 3 shows the changes introduced into a revised version of the original metamodel, which allow the
BDD to be a rooted acyclic graph and not just a tree. This would allow the BDD to reuse common subtrees,
which would produce more compact circuits in some situations. The case provides both versions as separate
metamodels: solution implementers were free to choose either version.</p>
      <p>Tree is the common superclass for any node in the tree. Inner nodes check the value of an InputPort: if
it is a false value, evaluation will proceed through the treeForZero Tree; otherwise, evaluation will go through
[1..1] treeForOne</p>
      <p>[1..1] treeForZero</p>
      <p>BDD
the treeForOne Tree. Leaf nodes are Leaf objects, which provide an Assignment of a boolean value to each
of the available OutputPorts.</p>
      <p>The equivalent BDD for the truth table on Table 1 is shown on Figure 4. Subtrees are represented by the
circle referencing an InputPort and their subtrees for when the port takes a 0 or 1 value. Assignments are
represented by the highlighted nodes that provide values to the OutputPorts.
2.3</p>
    </sec>
    <sec id="sec-4">
      <title>Process Outline</title>
      <p>The transformation essentially needs to construct a (preferably minimal) binary decision diagram that produces
the same values for the output ports, given the same values in the input ports. Given the high interest about
this problem in circuit design, many algorithms have been proposed in the literature.</p>
      <p>Solution authors are welcome to implement a more optimal algorithm in their transformation tool. This
section will only outline a simple approach that can be readily implemented without too much complication.</p>
      <p>There are some basic mappings which are immediately obvious:</p>
      <p>Each TruthTable object should correspond to a BDD object, with the same name and equivalent Ports.
Each InputPort and OutputPort should be mapped to an object of the BDD type with the same name.</p>
      <p>Each Row should become a Leaf node: the Cells for the OutputPorts will become Assignments.</p>
      <p>The complexity is in deriving the inner nodes: the Subtree objects. One simple approach is to find a TT
InputPort which is (ideally) defined in all the Rows, and turn it into an inner node (a Subtree) which points
to the equivalent BDD InputPort and has two Trees:</p>
      <p>The zero subtree, produced from the Row(s) where the port was 0. This will be a Subtree if there are
at least two rows in that situation: the transformation should proceed recursively in this case with those
rows, excluding the input ports that have already been considered. If there is only one such row, this would
simply point to the Leaf created above.</p>
      <p>The one subtree, produced in a parallel way to the zero subtree.
D
1</p>
      <p>C
0
B</p>
      <p>1
S = 0
0
S = 0</p>
      <p>This simple approach does not necessarily ensure a minimal subtree, as in some points there may be multiple
ports to choose from. It may require improvements for cases where there are no input ports which are defined
in all available rows.
3</p>
      <sec id="sec-4-1">
        <title>Main Task</title>
        <p>The main task was implementing the transformation, ensuring that the BDDs were equivalent to the original
truth table. To simplify the work involved, the case included an Eclipse Modelling Framework implementation,
and a set of sample XMI input models conforming to the metamodels.</p>
        <p>The models folder includes two additional tools:</p>
        <p>A generator that produced truth tables of an arbitrary number of input and output ports, given a seed.
A validator that checked if a BDD model was equivalent to a source truth table model, by evaluating all
possible input combinations through the BDD and comparing the values of the OutputPorts.</p>
        <p>Solutions could focus on any specific quality attribute of the transformation beyond optimality and
performance. For instance, it may be useful to be able to prove that the transformation does indeed produce a BDD
which is equivalent to the TT (even if suboptimal). One of the solutions did focus on verifiability.
4</p>
      </sec>
      <sec id="sec-4-2">
        <title>Benchmark Framework</title>
        <p>
          If focusing on performance, the solution authors had to integrate their solution with the provided benchmark
framework. It is based on that of the TTC 2017 Smart Grid case [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], and supports the automated build and
execution of solutions. The framework consists of a Python 3.3 script which directs the process, and a set of R
scripts which perform basic data analysis and reporting.
        </p>
        <p>The benchmark consisted of three phases: Initialisation (setting up the basic infrastructure), Load (for
loading the models), and Run (for executing the transformation and saving the results).</p>
        <p>Solutions had to be forks of the main Github project2, for their later integration into the main Github
repository. The solutions could be implemented in any language: they only had to print to the standard output
lines in a specific format, mentioning the memory usage and wall clock time spent in transforming each model.</p>
        <p>The solutions had to include a solution.ini file with instructions on how to automatically build, test, and
run them. Solutions were run multiple times, as indicated in the main configuration of the benchmark. To ensure
reproducibility, the solutions were integrated into a Docker image, which is automatically built by Docker Hub
on each push3.
5</p>
      </sec>
      <sec id="sec-4-3">
        <title>Evaluation</title>
        <p>Given the call for a broader set of research interests in this transformation, the evaluation operated on two
dimensions:
2https://github.com/TransformationToolContest/ttc2019-tt2bdd
3https://hub.docker.com/r/bluezio/ttc2019-tt2bdd-git</p>
        <p>Was it a high-quality model transformation? The transformation should be complete, correct, easy to
understand, efficient, and produce optimal results.</p>
        <p>The validator was used to check the produced BDDs against the source truth tables, and the authors had
to provide a convincing argument about the correctness of the solution.</p>
        <p>The understandability of the solution was evaluated through an audience survey, and the Docker image was
used by the contest organizers to provide independent measurements of memory and time usage in identical
conditions. Particularly, Google Cloud Compute c2-standard-4 images were used.</p>
        <p>Tree sizes for the BDDs were considered for the optimality of the transformations: the smaller, the better.
Did it highlight a promising research direction? Although the transformation may not be entirely complete
or may be harder to understand, it may serve as an example of an active research area within model
transformations that the community may wish to showcase.</p>
        <p>This may include aspects such as incrementality, bidirectionality, traceability, verifiability, or the ability to
visualize interactively the transformation, among other areas of interest in the field.</p>
        <p>As mentioned before, there was one solution which focused on the verifiability of the solution. This solution
received an award for the promising results towards integrating verifiability in a model transformation
language.</p>
      </sec>
      <sec id="sec-4-4">
        <title>References</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Anthony</given-names>
            <surname>Anjorin</surname>
          </string-name>
          , Thomas Buchmann, and
          <string-name>
            <given-names>Bernhard</given-names>
            <surname>Westfechtel</surname>
          </string-name>
          .
          <article-title>The Families to Persons Case</article-title>
          .
          <source>In Proceedings of the 10th Transformation Tool Contest</source>
          , volume
          <volume>2026</volume>
          , pages
          <fpage>27</fpage>
          -
          <lpage>34</lpage>
          , Marburg, Germany,
          <year>July 2017</year>
          .
          <article-title>CEUR-WS.org</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Martin</given-names>
            <surname>Fleck</surname>
          </string-name>
          and
          <string-name>
            <given-names>Javier</given-names>
            <surname>Troya</surname>
          </string-name>
          .
          <article-title>The Class Responsibility Assignment Case</article-title>
          .
          <source>In Proceedings of the 9th Transformation Tool Contest</source>
          , volume
          <volume>1758</volume>
          , pages
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          , Vienna, Austria,
          <year>July 2016</year>
          .
          <article-title>CEUR-WS.org</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Antonio</given-names>
            <surname>García-Domínguez</surname>
          </string-name>
          .
          <article-title>TTC'16 live contest case study: execution of dataflow-based model transformations</article-title>
          . https://www.transformation-tool-contest.eu/2016/livecontest.html,
          <year>July 2016</year>
          .
          <source>Last accessed on 2019-05-10</source>
          . Archived on http://archive.is/gHEys.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Götz</surname>
          </string-name>
          , Johannes Mey, René Schöne, and
          <string-name>
            <given-names>Uwe</given-names>
            <surname>Aßmann</surname>
          </string-name>
          .
          <article-title>Quality-based Software-Selection and Hardware-Mapping as Model Transformation Problem</article-title>
          .
          <source>In Proceedings of the 11th Transformation Tool Contest</source>
          , volume
          <volume>2310</volume>
          , pages
          <fpage>3</fpage>
          -
          <lpage>11</lpage>
          , Toulouse, France,
          <year>June 2018</year>
          .
          <article-title>CEUR-WS.org</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Georg</given-names>
            <surname>Hinkel</surname>
          </string-name>
          .
          <article-title>The TTC 2017 live contest on transformation reuse in the presence of multiple inheritance and redefinitions</article-title>
          . https://www.transformation-tool-contest.eu/2017/solutions_livecontest.html,
          <year>July 2017</year>
          .
          <source>Last accessed on 2019-05-10</source>
          . Archived on http://archive.is/gHEys.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Georg</given-names>
            <surname>Hinkel</surname>
          </string-name>
          .
          <article-title>The TTC 2017 Outage System Case for Incremental Model Views</article-title>
          .
          <source>In Proceedings of the 10th Transformation Tool Contest</source>
          , volume
          <volume>2026</volume>
          , pages
          <fpage>3</fpage>
          -
          <lpage>12</lpage>
          , Marburg, Germany,
          <year>July 2017</year>
          .
          <article-title>CEUR-WS.org</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Georg</given-names>
            <surname>Hinkel</surname>
          </string-name>
          .
          <source>The TTC 2018 Social Media Case. In Proceedings of the 11th Transformation Tool Contest</source>
          , volume
          <volume>2310</volume>
          , pages
          <fpage>39</fpage>
          -
          <lpage>43</lpage>
          , Toulouse, France,
          <year>June 2018</year>
          .
          <article-title>CEUR-WS.org</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Guillaume</given-names>
            <surname>Savaton</surname>
          </string-name>
          .
          <article-title>Truth Tables to Binary Decision Diagrams, ATL Transformations</article-title>
          . https://www. eclipse.org/atl/atlTransformations/#TT2BDD,
          <year>February 2006</year>
          . Last accessed on 2019-
          <volume>05</volume>
          -
          <fpage>14</fpage>
          . Archived on http://archive.is/HdoHM.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>