-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from lisa-analyzer/base-interfaces
Base interfaces
- Loading branch information
Showing
49 changed files
with
452 additions
and
299 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
* @author <a href="mailto:[email protected]">Luca Negrini</a> | ||
*/ | ||
@FallbackImplementation | ||
public class MonolithicHeap extends BaseHeapDomain<MonolithicHeap> { | ||
public class MonolithicHeap implements BaseHeapDomain<MonolithicHeap> { | ||
|
||
private static final MonolithicHeap TOP = new MonolithicHeap(); | ||
|
||
|
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 |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Vincenzo Arceri</a> | ||
*/ | ||
public class TypeBasedHeap extends BaseHeapDomain<TypeBasedHeap> { | ||
public class TypeBasedHeap implements BaseHeapDomain<TypeBasedHeap> { | ||
|
||
private static final TypeBasedHeap TOP = new TypeBasedHeap(); | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Vincenzo Arceri</a> | ||
*/ | ||
public class IntegerConstantPropagation extends BaseNonRelationalValueDomain<IntegerConstantPropagation> { | ||
public class IntegerConstantPropagation implements BaseNonRelationalValueDomain<IntegerConstantPropagation> { | ||
|
||
private static final IntegerConstantPropagation TOP = new IntegerConstantPropagation(true, false); | ||
private static final IntegerConstantPropagation BOTTOM = new IntegerConstantPropagation(false, true); | ||
|
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
* @author <a href="mailto:[email protected]">Vincenzo Arceri</a> | ||
*/ | ||
@FallbackImplementation | ||
public class Interval extends BaseNonRelationalValueDomain<Interval> { | ||
public class Interval implements BaseNonRelationalValueDomain<Interval> { | ||
|
||
/** | ||
* The abstract zero ({@code [0, 0]}) element. | ||
|
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Vincenzo Arceri</a> | ||
*/ | ||
public class Parity extends BaseNonRelationalValueDomain<Parity> { | ||
public class Parity implements BaseNonRelationalValueDomain<Parity> { | ||
|
||
/** | ||
* The abstract even element. | ||
|
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Vincenzo Arceri</a> | ||
*/ | ||
public class Sign extends BaseNonRelationalValueDomain<Sign> { | ||
public class Sign implements BaseNonRelationalValueDomain<Sign> { | ||
|
||
/** | ||
* The abstract positive element. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ | |
import it.unive.lisa.symbolic.value.operator.binary.BinaryOperator; | ||
import it.unive.lisa.symbolic.value.operator.binary.StringConcat; | ||
import it.unive.lisa.symbolic.value.operator.binary.StringContains; | ||
import it.unive.lisa.symbolic.value.operator.ternary.TernaryOperator; | ||
import it.unive.lisa.symbolic.value.operator.unary.UnaryOperator; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
import java.util.SortedSet; | ||
|
@@ -23,7 +21,7 @@ | |
* @author <a href="mailto:[email protected]">Simone Leoni</a> | ||
* @author <a href="mailto:[email protected]">Vincenzo Arceri</a> | ||
*/ | ||
public class FSA extends BaseNonRelationalValueDomain<FSA> { | ||
public class FSA implements BaseNonRelationalValueDomain<FSA> { | ||
/** | ||
* Used to store the string representation | ||
*/ | ||
|
@@ -119,12 +117,7 @@ public FSA evalNonNullConstant(Constant constant, ProgramPoint pp) throws Semant | |
return top(); | ||
} | ||
|
||
@Override | ||
public FSA evalUnaryExpression(UnaryOperator operator, FSA arg, ProgramPoint pp) throws SemanticException { | ||
// TODO | ||
return super.evalUnaryExpression(operator, arg, pp); | ||
} | ||
|
||
// TODO unary and ternary and all other binary | ||
@Override | ||
public FSA evalBinaryExpression(BinaryOperator operator, FSA left, FSA right, ProgramPoint pp) | ||
throws SemanticException { | ||
|
@@ -133,13 +126,6 @@ public FSA evalBinaryExpression(BinaryOperator operator, FSA left, FSA right, Pr | |
return top(); | ||
} | ||
|
||
@Override | ||
public FSA evalTernaryExpression(TernaryOperator operator, FSA left, FSA middle, FSA right, ProgramPoint pp) | ||
throws SemanticException { | ||
// TODO | ||
return super.evalTernaryExpression(operator, left, middle, right, pp); | ||
} | ||
|
||
@Override | ||
public SemanticDomain.Satisfiability satisfiesBinaryExpression(BinaryOperator operator, FSA left, FSA right, | ||
ProgramPoint pp) throws SemanticException { | ||
|
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 |
---|---|---|
|
@@ -44,7 +44,7 @@ | |
* @author <a href="mailto:[email protected]">Luca Negrini</a> | ||
*/ | ||
@FallbackImplementation | ||
public class InferredTypes extends BaseNonRelationalTypeDomain<InferredTypes> { | ||
public class InferredTypes implements BaseNonRelationalTypeDomain<InferredTypes> { | ||
|
||
private static final InferredTypes BOTTOM = new InferredTypes(null, Collections.emptySet()); | ||
|
||
|
@@ -114,7 +114,7 @@ public InferredTypes top() { | |
|
||
@Override | ||
public boolean isTop() { | ||
return super.isTop() || isTop; | ||
return BaseNonRelationalTypeDomain.super.isTop() || isTop; | ||
} | ||
|
||
@Override | ||
|
@@ -124,7 +124,7 @@ public InferredTypes bottom() { | |
|
||
@Override | ||
public boolean isBottom() { | ||
return super.isBottom() || BOTTOM.elements.equals(elements); | ||
return BaseNonRelationalTypeDomain.super.isBottom() || BOTTOM.elements.equals(elements); | ||
} | ||
|
||
@Override | ||
|
@@ -141,7 +141,7 @@ public DomainRepresentation representation() { | |
@Override | ||
public InferredTypes evalIdentifier(Identifier id, TypeEnvironment<InferredTypes> environment, | ||
ProgramPoint pp) throws SemanticException { | ||
InferredTypes eval = super.evalIdentifier(id, environment, pp); | ||
InferredTypes eval = BaseNonRelationalTypeDomain.super.evalIdentifier(id, environment, pp); | ||
if (!eval.isTop() && !eval.isBottom()) | ||
return eval; | ||
TypeSystem types = pp.getProgram().getTypes(); | ||
|
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Luca Negrini</a> | ||
*/ | ||
public class StaticTypes extends BaseNonRelationalTypeDomain<StaticTypes> { | ||
public class StaticTypes implements BaseNonRelationalTypeDomain<StaticTypes> { | ||
|
||
private static final StaticTypes BOTTOM = new StaticTypes(null, null); | ||
|
||
|
@@ -103,7 +103,7 @@ public DomainRepresentation representation() { | |
@Override | ||
public StaticTypes evalIdentifier(Identifier id, TypeEnvironment<StaticTypes> environment, | ||
ProgramPoint pp) throws SemanticException { | ||
StaticTypes eval = super.evalIdentifier(id, environment, pp); | ||
StaticTypes eval = BaseNonRelationalTypeDomain.super.evalIdentifier(id, environment, pp); | ||
if (!eval.isTop() && !eval.isBottom()) | ||
return eval; | ||
return new StaticTypes(pp.getProgram().getTypes(), id.getStaticType()); | ||
|
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
Oops, something went wrong.