Skip to content

Commit

Permalink
Treat exists as proved if true
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbattle committed Sep 10, 2023
1 parent c4e4962 commit 98cdf7f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/quickcheck/src/main/java/quickcheck/QuickCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.fujitsu.vdmj.runtime.ContextException;
import com.fujitsu.vdmj.runtime.Interpreter;
import com.fujitsu.vdmj.runtime.RootContext;
import com.fujitsu.vdmj.tc.expressions.TCExistsExpression;
import com.fujitsu.vdmj.tc.expressions.TCExpression;
import com.fujitsu.vdmj.tc.lex.TCNameToken;
import com.fujitsu.vdmj.util.GetResource;
Expand Down Expand Up @@ -442,7 +443,17 @@ else if (result instanceof BooleanValue)
{
if (result.boolValue(ctxt))
{
String outcome = (results.proved) ? "PROVED" : "PASSED";
String outcome = null;

if (po.getCheckedExpression() instanceof TCExistsExpression)
{
outcome = "PROVED"; // Any "true" of an exists is PROVED.
}
else
{
outcome = (results.proved) ? "PROVED" : "PASSED";
}

printf("PO #%d, %s %s\n", po.number, outcome, duration(before, after));
}
else
Expand Down

0 comments on commit 98cdf7f

Please sign in to comment.