-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using DefaultConfiguration for defaults #268
- Loading branch information
Showing
38 changed files
with
522 additions
and
985 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
lisa/lisa-analyses/src/main/java/it/unive/lisa/DefaultConfiguration.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,56 @@ | ||
package it.unive.lisa; | ||
|
||
import it.unive.lisa.analysis.AbstractState; | ||
import it.unive.lisa.analysis.SimpleAbstractState; | ||
import it.unive.lisa.analysis.heap.HeapDomain; | ||
import it.unive.lisa.analysis.heap.MonolithicHeap; | ||
import it.unive.lisa.analysis.nonrelational.value.TypeEnvironment; | ||
import it.unive.lisa.analysis.nonrelational.value.ValueEnvironment; | ||
import it.unive.lisa.analysis.numeric.Interval; | ||
import it.unive.lisa.analysis.types.InferredTypes; | ||
import it.unive.lisa.analysis.value.TypeDomain; | ||
import it.unive.lisa.analysis.value.ValueDomain; | ||
import it.unive.lisa.conf.LiSAConfiguration; | ||
import it.unive.lisa.interprocedural.ModularWorstCaseAnalysis; | ||
import it.unive.lisa.interprocedural.callgraph.RTACallGraph; | ||
|
||
public class DefaultConfiguration extends LiSAConfiguration { | ||
|
||
public static RTACallGraph defaultCallGraph() { | ||
return new RTACallGraph(); | ||
} | ||
|
||
public static <A extends AbstractState<A>> ModularWorstCaseAnalysis<A> defaultInterproceduralAnalysis() { | ||
return new ModularWorstCaseAnalysis<>(); | ||
} | ||
|
||
public static TypeEnvironment<InferredTypes> defaultTypeDomain() { | ||
return new TypeEnvironment<>(new InferredTypes()); | ||
} | ||
|
||
public static ValueEnvironment<Interval> defaultValueDomain() { | ||
return new ValueEnvironment<>(new Interval()); | ||
} | ||
|
||
public static MonolithicHeap defaultHeapDomain() { | ||
return new MonolithicHeap(); | ||
} | ||
|
||
public static <H extends HeapDomain<H>, | ||
V extends ValueDomain<V>, | ||
T extends TypeDomain<T>> SimpleAbstractState<H, V, T> simpleState(H heap, V value, T type) { | ||
return new SimpleAbstractState<>(heap, value, type); | ||
} | ||
|
||
public static SimpleAbstractState< | ||
MonolithicHeap, | ||
ValueEnvironment<Interval>, | ||
TypeEnvironment<InferredTypes>> defaultAbstractState() { | ||
return simpleState(defaultHeapDomain(), defaultValueDomain(), defaultTypeDomain()); | ||
} | ||
|
||
public DefaultConfiguration() { | ||
this.callGraph = defaultCallGraph(); | ||
this.interproceduralAnalysis = defaultInterproceduralAnalysis(); | ||
} | ||
} |
Oops, something went wrong.