-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First tests completed about clock predicate abstraction
- Loading branch information
1 parent
d308fc2
commit 3dc717f
Showing
54 changed files
with
1,896 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...mon/analysis/src/main/java/hu/bme/mit/theta/analysis/expr/refinement/Prod2Refutation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package hu.bme.mit.theta.analysis.expr.refinement; | ||
|
||
public class Prod2Refutation <R1 extends Refutation, R2 extends Refutation>implements Refutation{ | ||
|
||
final private R1 refutation1; | ||
final private R2 refutation2; | ||
|
||
public Prod2Refutation(R1 refutation1, R2 refutation2) { | ||
this.refutation1 = refutation1; | ||
this.refutation2 = refutation2; | ||
} | ||
|
||
public R1 getRefutation1() { | ||
return refutation1; | ||
} | ||
|
||
public R2 getRefutation2() { | ||
return refutation2; | ||
} | ||
|
||
@Override | ||
public int getPruneIndex() { | ||
if(refutation1.getPruneIndex() < 0) return refutation2.getPruneIndex(); | ||
if(refutation2.getPruneIndex() < 0) return refutation1.getPruneIndex(); | ||
return refutation1.getPruneIndex() > refutation2.getPruneIndex() ? refutation2.getPruneIndex() : refutation1.getPruneIndex(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,8 @@ | |
package hu.bme.mit.theta.analysis.expr.refinement; | ||
|
||
public interface Refutation { | ||
|
||
int getPruneIndex(); | ||
|
||
|
||
} |
61 changes: 61 additions & 0 deletions
61
...mmon/analysis/src/main/java/hu/bme/mit/theta/analysis/expr/refinement/ZoneRefutation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package hu.bme.mit.theta.analysis.expr.refinement; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import hu.bme.mit.theta.analysis.zone.DBM; | ||
import hu.bme.mit.theta.analysis.zone.ZoneState; | ||
import hu.bme.mit.theta.core.decl.VarDecl; | ||
import hu.bme.mit.theta.core.type.rattype.RatType; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class ZoneRefutation implements Refutation{ | ||
|
||
private final int pruneIndex; | ||
private final List<ZoneState> zoneSequence; | ||
private final List<VarDecl<RatType>> clocks; | ||
|
||
|
||
private ZoneRefutation(){ | ||
pruneIndex = -1; | ||
zoneSequence = Collections.emptyList(); | ||
clocks = Collections.emptyList(); | ||
} | ||
private ZoneRefutation(int prunIndex, List<ZoneState> zoneSequence, List<VarDecl<RatType>> clocks) { | ||
this.pruneIndex = prunIndex; | ||
this.zoneSequence= ImmutableList.copyOf(zoneSequence); | ||
this.clocks = clocks; | ||
} | ||
|
||
public static ZoneRefutation binary(final int pruneIndex, final ZoneState itpZone, List<VarDecl<RatType>> clocks, final int statecount) | ||
{ | ||
final List<ZoneState> zoneSequence = new ArrayList<>(); | ||
for (int i = 0; i < statecount; i ++){ | ||
if(i < pruneIndex) { | ||
zoneSequence.add(ZoneState.top()); | ||
} | ||
else if( i == pruneIndex){ | ||
zoneSequence.add(itpZone); | ||
} | ||
else zoneSequence.add(ZoneState.bottom()); | ||
} | ||
return new ZoneRefutation(pruneIndex, zoneSequence, clocks); | ||
} | ||
@Override | ||
public int getPruneIndex() { | ||
return this.pruneIndex; | ||
} | ||
|
||
public ZoneState get(int index){ | ||
return zoneSequence.get(index); | ||
} | ||
|
||
public List<VarDecl<RatType>> getClocks() { | ||
return clocks; | ||
} | ||
|
||
public static ZoneRefutation emptyRefutation(){ | ||
return new ZoneRefutation(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.