Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw verification options issues - fix 2046945 #128

Merged
merged 51 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b1827d3
Fixed bug where raw verifications would be empty when creating new query
mtygesen Dec 28, 2023
7c90d9e
Fixed bug where query options would be disabled when using raw verifi…
mtygesen Dec 28, 2023
375b87d
Fixed eof
mtygesen Dec 28, 2023
93613d5
And / or now enabled under ERK example, and also fixed issue where lo…
mtygesen Dec 30, 2023
9f1dbe2
Now disables open reduced when using raw verifications
mtygesen Dec 30, 2023
132a5b1
Now evaluates if open reduced net button should be enabled/disabled c…
mtygesen Dec 30, 2023
044472d
Fixed bug where raw verification options would appear when changing t…
mtygesen Dec 30, 2023
975afdc
Merged together with premature eof branch
mtygesen Jan 3, 2024
61f3fa2
Fixed bug where buttons would enable again when changing queryType an…
mtygesen Jan 3, 2024
16ac01e
updated function name
mtygesen Jan 3, 2024
769ee64
Removed extra semi colon
mtygesen Jan 3, 2024
4aa0047
Now works for verifypn
mtygesen Jan 4, 2024
3ace385
Now works for verifypn
mtygesen Jan 4, 2024
ef6cfa8
Refactors
mtygesen Jan 4, 2024
0865d31
Fixed k-bound bug
mtygesen Jan 4, 2024
04948f2
Changed raw verification field into text area
mtygesen Jan 7, 2024
369d57f
Changed raw verification field into text area
mtygesen Jan 7, 2024
6066040
updated text area in raw verification options
mtygesen Jan 8, 2024
bb75aef
now opens in advanced view if query using raw verification options
mtygesen Jan 8, 2024
e077b90
Restructured raw verification layout
mtygesen Jan 9, 2024
8cf62c2
Removed redundant inset
mtygesen Jan 9, 2024
96ae244
Fixed mismatching tmp file names
mtygesen Jan 9, 2024
5e87acb
removed log
mtygesen Jan 9, 2024
af292bc
Made code more clear
mtygesen Jan 9, 2024
8a2cee3
Fixed bug where state of useRawVerification was firstly updated secon…
mtygesen Jan 11, 2024
f7828af
Now correctly disables/enables components when selecting parts of a q…
mtygesen Jan 12, 2024
84fb967
Now correctly enables/disables options when opening new query and whe…
mtygesen Jan 13, 2024
0487d6f
Fixed NPE
mtygesen Jan 15, 2024
859af02
fix
mtygesen Jan 16, 2024
90046f0
fixed issue where not all options would be disabled correctly when us…
mtygesen Jan 16, 2024
d70e3b0
now correctly enables the options again when toggling the use button …
mtygesen Jan 16, 2024
c9fd4cb
Added guard to refreshOverApproximationOption so it exits immediatly …
mtygesen Jan 17, 2024
e4132cb
Fixed issue with siphon trap and use color reductions
mtygesen Jan 18, 2024
e93b4d8
Fixed unfolded paths being added to non-colored nets using DTAPN
mtygesen Jan 20, 2024
977084c
use colored reduction now only visible for colored nets
mtygesen Jan 22, 2024
3895112
Fixed issue with verifying multiple queries at once, and "use stubbor…
mtygesen Jan 23, 2024
76e9cf2
Use trace refinement and siphon trap analysis now only available for CTL
mtygesen Jan 24, 2024
143dd7e
Fixes Kbound analysis and LTL / HyperLTL focus
mtygesen Jan 24, 2024
c270579
removed debug log
mtygesen Jan 25, 2024
65a32ea
Fixed bug with add predicates button
mtygesen Jan 25, 2024
d3d8637
Now logic buttons should be enabled/disabled correctly
mtygesen Jan 26, 2024
5b9add6
Now allows multiple quantifiers for non-game untimed nets
mtygesen Jan 27, 2024
8584b40
Updated when logic buttons are enabled
mtygesen Jan 27, 2024
5bb553d
Now allows boolean operators for until quantifier
mtygesen Jan 28, 2024
170d613
Now also enables boolean operators for X, G, and F
mtygesen Jan 28, 2024
50cae6a
Simplified logic
mtygesen Jan 28, 2024
09a1d9b
Fixed boolean operators not enabled in some cases
mtygesen Jan 28, 2024
ba3c35a
Enable buttons if the condition is not met to ensure correct state in…
mtygesen Jan 28, 2024
61a6349
Removed binding flag
mtygesen Jan 28, 2024
f496b1c
Fixed problems with LTL/hyperLTL
mtygesen Jan 29, 2024
f1a5ec1
Small correction
mtygesen Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/java/dk/aau/cs/verification/ProcessRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import dk.aau.cs.debug.Logger;
import dk.aau.cs.util.MemoryMonitor;
import dk.aau.cs.verification.VerifyTAPN.VerifyDTAPN;

