Skip to content
Snippets Groups Projects
Commit 21bbb40a authored by Antonio García-Domínguez's avatar Antonio García-Domínguez
Browse files

Translate ATL code to English

parent 1c8ba298
No related branches found
No related tags found
No related merge requests found
...@@ -69,29 +69,29 @@ rule Cell2Subtree { ...@@ -69,29 +69,29 @@ rule Cell2Subtree {
} }
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
-- Partitionner une partie de la table de vérité. -- Partition one part of the truth table.
-- --
-- Ce helper effectue un travail préparatoire à la création d'un arbre binaire. -- This helper performs some preparatory work before the creation of a binary tree.
-- En prenant une sous-ensemble des lignes d'une table de vérité et un port de référence, il -- It takes a subsequence of the rows of a truth table and a certain port, and returns
-- retourne deux sous-ensembles de lignes : celles pour lesquelles le port vaut faux -- two subsequences of rows: cells for which the port is false, and cells for which the
-- et celles pour lesquelles le port vaut vrai. -- port is true.
-- --
-- Entrées : -- Inputs:
-- rows : l'ensemble des lignes à traiter -- rows : the collection of lines to be processed.
-- port : le port qui doit servir de référence au partitionnement -- port : the port which should act as a reference for the partitioning.
-- --
-- Sorties : -- Outputs:
-- un tuple contenant : -- a tuple that contains:
-- zeroPart : l'ensemble des lignes pour lesquelles ce port vaut zéro (faux) -- zeroPart : the collection of rows for which the port is 0 (false)
-- onePart : l'ensemble des lignes pour lesquelles ce port vaut un (vrai) -- onePart : the collection of rows for which the port is 1 (true)
-- --
-- Préconditions : -- Preconditions :
-- --
-- Le port à utiliser doit être un port d'entrée : -- The port to be used must be an input port :
-- --
-- port.oclIsKindOf(TT!InputPort)) -- port.oclIsKindOf(TT!InputPort))
-- --
-- Sa valeur est définie dans toutes les lignes -- The value is defined for all rows:
-- --
-- rows->forAll(r | -- rows->forAll(r |
-- r.cells->collect(c | c.port) -- r.cells->collect(c | c.port)
...@@ -102,7 +102,7 @@ helper def: ...@@ -102,7 +102,7 @@ helper def:
getPartition(rows : Sequence(TT!Row), port : TT!Port) getPartition(rows : Sequence(TT!Row), port : TT!Port)
: TupleType( zeroPart : Sequence(TT!Row) , onePart : Sequence(TT!Row) ) = : TupleType( zeroPart : Sequence(TT!Row) , onePart : Sequence(TT!Row) ) =
-- Sélectionner les lignes pour lesquelles ce port vaut faux -- Select the rows for which the port is false
let _zeroPart : Sequence(TT!Row) = let _zeroPart : Sequence(TT!Row) =
rows->select(r | rows->select(r |
r.cells->exists(c | r.cells->exists(c |
...@@ -110,7 +110,7 @@ helper def: ...@@ -110,7 +110,7 @@ helper def:
) )
) in ) in
-- Sélectionner les lignes pour lesquelles ce port vaut vrai -- Select the rows for which the port is true
let _onePart : Sequence(TT!Row) = let _onePart : Sequence(TT!Row) =
rows->select(r | rows->select(r |
r.cells->exists(c | r.cells->exists(c |
...@@ -118,7 +118,7 @@ helper def: ...@@ -118,7 +118,7 @@ helper def:
) )
) in ) in
-- Construire le tuple résultat -- Build the resulting tuple
Tuple{ Tuple{
zeroPart = _zeroPart, zeroPart = _zeroPart,
onePart = _onePart onePart = _onePart
...@@ -149,8 +149,7 @@ helper def: ...@@ -149,8 +149,7 @@ helper def:
getTree(rows : Sequence(TT!Row), usablePorts : Sequence(TT!Port)) getTree(rows : Sequence(TT!Row), usablePorts : Sequence(TT!Port))
: TupleType( cell : TT!Cell , zeroSubtree : OclAny , oneSubtree : OclAny ) = : TupleType( cell : TT!Cell , zeroSubtree : OclAny , oneSubtree : OclAny ) =
-- Parmi tous les ports utilisables, en choisir un dont la valeur est définie -- Among the usable ports, select one where the value is defined in all rows
-- dans toutes les lignes
let _port : TT!Port = let _port : TT!Port =
usablePorts->any(p | usablePorts->any(p |
rows->forAll(r | rows->forAll(r |
...@@ -159,19 +158,19 @@ helper def: ...@@ -159,19 +158,19 @@ helper def:
) )
) in ) in
-- Sélectionner une cellule qui définit une valeur pour ce port -- Select a cell which defines a value for the port
let _cell : TT!Cell = let _cell : TT!Cell =
rows->first().cells->any(c | c.port = _port) in rows->first().cells->any(c | c.port = _port) in
-- Partitionner l'ensemble de lignes fourni -- Partition the provided collection of rows
let _part : TupleType( zeroPart : Sequence(TT!Row), onePart : Sequence(TT!Row) ) = let _part : TupleType( zeroPart : Sequence(TT!Row), onePart : Sequence(TT!Row) ) =
thisModule.getPartition(rows, _port) in thisModule.getPartition(rows, _port) in
-- Définir le nouvel ensemble de ports utilisables pour les partitionnements ultérieurs -- Define the new collection of usable ports for the resulting partitionings
let _updatedPorts : Sequence(TT!Port) = let _updatedPorts : Sequence(TT!Port) =
usablePorts->excluding(_port) in usablePorts->excluding(_port) in
-- Construire le tuple résultat : une structure d'arbre est construite récursivement -- Build the resulting tuple : the tree structure is created recursively
Tuple{ Tuple{
cell = _cell, cell = _cell,
zeroSubtree = zeroSubtree =
...@@ -189,9 +188,9 @@ helper def: ...@@ -189,9 +188,9 @@ helper def:
}; };
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
-- Obtenir l'arbre représentatif d'une table de vérité complète. -- Obtain the tree which represents an entire trust table.
-- --
-- Ce helper construit une structure d'arbre en utilisant thisModule.getTree(). -- This helper builds a tree structure using thisModule.getTree().
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
helper context TT!TruthTable def: helper context TT!TruthTable def:
getTree() getTree()
...@@ -241,10 +240,10 @@ helper def: ...@@ -241,10 +240,10 @@ helper def:
endif endif; endif endif;
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
-- Obtenir, pour une cellule donnée d'une table de vérité, le noeud correspondant dans l'arbre -- Obtain, for a given truth table cell, the matching node within the corresponding
-- représentatif de cette table. -- binary decision tree.
-- --
-- Ce helper utilise getTree et findCell. -- This helper uses getTree and findCell.
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
helper context TT!Cell def: helper context TT!Cell def:
getNode() getNode()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment