Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ProB Rodin Plugin
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
general
stups
ProB Rodin Plugin
Commits
deb94994
Commit
deb94994
authored
10 years ago
by
Ivaylo Dobrikov
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a bug in the LTL viewer of Rodin (see comments in the commit).
parent
25a82e39
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
de.prob.core/src/de/prob/core/domainobjects/ltl/CounterExample.java
+17
-6
17 additions, 6 deletions
...re/src/de/prob/core/domainobjects/ltl/CounterExample.java
with
17 additions
and
6 deletions
de.prob.core/src/de/prob/core/domainobjects/ltl/CounterExample.java
+
17
−
6
View file @
deb94994
...
@@ -51,10 +51,11 @@ public class CounterExample {
...
@@ -51,10 +51,11 @@ public class CounterExample {
.
asList
(
modelCheckingResult
.
getInitPathOps
()));
.
asList
(
modelCheckingResult
.
getInitPathOps
()));
ceSize
=
modelCheckingResult
.
getCounterexample
().
size
();
ceSize
=
modelCheckingResult
.
getCounterexample
().
size
();
final
String
[]
atomicFormulaNames
=
createAtomicNames
(
modelCheckingResult
);
final
List
<
ArrayList
<
Boolean
>>
predicateValues
=
createStates
(
modelCheckingResult
final
List
<
ArrayList
<
Boolean
>>
predicateValues
=
createStates
(
modelCheckingResult
.
getCounterexample
());
.
getCounterexample
()
,
atomicFormulaNames
);
final
String
[]
atomicFormulaNames
=
createAtomicNames
(
modelCheckingResult
);
propositionRoot
=
createExample
(
modelCheckingResult
.
getStructure
(),
propositionRoot
=
createExample
(
modelCheckingResult
.
getStructure
(),
atomicFormulaNames
,
predicateValues
);
atomicFormulaNames
,
predicateValues
);
propositionRoot
.
setVisible
(
true
);
propositionRoot
.
setVisible
(
true
);
...
@@ -73,10 +74,17 @@ public class CounterExample {
...
@@ -73,10 +74,17 @@ public class CounterExample {
return
res
;
return
res
;
}
}
private
List
<
ArrayList
<
Boolean
>>
createStates
(
final
ListPrologTerm
example
)
{
private
List
<
ArrayList
<
Boolean
>>
createStates
(
final
ListPrologTerm
example
,
String
[]
atomicFormulaNames
)
{
List
<
ArrayList
<
Boolean
>>
predicateValues
=
new
ArrayList
<
ArrayList
<
Boolean
>>();
List
<
ArrayList
<
Boolean
>>
predicateValues
=
new
ArrayList
<
ArrayList
<
Boolean
>>();
for
(
int
i
=
0
;
i
<
example
.
size
();
i
++)
{
// A bug fix from 31.10.2014: changed the termination condition from
// 'i < example.size()' to 'i < atomicFormulaNames.length'. The statement
// predicateValues.get(i).add(value == 0 ? false : true) in the inner for-loop (lines 98-105)
// crashed once the reported counter-example 'example' had less atoms as atomic propositions,
// e.g. for 'G ({x/=1} & {y<=10})' with 'example = [atom(0,[0,1],none)]' an IndexOutOfBounds-Exception
// had been thrown. Note that the bug-fix has been not thoroughly tested and there may be other issues
// that may occur.
for
(
int
i
=
0
;
i
<
atomicFormulaNames
.
length
;
i
++)
{
predicateValues
.
add
(
new
ArrayList
<
Boolean
>());
predicateValues
.
add
(
new
ArrayList
<
Boolean
>());
}
}
...
@@ -92,6 +100,9 @@ public class CounterExample {
...
@@ -92,6 +100,9 @@ public class CounterExample {
for
(
int
i
=
0
;
i
<
values
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
values
.
size
();
i
++)
{
int
value
=
((
IntegerPrologTerm
)
values
.
get
(
i
)).
getValue
()
int
value
=
((
IntegerPrologTerm
)
values
.
get
(
i
)).
getValue
()
.
intValue
();
.
intValue
();
// Doesn't have to be a 'predicateValues.get(index)' and not
// 'predicateValues.get(i)' (predicateValues is a list of boolean lists)
//predicateValues.get(index).add(value == 0 ? false : true);
predicateValues
.
get
(
i
).
add
(
value
==
0
?
false
:
true
);
predicateValues
.
get
(
i
).
add
(
value
==
0
?
false
:
true
);
}
}
...
...
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