public class ProcessRunner {

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/dk/aau/cs/verification/VerificationOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ public abstract class VerificationOptions {
protected int approximationDenominator;
protected boolean useStateequationCheck;
protected int extraTokens;

protected String reducedModelPath;
protected String unfoldedModelPath;
protected String unfoldedQueriesPath;
protected static String unfoldedModelPath;
protected static String unfoldedQueriesPath;

public abstract String toString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ public VerifyDTAPNOptions(
boolean stubbornReduction,
boolean partition,
boolean colorFixpoint,
boolean unfoldNet
boolean unfoldNet,
boolean useRawVerification,
String rawVerificationOptions
) {
this(extraTokens, traceOption, search, symmetry, gcd, timeDarts, pTrie, false, false, new InclusionPlaces(), WorkflowMode.NOT_WORKFLOW, 0, enableOverApproximation, enableUnderApproximation, approximationDenominator, stubbornReduction, null, partition, colorFixpoint, unfoldNet);
this(extraTokens, traceOption, search, symmetry, gcd, timeDarts, pTrie, false, false, new InclusionPlaces(), WorkflowMode.NOT_WORKFLOW, 0, enableOverApproximation, enableUnderApproximation, approximationDenominator, stubbornReduction, null, partition, colorFixpoint, unfoldNet, useRawVerification, rawVerificationOptions);
this.dontUseDeadPlaces = dontUseDeadPlaces;
}

Expand All @@ -69,34 +71,7 @@ public VerifyDTAPNOptions(
boolean colorFixpoint,
boolean unfoldNet,
boolean useRawVerification,
String rawVerificationOptions) {
this(extraTokens, traceOption, search, symmetry, gcd, timeDarts, pTrie, false, false, new InclusionPlaces(), WorkflowMode.NOT_WORKFLOW, 0, enableOverApproximation, enableUnderApproximation, approximationDenominator, stubbornReduction, null, partition, colorFixpoint, unfoldNet);

this.useRawVerification = useRawVerification;
this.rawVerificationOptions = rawVerificationOptions;
}

public VerifyDTAPNOptions(
int extraTokens,
TraceOption traceOption,
SearchOption search,
boolean symmetry,
boolean gcd,
boolean timeDarts,
boolean pTrie,
boolean useStateequationCheck,
boolean discreteInclusion,
InclusionPlaces inclusionPlaces,
WorkflowMode workflow,
long workflowbound,
boolean enableOverApproximation,
boolean enableUnderApproximation,
int approximationDenominator,
boolean stubbornReduction,
String reducedModelPath,
boolean partition,
boolean colorFixpoint,
boolean unfoldNet
String rawVerificationOptions
) {
super(extraTokens, traceOption, search, symmetry, useStateequationCheck, discreteInclusion, inclusionPlaces, enableOverApproximation, enableUnderApproximation, approximationDenominator);
this.timeDarts = timeDarts;
Expand All @@ -109,8 +84,10 @@ public VerifyDTAPNOptions(
this.partition = partition;
this.colorFixpoint = colorFixpoint;
this.unfold = unfoldNet;
this.useRawVerification = useRawVerification;
this.rawVerificationOptions = rawVerificationOptions;

if(unfold && trace() != TraceOption.NONE) // we only force unfolding when traces are involved
if(unfold && trace() != TraceOption.NONE && !useRawVerification) // we only force unfolding when traces are involved
{
try {
unfoldedModelPath = File.createTempFile("unfolded-", ".pnml").getAbsolutePath();
Expand All @@ -124,16 +101,15 @@ public VerifyDTAPNOptions(
@Override
public String toString() {
StringBuilder result = new StringBuilder();

if (useRawVerification) {
result.append(rawVerificationOptions);
return result.toString();
return result.append(rawVerificationOptions).toString();
}

result.append(kBoundArg());
result.append(deadTokenArg());
result.append(traceArg(traceOption));
if(trace() != TraceOption.NONE)
if(unfold && trace() != TraceOption.NONE)
{
result.append(" --write-unfolded-net ");
result.append(unfoldedModelPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private VerificationResult<TimedArcPetriNetTrace> verify(VerificationOptions opt
(query.getProperty() instanceof LTLENode && queryResult.value1().isQuerySatisfied()) ||
(query.getProperty() instanceof LTLANode && !queryResult.value1().isQuerySatisfied());

if (options.traceOption() != TraceOption.NONE && isColored && showTrace) {
if (options.traceOption() != TraceOption.NONE && isColored && showTrace && options.unfoldedModelPath() != null) {
PNMLoader tapnLoader = new PNMLoader();
File fileOut = new File(options.unfoldedModelPath());
File queriesOut = new File(options.unfoldedQueriesPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,6 @@ public VerifyPNOptions(
boolean useColoredReduction,
boolean useRawVerification,
String rawVerificationOptions
) {
this(extraTokens, traceOption, search, useOverApproximation, modelReduction, enableOverApproximation, enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, pathToReducedNet, useTarOption, useTarjan, colored, unfold, partition, colorFixpoint, useSymmetricVars, useColoredReduction);

this.useRawVerification = useRawVerification;
this.rawVerificationOptions = rawVerificationOptions;
}

public VerifyPNOptions(
int extraTokens,
TraceOption traceOption,
SearchOption search,
boolean useOverApproximation,
ModelReduction modelReduction,
boolean enableOverApproximation,
boolean enableUnderApproximation,
int approximationDenominator,
QueryCategory queryCategory,
AlgorithmOption algorithmOption,
boolean siphontrap,
QueryReductionTime queryReduction,
boolean stubbornReduction,
String pathToReducedNet,
boolean useTarOption,
boolean useTarjan,
boolean colored,
boolean unfold,
boolean partition,
boolean colorFixpoint,
boolean useSymmetricVars,
boolean useColoredReduction
) {
super(extraTokens, traceOption, search, true, useOverApproximation, false, new InclusionPlaces(), enableOverApproximation, enableUnderApproximation, approximationDenominator, useTarOption);

Expand All @@ -117,8 +87,10 @@ public VerifyPNOptions(
this.reducedModelPath = pathToReducedNet;
this.symmetricVars = useSymmetricVars;
this.useColoredReduction = useColoredReduction;
this.useRawVerification = useRawVerification;
this.rawVerificationOptions = rawVerificationOptions;

if(unfold) {
if(unfold && !useRawVerification) {
try {
unfoldedModelPath = File.createTempFile("unfolded-", ".pnml").getAbsolutePath();
unfoldedQueriesPath = File.createTempFile("unfoldedQueries-", ".xml").getAbsolutePath();
Expand Down Expand Up @@ -151,7 +123,35 @@ public VerifyPNOptions(
boolean colorFixpoint,
boolean useSymmetricVars
) {
this(extraTokens, traceOption, search, useOverApproximation, modelReduction, enableOverApproximation, enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, pathToReducedNet, useTarOption, useTarjan, colored, false, partition, colorFixpoint, useSymmetricVars, false);
this(extraTokens, traceOption, search, useOverApproximation, modelReduction, enableOverApproximation, enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, pathToReducedNet, useTarOption, useTarjan, colored, false, partition, colorFixpoint, useSymmetricVars, false, true, null);
}

public VerifyPNOptions(
int extraTokens,
TraceOption traceOption,
SearchOption search,
boolean useOverApproximation,
ModelReduction modelReduction,
boolean enableOverApproximation,
boolean enableUnderApproximation,
int approximationDenominator,
QueryCategory queryCategory,
AlgorithmOption algorithmOption,
boolean siphontrap,
QueryReductionTime queryReduction,
boolean stubbornReduction,
String pathToReducedNet,
boolean useTarOption,
boolean useTarjan,
boolean colored,
boolean unfold,
boolean partition,
boolean colorFixpoint,
boolean useSymmetricVars,
boolean useRawVerification,
String rawVerificationOptions
) {
this(extraTokens, traceOption, search, useOverApproximation, modelReduction, enableOverApproximation, enableUnderApproximation, approximationDenominator,queryCategory, algorithmOption, siphontrap, queryReduction, stubbornReduction, pathToReducedNet, useTarOption, useTarjan, colored, false, partition, colorFixpoint, useSymmetricVars, false, useRawVerification, rawVerificationOptions);
}

public VerifyPNOptions(
Expand Down Expand Up @@ -182,10 +182,9 @@ public VerifyPNOptions(
@Override
public String toString() {
StringBuilder result = new StringBuilder();

if (useRawVerification) {
result.append(rawVerificationOptions);
return result.toString();
return result.append(rawVerificationOptions).toString();
}

result.append("--k-bound ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ public class VerifyTAPNOptions extends VerificationOptions{

private static final Map<TraceOption, String> traceMap = createTraceOptionsMap();
private static final Map<SearchOption, String> searchMap = createSearchOptionsMap();
public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateequationCheck, boolean discreteInclusion, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator) {

public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateequationCheck, boolean discreteInclusion, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator, boolean useRawVerification, String rawVerificationOptions) {
this(extraTokens,traceOption, search, symmetry, useStateequationCheck, discreteInclusion, new InclusionPlaces(), enableOverApproximation, enableUnderApproximation, approximationDenominator);
this.rawVerificationOptions = rawVerificationOptions;
this.useRawVerification = useRawVerification;
}

public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption search, boolean symmetry, boolean useStateequationCheck, boolean discreteInclusion, InclusionPlaces inclusionPlaces, boolean enableOverApproximation, boolean enableUnderApproximation, int approximationDenominator) {
Expand All @@ -44,7 +46,7 @@ public VerifyTAPNOptions(int extraTokens, TraceOption traceOption, SearchOption
this.useRawVerification = useRawVerification;
this.rawVerificationOptions = rawVerificationOptions;

if(isColor && trace() != TraceOption.NONE) // we only force unfolding when traces are involved
if(isColor && trace() != TraceOption.NONE && !useRawVerification) // we only force unfolding when traces are involved
{
try {
unfoldedModelPath = File.createTempFile("unfolded-", ".pnml").getAbsolutePath();
Expand Down Expand Up @@ -96,10 +98,9 @@ public String deadTokenArg() {
@Override
public String toString() {
StringBuilder result = new StringBuilder();

if (useRawVerification) {
result.append(rawVerificationOptions);
return result.toString();
return result.append(rawVerificationOptions).toString();
}

if(unfoldedModelPath != null && unfoldedQueriesPath != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ else if (reductionOption == ReductionOption.VerifyPN || reductionOption == Reduc

public VerificationOptions getVerificationOptionsFromQuery(net.tapaal.gui.petrinet.verification.TAPNQuery query) {
if (query.getReductionOption() == ReductionOption.VerifyTAPN) {
return new VerifyTAPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useSymmetry(), false, query.discreteInclusion(), query.inclusionPlaces(), query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator()); // XXX DISABLES OverApprox
return new VerifyTAPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useSymmetry(), false, query.discreteInclusion(), query.inclusionPlaces(), query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.isColored(), false, query.getRawVerification(), query.getRawVerificationPrompt()); // XXX DISABLES OverApprox
} else if (query.getReductionOption() == ReductionOption.VerifyDTAPN) {
return new VerifyDTAPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useSymmetry(), query.useGCD(), query.useTimeDarts(), query.usePTrie(), false, query.discreteInclusion(), query.inclusionPlaces(), query.getWorkflowMode(), 0, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.isStubbornReductionEnabled(), null, query.usePartitioning(), query.useColorFixpoint(), query.isColored());
return new VerifyDTAPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useSymmetry(), query.useGCD(), query.useTimeDarts(), query.usePTrie(), false, query.discreteInclusion(), query.inclusionPlaces(), query.getWorkflowMode(), 0, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.isStubbornReductionEnabled(), null, query.usePartitioning(), query.useColorFixpoint(), query.isColored(), query.getRawVerification(), query.getRawVerificationPrompt());
} else if (query.getReductionOption() == ReductionOption.VerifyPN || query.getReductionOption() == ReductionOption.VerifyPNApprox || query.getReductionOption() == ReductionOption.VerifyPNReduce) {
return new VerifyPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useOverApproximation(), query.useReduction() ? ModelReduction.AGGRESSIVE : ModelReduction.NO_REDUCTION, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.getCategory(), query.getAlgorithmOption(), query.isSiphontrapEnabled(), query.isQueryReductionEnabled() ? QueryReductionTime.UnlimitedTime : QueryReductionTime.NoTime, query.isStubbornReductionEnabled(), null, query.isTarOptionEnabled(), query.isTarjan(), query.isColored(), query.usePartitioning(), query.useColorFixpoint(), query.useSymmetricVars());
return new VerifyPNOptions(query.getCapacity(), TraceOption.NONE, query.getSearchOption(), query.useOverApproximation(), query.useReduction() ? ModelReduction.AGGRESSIVE : ModelReduction.NO_REDUCTION, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator(), query.getCategory(), query.getAlgorithmOption(), query.isSiphontrapEnabled(), query.isQueryReductionEnabled() ? QueryReductionTime.UnlimitedTime : QueryReductionTime.NoTime, query.isStubbornReductionEnabled(), null, query.isTarOptionEnabled(), query.isTarjan(), query.isColored(), false, query.usePartitioning(), query.useColorFixpoint(), query.useSymmetricVars(), query.useColoredReduction(), query.getRawVerification(), query.getRawVerificationPrompt());
} else {
return new VerifytaOptions(TraceOption.NONE, query.getSearchOption(), false, query.getReductionOption(), query.useSymmetry(), false, query.isOverApproximationEnabled(), query.isUnderApproximationEnabled(), query.approximationDenominator());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,6 @@ private void initMonitorPanel() {

private void process() {
tableModel.clear();

currentWorker = new BatchProcessingWorker(files, tableModel, getVerificationOptions());

currentWorker.addPropertyChangeListener(evt -> {
Expand Down
Loading
Loading