Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Verification for Decision Model and Notation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Blatt
Verification for Decision Model and Notation
Commits
31ea6432
Commit
31ea6432
authored
5 years ago
by
Jonas Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Update Partial Reduction Verifier for more precise finding of combinations
parent
417b28a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dmnverifierapi/src/main/java/de/unikoblenz/fgbks/core/dmn/verification/verifier/impl/PartialReductionVerifier.java
+35
-63
35 additions, 63 deletions
.../verification/verifier/impl/PartialReductionVerifier.java
with
35 additions
and
63 deletions
dmnverifierapi/src/main/java/de/unikoblenz/fgbks/core/dmn/verification/verifier/impl/PartialReductionVerifier.java
+
35
−
63
View file @
31ea6432
...
...
@@ -27,6 +27,7 @@ import de.unikoblenz.fgbks.core.dmn.verification.verifier.AbstractVerifier;
import
de.unikoblenz.fgbks.core.dmn.verification.verifier.DmnVerifier
;
import
de.unikoblenz.fgbks.core.dmn.verification.verifier.classification.LogicModelingLevelVerification
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
@DmnVerifier
(
...
...
@@ -68,75 +69,46 @@ public class PartialReductionVerifier extends AbstractVerifier {
}
else
{
List
<
VDmnInputValue
>
rules
=
VDmnFunctions
.
getColumnValuesInRules
(
inColumns
.
get
(
i
),
clusterRules
);
List
<
List
<
VDmnRule
>>
nClusters
=
new
ArrayList
<>();
List
<
Boolean
>
combinationCluster
=
new
ArrayList
<>();
for
(
int
i1
=
0
;
i1
<
rules
.
size
();
i1
++)
{
VDmnInputValue
currentRuleValue
=
rules
.
get
(
i1
);
for
(
int
i2
=
i1
+
1
;
i2
<
rules
.
size
();
i2
++)
{
VDmnInputValue
currentRuleValueInner
=
rules
.
get
(
i2
);
if
(
currentRuleValue
!=
currentRuleValueInner
)
{
boolean
found
=
false
;
// 1. Is subsumption?
if
(
currentRuleValue
.
getBoundary
()
.
checkWith
(
SUBSUMES
,
currentRuleValueInner
.
getBoundary
()))
{
if
(
subsumptionRule
==
null
||
subsumptionRule
==
currentRuleValue
.
getVDmnRule
())
{
subsumptionRule
=
currentRuleValue
.
getVDmnRule
();
found
=
true
;
List
<
VDmnRule
>
cluster
=
new
ArrayList
<>();
cluster
.
add
(
currentRuleValue
.
getVDmnRule
());
cluster
.
add
(
currentRuleValueInner
.
getVDmnRule
());
nClusters
.
add
(
cluster
);
combinationCluster
.
add
(
true
);
}
}
if
(
currentRuleValueInner
.
getBoundary
()
.
checkWith
(
SUBSUMES
,
currentRuleValue
.
getBoundary
()))
{
if
(
subsumptionRule
==
null
||
subsumptionRule
==
currentRuleValueInner
.
getVDmnRule
())
{
subsumptionRule
=
currentRuleValueInner
.
getVDmnRule
();
found
=
true
;
List
<
VDmnRule
>
cluster
=
new
ArrayList
<>();
cluster
.
add
(
currentRuleValue
.
getVDmnRule
());
cluster
.
add
(
currentRuleValueInner
.
getVDmnRule
());
nClusters
.
add
(
cluster
);
combinationCluster
.
add
(
true
);
}
}
// Find identical
if
(!
found
&&
currentRuleValue
.
getBoundary
()
.
checkWith
(
IS_EQUAL
,
currentRuleValueInner
.
getBoundary
()))
{
List
<
VDmnRule
>
cluster
=
new
ArrayList
<>();
cluster
.
add
(
currentRuleValue
.
getVDmnRule
());
cluster
.
add
(
currentRuleValueInner
.
getVDmnRule
());
combinationCluster
.
add
(
false
);
nClusters
.
add
(
cluster
);
}
else
// 2. Find other combinations (only of no real combination
if
(!
found
&&
!
hasCombination
&&
currentRuleValue
.
getBoundary
()
.
createBi
(
COMBINE
,
currentRuleValueInner
.
getBoundary
())
.
isPresent
())
{
List
<
VDmnRule
>
cluster
=
new
ArrayList
<>();
cluster
.
add
(
currentRuleValue
.
getVDmnRule
());
cluster
.
add
(
currentRuleValueInner
.
getVDmnRule
());
combinationCluster
.
add
(
true
);
nClusters
.
add
(
cluster
);
}
}
VDmnInputValue
currentRuleValue
=
rules
.
get
(
0
);
VDmnInputValue
currentRuleValueNext
=
rules
.
get
(
1
);
boolean
found
=
false
;
boolean
comb
=
true
;
// 1. Is subsumption?
if
(
currentRuleValue
.
getBoundary
().
checkWith
(
SUBSUMES
,
currentRuleValueNext
.
getBoundary
()))
{
if
(
subsumptionRule
==
null
||
subsumptionRule
==
currentRuleValue
.
getVDmnRule
())
{
subsumptionRule
=
currentRuleValue
.
getVDmnRule
();
found
=
true
;
}
}
if
(
currentRuleValueNext
.
getBoundary
().
checkWith
(
SUBSUMES
,
currentRuleValue
.
getBoundary
()))
{
if
(
subsumptionRule
==
null
||
subsumptionRule
==
currentRuleValueNext
.
getVDmnRule
())
{
subsumptionRule
=
currentRuleValueNext
.
getVDmnRule
();
found
=
true
;
}
}
// Find identical
if
(!
found
&&
currentRuleValue
.
getBoundary
()
.
checkWith
(
IS_EQUAL
,
currentRuleValueNext
.
getBoundary
()))
{
found
=
true
;
comb
=
false
;
}
else
// 2. Find other combinations (only of no real combination
if
(!
found
&&
!
hasCombination
&&
currentRuleValue
.
getBoundary
()
.
createBi
(
COMBINE
,
currentRuleValueNext
.
getBoundary
())
.
isPresent
())
{
found
=
true
;
}
// nex col
for
(
int
x
=
0
;
x
<
combinationCluster
.
size
();
x
++
)
{
if
(
found
)
{
findPartialReduction
(
inColumns
,
i
+
1
,
nClusters
.
get
(
x
),
comb
inationCluster
.
get
(
x
)
||
hasCombination
,
Arrays
.
asList
(
currentRuleValue
.
getVDmnRule
(),
currentRuleValueNext
.
getVDmnRule
()
),
comb
||
hasCombination
,
subsumptionRule
);
}
}
...
...
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