Skip to content

Commit

Permalink
Formatted test
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Jul 21, 2023
1 parent 796c916 commit bf54d4d
Showing 1 changed file with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class XcfaAnalysisTest {
val lts = getXcfaLts()

val abstractor = getXcfaAbstractor(analysis,
PriorityWaitlist.create(ArgNodeComparators.combine(ArgNodeComparators.targetFirst(), ArgNodeComparators.bfs())),
PriorityWaitlist.create(
ArgNodeComparators.combine(ArgNodeComparators.targetFirst(), ArgNodeComparators.bfs())),
StopCriterions.firstCex<XcfaState<ExplState>, XcfaAction>(),
ConsoleLogger(Logger.Level.DETAIL),
lts,
Expand All @@ -84,7 +85,8 @@ class XcfaAnalysisTest {
SingleExprTraceRefiner.create(
ExprTraceBwBinItpChecker.create(BoolExprs.True(), BoolExprs.True(),
Z3SolverFactory.getInstance().createItpSolver()),
precRefiner, PruneStrategy.FULL, NullLogger.getInstance()) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>
precRefiner, PruneStrategy.FULL,
NullLogger.getInstance()) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>

val cegarChecker =
CegarChecker.create(abstractor, refiner)
Expand Down Expand Up @@ -112,7 +114,8 @@ class XcfaAnalysisTest {
val lts = XcfaSporLts(xcfa)

val abstractor = getXcfaAbstractor(analysis,
PriorityWaitlist.create(ArgNodeComparators.combine(ArgNodeComparators.targetFirst(), ArgNodeComparators.bfs())),
PriorityWaitlist.create(
ArgNodeComparators.combine(ArgNodeComparators.targetFirst(), ArgNodeComparators.bfs())),
StopCriterions.firstCex<XcfaState<ExplState>, XcfaAction>(),
ConsoleLogger(Logger.Level.DETAIL),
lts,
Expand All @@ -124,7 +127,8 @@ class XcfaAnalysisTest {
SingleExprTraceRefiner.create(
ExprTraceBwBinItpChecker.create(BoolExprs.True(), BoolExprs.True(),
Z3SolverFactory.getInstance().createItpSolver()),
precRefiner, PruneStrategy.FULL, NullLogger.getInstance()) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>
precRefiner, PruneStrategy.FULL,
NullLogger.getInstance()) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>

val cegarChecker =
CegarChecker.create(abstractor, refiner)
Expand All @@ -139,7 +143,7 @@ class XcfaAnalysisTest {
@ParameterizedTest
@MethodSource("data")
fun testDporExpl(filepath: String, verdict: (SafetyResult<*, *>) -> Boolean) {
if(filepath.contains("multithread")) return // TODO: why does it fail to verify?
if (filepath.contains("multithread")) return // TODO: why does it fail to verify?
val stream = javaClass.getResourceAsStream(filepath)
val xcfa = getXcfaFromC(stream!!, ParseContext(), false)

Expand All @@ -165,7 +169,8 @@ class XcfaAnalysisTest {
SingleExprTraceRefiner.create(
ExprTraceBwBinItpChecker.create(BoolExprs.True(), BoolExprs.True(),
Z3SolverFactory.getInstance().createItpSolver()),
precRefiner, PruneStrategy.FULL, ConsoleLogger(Logger.Level.DETAIL)) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>
precRefiner, PruneStrategy.FULL,
ConsoleLogger(Logger.Level.DETAIL)) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>

val cegarChecker =
CegarChecker.create(abstractor, refiner)
Expand Down Expand Up @@ -193,7 +198,8 @@ class XcfaAnalysisTest {
val lts = XcfaAasporLts(xcfa, mutableMapOf())

val abstractor = getXcfaAbstractor(analysis,
PriorityWaitlist.create(ArgNodeComparators.combine(ArgNodeComparators.targetFirst(), ArgNodeComparators.bfs())),
PriorityWaitlist.create(
ArgNodeComparators.combine(ArgNodeComparators.targetFirst(), ArgNodeComparators.bfs())),
StopCriterions.firstCex<XcfaState<ExplState>, XcfaAction>(),
ConsoleLogger(Logger.Level.DETAIL),
lts,
Expand All @@ -206,7 +212,8 @@ class XcfaAnalysisTest {
SingleExprTraceRefiner.create(
ExprTraceBwBinItpChecker.create(BoolExprs.True(), BoolExprs.True(),
Z3SolverFactory.getInstance().createItpSolver()),
precRefiner, PruneStrategy.FULL, NullLogger.getInstance(), atomicNodePruner) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>
precRefiner, PruneStrategy.FULL, NullLogger.getInstance(),
atomicNodePruner) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>

val cegarChecker =
CegarChecker.create(abstractor, AasporRefiner.create(refiner, PruneStrategy.FULL, mutableMapOf()))
Expand All @@ -218,11 +225,10 @@ class XcfaAnalysisTest {
Assertions.assertTrue(verdict(safetyResult))
}


@ParameterizedTest
@MethodSource("data")
fun testAadporExpl(filepath: String, verdict: (SafetyResult<*, *>) -> Boolean) {
if(filepath.contains("multithread")) return // TODO: why does it fail to verify?
if (filepath.contains("multithread")) return // TODO: why does it fail to verify?
val stream = javaClass.getResourceAsStream(filepath)
val xcfa = getXcfaFromC(stream!!, ParseContext(), false)

Expand All @@ -248,7 +254,8 @@ class XcfaAnalysisTest {
SingleExprTraceRefiner.create(
ExprTraceBwBinItpChecker.create(BoolExprs.True(), BoolExprs.True(),
Z3SolverFactory.getInstance().createItpSolver()),
precRefiner, PruneStrategy.FULL, NullLogger.getInstance()) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>
precRefiner, PruneStrategy.FULL,
NullLogger.getInstance()) as Refiner<XcfaState<ExplState>, XcfaAction, XcfaPrec<ExplPrec>>

val cegarChecker =
CegarChecker.create(abstractor, refiner)
Expand Down

0 comments on commit bf54d4d

Please sign in to comment.