Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlc4b
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
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
tlc4b
Commits
033c0b03
Commit
033c0b03
authored
10 years ago
by
hansen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed type restriction bug
parent
2a4bbd9d
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
src/main/java/de/tlc4b/analysis/typerestriction/TypeRestrictor.java
+18
-17
18 additions, 17 deletions
...ava/de/tlc4b/analysis/typerestriction/TypeRestrictor.java
with
18 additions
and
17 deletions
src/main/java/de/tlc4b/analysis/typerestriction/TypeRestrictor.java
+
18
−
17
View file @
033c0b03
...
...
@@ -196,6 +196,7 @@ public class TypeRestrictor extends DepthFirstAdapter {
private
void
analysePredicate
(
Node
n
,
HashSet
<
Node
>
list
,
HashSet
<
Node
>
ignoreList
)
{
if
(
removedNodes
.
contains
(
n
))
return
;
...
...
@@ -227,23 +228,23 @@ public class TypeRestrictor extends DepthFirstAdapter {
putRestrictedType
(
r_right
,
new
ASetExtensionExpression
(
element
));
removedNodes
.
add
(
n
);
}
if
(
left
instanceof
ACoupleExpression
)
{
ACoupleExpression
couple
=
(
ACoupleExpression
)
left
;
P
Expression
first
=
couple
.
getList
().
get
(
0
)
;
Node
r_first
=
machineContext
.
getReferenceNode
(
first
);
PExpression
second
=
couple
.
getList
().
get
(
0
);
Node
r_second
=
machineContext
.
getReferenceNode
(
second
);
if
(
list
.
contains
(
r_first
)
&&
list
.
contains
(
r_second
)
&&
isAC
on
s
ta
ntExpression
(
right
,
list
,
ignoreList
))
{
ArrayList
<
PExpression
>
element
=
new
ArrayList
<
PExpression
>();
element
.
add
(
right
);
putRestrictedTypeOfTuple
(
r_
right
,
new
ASetExtensionExpression
(
element
));
removedNodes
.
add
(
n
);
}
}
// detecting couples, e.g. (a,b) = (1,3)
//
if (left instanceof
ACoupleExpression)
{
//
ACouple
Expression
couple = (ACoupleExpression) left
;
//
PExpression first = couple.getList().get(0
);
//
Node r_first = machineContext.getReferenceNode(first
);
//
PExpression second = couple.getList().get(0
);
// Node r_second = machineContext.getReferenceNode(second);
//
//
if (list.c
onta
ins(r_first) && list.contains(r_second)
//
&& isAConstantExpression(right, list, ignoreList)) {
//
ArrayList<PExpression> element = new ArrayList<PExpression>(
);
//
element.add(
right
);
//
putRestrictedTypeOfTuple(r_right,
//
new ASetExtensionExpression(element)
);
//
removedNodes.add(n);
// }
//
}
return
;
}
...
...
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