Skip to content

Commit

Permalink
Adding FixpointInfo #287
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaneg committed Sep 11, 2023
1 parent 2f14160 commit b44d850
Show file tree
Hide file tree
Showing 20 changed files with 570 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public AnalysisState<A> prepareEntryStateOfEntryPoint(AnalysisState<A> entryStat
}

// the stack has to be empty
return new AnalysisState<>(prepared.getState(), new ExpressionSet(), new SymbolAliasing());
return new AnalysisState<>(prepared.getState(), new ExpressionSet());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import it.unive.lisa.analysis.AbstractState;
import it.unive.lisa.analysis.AnalysisState;
import it.unive.lisa.analysis.AnalyzedCFG;
import it.unive.lisa.analysis.FixpointInfo;
import it.unive.lisa.analysis.OptimizedAnalyzedCFG;
import it.unive.lisa.analysis.ScopeToken;
import it.unive.lisa.analysis.SemanticException;
Expand Down Expand Up @@ -419,7 +420,7 @@ public AnalysisState<A> getAbstractResultOf(
return new AnalysisState<>(
entryState.getState().bottom(),
call.getMetaVariable(),
entryState.getAliasing().bottom());
FixpointInfo.BOTTOM);
}

ContextSensitivityToken callerToken = token;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import it.unive.lisa.analysis.AbstractState;
import it.unive.lisa.analysis.AnalysisState;
import it.unive.lisa.analysis.FixpointInfo;
import it.unive.lisa.analysis.SemanticException;
import it.unive.lisa.analysis.StatementStore;
import it.unive.lisa.analysis.lattices.ExpressionSet;
Expand Down Expand Up @@ -93,7 +94,7 @@ public AnalysisState<A> getAbstractResultOf(
return new AnalysisState<>(
entryState.getState().bottom(),
call.getMetaVariable(),
entryState.getAliasing().bottom());
FixpointInfo.BOTTOM);
}

return super.getAbstractResultOf(call, entryState, parameters, expressions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import it.unive.lisa.analysis.nonrelational.value.TypeEnvironment;
import it.unive.lisa.analysis.nonrelational.value.ValueEnvironment;
import it.unive.lisa.analysis.numeric.Sign;
import it.unive.lisa.analysis.symbols.SymbolAliasing;
import it.unive.lisa.analysis.types.InferredTypes;
import it.unive.lisa.conf.FixpointConfiguration;
import it.unive.lisa.conf.LiSAConfiguration;
Expand Down Expand Up @@ -71,7 +70,7 @@ SimpleAbstractState<MonolithicHeap, ValueEnvironment<Sign>, TypeEnvironment<Infe
new MonolithicHeap(),
new ValueEnvironment<>(new Sign()),
new TypeEnvironment<>(new InferredTypes())),
new ExpressionSet(), new SymbolAliasing());
new ExpressionSet());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void setup() throws CallGraphConstructionException, InterproceduralAnalys
as = new AnalysisState<>(
new SimpleAbstractState<>(new MonolithicHeap(), new ValueEnvironment<>(new Sign()),
new TypeEnvironment<>(new InferredTypes())),
new ExpressionSet(), new SymbolAliasing());
new ExpressionSet());
store = new StatementStore<>(as);
fake = new Expression(cfg, unknownLocation) {

Expand Down Expand Up @@ -468,8 +468,10 @@ public void testAssignOnBottom() {
boolean isBottom = ((Lattice) instance).isBottom();
if (instance instanceof AnalysisState) {
AnalysisState state = (AnalysisState) instance;
isBottom = state.getState().isBottom() && state.getAliasing().isBottom()
// analysis state keeps the assigned id on the stack
isBottom = state.getState().isBottom()
&& state.getFixpointInformation() != null
&& state.getFixpointInformation().isBottom()
// analysis state keeps the assigned id on the stack
&& state.getComputedExpressions().size() == 1
&& state.getComputedExpressions().iterator().next().equals(v);
}
Expand Down
3 changes: 1 addition & 2 deletions lisa/lisa-sdk/src/main/java/it/unive/lisa/LiSARunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import it.unive.lisa.analysis.AnalysisState;
import it.unive.lisa.analysis.AnalyzedCFG;
import it.unive.lisa.analysis.OptimizedAnalyzedCFG;
import it.unive.lisa.analysis.symbols.SymbolAliasing;
import it.unive.lisa.checks.ChecksExecutor;
import it.unive.lisa.checks.semantic.CheckToolWithAnalysisResults;
import it.unive.lisa.checks.semantic.SemanticCheck;
Expand Down Expand Up @@ -166,7 +165,7 @@ private void analyze(Collection<CFG> allCFGs, FileManager fileManager, AtomicBoo
() -> {
try {
interproc.fixpoint(
new AnalysisState<>(state, new Skip(SyntheticLocation.INSTANCE), new SymbolAliasing()),
new AnalysisState<>(state, new Skip(SyntheticLocation.INSTANCE)),
(Class<? extends WorkingSet<Statement>>) conf.fixpointWorkingSet,
fixconf);
} catch (FixpointException e) {
Expand Down
Loading

0 comments on commit b44d850

Please sign in to comment.