Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
BDD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ttc
BDD
Commits
21bbb40a
Commit
21bbb40a
authored
6 years ago
by
Antonio García-Domínguez
Browse files
Options
Downloads
Patches
Plain Diff
Translate ATL code to English
parent
1c8ba298
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
solutions/EMFSolutionATL/src/ttc2019/TT2BDD.atl
+28
-29
28 additions, 29 deletions
solutions/EMFSolutionATL/src/ttc2019/TT2BDD.atl
with
28 additions
and
29 deletions
solutions/EMFSolutionATL/src/ttc2019/TT2BDD.atl
+
28
−
29
View file @
21bbb40a
...
@@ -69,29 +69,29 @@ rule Cell2Subtree {
...
@@ -69,29 +69,29 @@ rule Cell2Subtree {
}
}
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Partition
ner u
ne part
ie de la table de vérité
.
-- Partition
o
ne part
of the truth table
.
--
--
--
Ce
helper
effectue un travail
pr
é
parato
ire à la
cr
é
ation
d'un arbre binair
e.
--
This
helper
performs some
pr
e
parato
ry work before the
cr
e
ation
of a binary tre
e.
--
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 lesqu
ell
e
s
le port vaut faux
--
two subsequences of rows: cells for which the port is false, and c
ells
for which the
--
et celles pour lesquelles le port vaut vrai
.
--
port is true
.
--
--
--
Entrées
:
--
Inputs
:
-- rows :
l'ensemble des
li
g
nes
à traiter
-- rows :
the collection of
lines
to be processed.
-- port :
l
e port
qui doit servir de référence au
partition
nement
-- port :
th
e port
which should act as a reference for the
partition
ing.
--
--
--
Sorties
:
--
Outputs
:
--
un
tuple
contenant
:
--
a
tuple
that contains
:
-- zeroPart :
l'ensemble des lignes pour lesquelles ce port vaut zéro
(fa
ux
)
-- zeroPart :
the collection of rows for which the port is 0
(fa
lse
)
-- 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 :
-- Pr
e
conditions :
--
--
--
L
e port
à utiliser doit être un port d'entrée
:
--
Th
e port
to be used must be an input port
:
--
--
-- port.oclIsKindOf(TT!InputPort))
-- port.oclIsKindOf(TT!InputPort))
--
--
--
Sa
val
eur est
d
é
fin
ie dans toutes les lignes
--
The
val
ue is
d
e
fin
ed 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
é
lect
ionner les lignes pour lesquelles ce port vaut faux
-- S
e
lect
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
é
lect
ionner les lignes pour lesquelles ce port vaut vrai
-- S
e
lect
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 tupl
e r
é
sult
at
--
Build th
e r
e
sult
ing 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
é
lect
ionner une cellule qui
d
é
fin
it une valeur pour c
e port
-- S
e
lect
a cell which
d
e
fin
es a value for th
e 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
-- Partition
ner 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
é
fin
ir le nouvel ensem
ble
de
ports
utilisables pour les partitionnements ultérieur
s
-- D
e
fin
e the new collection of usa
ble ports
for the resulting partitioning
s
let _updatedPorts : Sequence(TT!Port) =
let _updatedPorts : Sequence(TT!Port) =
usablePorts->excluding(_port) in
usablePorts->excluding(_port) in
--
Construire le tupl
e r
é
sult
at : une structure d'arbre est construi
te r
é
cursive
ment
--
Build th
e r
e
sult
ing tuple : the tree structure is crea
te
d
r
e
cursive
ly
Tuple{
Tuple{
cell = _cell,
cell = _cell,
zeroSubtree =
zeroSubtree =
...
@@ -189,9 +188,9 @@ helper def:
...
@@ -189,9 +188,9 @@ helper def:
};
};
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Obt
enir l'arbre
repr
é
sent
atif d'une table de vérité complèt
e.
-- Obt
ain the tree which
repr
e
sent
s an entire trust tabl
e.
--
--
--
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;
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- Obt
enir, pour une cellule donnée d'une table de vérité, le noeud correspondant dans l'arbre
-- Obt
ain, for a given truth table cell, the matching node within the corresponding
--
représentatif de cette tabl
e.
--
binary decision tre
e.
--
--
--
Ce
helper u
tili
se getTree
et
findCell.
--
This
helper use
s
getTree
and
findCell.
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
helper context TT!Cell def:
helper context TT!Cell def:
getNode()
getNode()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment