From 5bf2252bea22e36d1520e433cabee0640cf64dd4 Mon Sep 17 00:00:00 2001 From: nick_battle Date: Tue, 7 Nov 2023 20:49:49 +0000 Subject: [PATCH] Set the interpreter default module/class from PO location --- .../src/main/java/quickcheck/QuickCheck.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/quickcheck/src/main/java/quickcheck/QuickCheck.java b/examples/quickcheck/src/main/java/quickcheck/QuickCheck.java index e3c04edea..4723c4482 100644 --- a/examples/quickcheck/src/main/java/quickcheck/QuickCheck.java +++ b/examples/quickcheck/src/main/java/quickcheck/QuickCheck.java @@ -395,6 +395,7 @@ else if (results.provedBy != null) } Context ctxt = Interpreter.getInstance().getInitialContext(); + Interpreter.getInstance().setDefaultName(po.location.module); if (Settings.dialect != Dialect.VDM_SL) { @@ -419,14 +420,13 @@ else if (results.provedBy != null) { verbose("PO #%d, starting...\n", po.number); + // Suspend annotation execution by the interpreter, because the + // expressions and statements in the PO can invoke them. + INAnnotation.suspend(true); + do { ictxt.next(); - - // Suspend annotation execution by the interpreter, because the - // expressions and statements in the PO can invoke them. - INAnnotation.suspend(true); - execResult = poexp.eval(ictxt); } while (ictxt.hasNext() && execResult.boolValue(ctxt));