Skip to content

Commit

Permalink
Working on two types of top kinteger set
Browse files Browse the repository at this point in the history
  • Loading branch information
VincenzoArceri committed Feb 28, 2024
1 parent f4ecc25 commit 5e1a6a8
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 172 deletions.
8 changes: 4 additions & 4 deletions src/main/java/it/unipr/analysis/AbstractStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public AbstractStack top() {
LinkedList<KIntegerSet> result = new LinkedList<>();

for (int i = 0; i < STACK_LIMIT; i++)
result.addLast(KIntegerSet.TOP);
result.addLast(KIntegerSet.NUMERIC_TOP);

return new AbstractStack(result);
}
Expand Down Expand Up @@ -212,7 +212,7 @@ public AbstractStack clone() {
private static LinkedList<KIntegerSet> clone(LinkedList<KIntegerSet> list) {
LinkedList<KIntegerSet> result = new LinkedList<>();
for (KIntegerSet item : list)
result.add(item.copy());
result.add(item);

return result;
}
Expand All @@ -237,7 +237,7 @@ public KIntegerSet pop() {
if (!stack.getFirst().isTop())
stack.addFirst(KIntegerSet.BOTTOM);
else
stack.addFirst(KIntegerSet.TOP);
stack.addFirst(KIntegerSet.NUMERIC_TOP);
return result;

}
Expand Down Expand Up @@ -294,7 +294,7 @@ public KIntegerSet getSecondElement() {
if (isBottom())
return KIntegerSet.BOTTOM;
else if (isTop())
return KIntegerSet.TOP;
return KIntegerSet.NUMERIC_TOP;
return this.stack.get(STACK_LIMIT - 2);
}

Expand Down
Loading

0 comments on commit 5e1a6a8

Please sign in to comment.