Skip to main content
Sign in
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
Branches
No related tags found
No related merge requests found
......@@ -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.
-- En prenant une sous-ensemble des lignes d'une table de vérité et un port de référence, il
-- retourne deux sous-ensembles de lignes : celles pour lesquelles le port vaut faux
-- et celles pour lesquelles le port vaut vrai.
-- This helper performs some preparatory work before the creation of a binary tree.
-- It takes a subsequence of the rows of a truth table and a certain port, and returns
-- two subsequences of rows: cells for which the port is false, and cells for which the
-- port is true.
--
-- Entrées :
-- rows : l'ensemble des lignes à traiter
-- port : le port qui doit servir de référence au partitionnement
-- Inputs:
-- rows : the collection of lines to be processed.
-- port : the port which should act as a reference for the partitioning.
--
-- Sorties :
-- un tuple contenant :
-- zeroPart : l'ensemble des lignes pour lesquelles ce port vaut zéro (faux)
-- onePart : l'ensemble des lignes pour lesquelles ce port vaut un (vrai)
-- Outputs:
-- a tuple that contains:
-- zeroPart : the collection of rows for which the port is 0 (false)
-- 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))
--
-- Sa valeur est définie dans toutes les lignes
-- The value is defined for all rows:
--
-- rows->forAll(r |
-- r.cells->collect(c | c.port)
......@@ -102,7 +102,7 @@ helper def:
getPartition(rows : Sequence(TT!Row), port : TT!Port)
: 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) =
rows->select(r |
r.cells->exists(c |
......@@ -110,7 +110,7 @@ helper def:
)
) 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) =
rows->select(r |
r.cells->exists(c |
......@@ -118,7 +118,7 @@ helper def:
)
) in
-- Construire le tuple résultat
-- Build the resulting tuple
Tuple{
zeroPart = _zeroPart,
onePart = _onePart
......@@ -149,8 +149,7 @@ helper def:
getTree(rows : Sequence(TT!Row), usablePorts : Sequence(TT!Port))
: TupleType( cell : TT!Cell , zeroSubtree : OclAny , oneSubtree : OclAny ) =
-- Parmi tous les ports utilisables, en choisir un dont la valeur est définie
-- dans toutes les lignes
-- Among the usable ports, select one where the value is defined in all rows
let _port : TT!Port =
usablePorts->any(p |
rows->forAll(r |
......@@ -159,19 +158,19 @@ helper def:
)
) 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 =
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) ) =
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) =
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{
cell = _cell,
zeroSubtree =
......@@ -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:
getTree()
......@@ -241,10 +240,10 @@ helper def:
endif endif;
---------------------------------------------------------------------------------------------------
-- Obtenir, pour une cellule donnée d'une table de vérité, le noeud correspondant dans l'arbre
-- représentatif de cette table.
-- Obtain, for a given truth table cell, the matching node within the corresponding
-- binary decision tree.
--
-- Ce helper utilise getTree et findCell.
-- This helper uses getTree and findCell.
---------------------------------------------------------------------------------------------------
helper context TT!Cell def:
getNode()
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment