Skip to content

Commit

Permalink
[PSym] Support liveness checking in symbolic bounded/iterative strategy
Browse files Browse the repository at this point in the history
Support liveness checking with dynamic machine creation in symbolic bounded/iterative strategy

Renames symbolic-iterative to symbolic-bounded
  • Loading branch information
aman-goel committed Oct 14, 2023
1 parent be54c1f commit 366a32a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/psymit.yml → .github/workflows/psymb.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build and test PSym in symbolic iterative mode, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: PSymIt on Ubuntu
name: PSymB on Ubuntu

on:
push:
Expand Down Expand Up @@ -37,4 +37,4 @@ jobs:
run: ./scripts/build.sh
- name: Test PSym
working-directory: Src/PRuntimes/PSymRuntime
run: mvn test -Dpsym.args="--strategy symbolic-iterative"
run: mvn test -Dpsym.args="--strategy symbolic-bounded"
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ public void setToSymbolicFixpoint() {
this.setStateCachingMode(StateCachingMode.Symbolic);
}

public void setToSymbolicIterative() {
public void setToSymbolicBounded() {
setToSymbolic();
this.setStrategy("symbolic-iterative");
this.setStrategy("symbolic-bounded");
this.setSchChoiceBound(2);
this.setDataChoiceBound(2);
this.setUseBacktrack(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class PSymOptions {
Option strategy =
Option.builder("st")
.longOpt("strategy")
.desc("Exploration strategy: symbolic, random, dfs, learn, stateless (default: symbolic)")
.desc("Exploration strategy: symbolic, random, dfs, learn (default: symbolic)")
.numberOfArgs(1)
.hasArg()
.argName("Strategy (string)")
Expand Down Expand Up @@ -455,8 +455,8 @@ public static PSymConfiguration ParseCommandlineArgs(String[] args) {
case "symbolic-fixpoint":
config.setToSymbolicFixpoint();
break;
case "symbolic-iterative":
config.setToSymbolicIterative();
case "symbolic-bounded":
config.setToSymbolicBounded();
break;
case "random":
config.setToRandom();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,6 @@ public boolean isDone() {
return done.isTrue() || depth == PSymGlobal.getConfiguration().getMaxStepBound();
}

/**
* Find out whether current execution finished completely
*
* @return Whether or not current execution finished
*/
public Guard isFinishedExecution() {
if (depth == PSymGlobal.getConfiguration().getMaxStepBound()) {
return Guard.constTrue();
} else {
return allMachinesHalted;
}
}

/**
* Get current depth
*
Expand Down Expand Up @@ -310,7 +297,8 @@ public void initializeSearch() {
start = target;
}

protected void checkLiveness(Guard finished) {
protected void checkLiveness(Guard finished_orig) {
Guard finished = finished_orig.and(schedule.getFilter());
if (!finished.isFalse()) {
for (Monitor m : monitors) {
PrimitiveVS<State> monitorState = m.getCurrentState().restrict(finished);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ protected List<PrimitiveVS> getNextSchedulingChoices() {
// prioritize the create actions
for (Machine machine : machines) {
if (!machine.getEventBuffer().isEmpty()) {
Guard initCond = machine.getEventBuffer().hasCreateMachineUnderGuard().getGuardFor(true);
Guard initCond = machine.getEventBuffer().hasCreateMachineUnderGuard().getGuardFor(true).and(schedule.getFilter());
if (!initCond.isFalse()) {
PrimitiveVS<Machine> ret = new PrimitiveVS<>(machine).restrict(initCond);
return new ArrayList<>(Collections.singletonList(ret));
Expand All @@ -731,7 +731,7 @@ protected List<PrimitiveVS> getNextSchedulingChoices() {
// prioritize the sync actions i.e. events that are marked as synchronous
for (Machine machine : machines) {
if (!machine.getEventBuffer().isEmpty()) {
Guard syncCond = machine.getEventBuffer().hasSyncEventUnderGuard().getGuardFor(true);
Guard syncCond = machine.getEventBuffer().hasSyncEventUnderGuard().getGuardFor(true).and(schedule.getFilter());
if (!syncCond.isFalse()) {
PrimitiveVS<Machine> ret = new PrimitiveVS<>(machine).restrict(syncCond);
return new ArrayList<>(Collections.singletonList(ret));
Expand All @@ -746,7 +746,7 @@ protected List<PrimitiveVS> getNextSchedulingChoices() {
for (Machine machine : machines) {
if (!machine.getEventBuffer().isEmpty()) {
Guard canRun =
machine.getEventBuffer().satisfiesPredUnderGuard(x -> x.canRun()).getGuardFor(true);
machine.getEventBuffer().satisfiesPredUnderGuard(x -> x.canRun()).getGuardFor(true).and(schedule.getFilter());
if (!canRun.isFalse()) {
guardedMachines.add(new GuardedValue(machine, canRun));
}
Expand Down

0 comments on commit 366a32a

Please sign in to comment.