tla-ts 0.0.10-dev.11307be75 → 0.0.10-dev.22f7435d3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deciders.cjs +31 -31
- package/dist/deciders.js +30 -30
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -1
- package/dist/parallel-worker.cjs +1 -1
- package/dist/parallel-worker.js +1 -1
- package/dist/prove.cjs +68 -68
- package/dist/prove.js +61 -61
- package/dist/run.cjs +42 -42
- package/dist/run.js +44 -44
- package/dist/transfer.cjs +38 -38
- package/dist/transfer.js +29 -29
- package/dist/worker.cjs +7 -7
- package/dist/worker.js +7 -7
- package/package.json +1 -1
- package/src/bags.ts +5 -2
- package/src/builtins.ts +4 -3
- package/src/check-failure.ts +9 -6
- package/src/check-trace.ts +116 -64
- package/src/check.ts +343 -166
- package/src/cli/tlc-output.ts +1 -0
- package/src/cli/tlc.ts +3 -2
- package/src/codegen.ts +23 -8
- package/src/dependencies.ts +5 -4
- package/src/dfid.ts +13 -8
- package/src/environment.ts +1 -0
- package/src/evaluate.ts +58 -23
- package/src/exit-codes.ts +27 -13
- package/src/java-hash.ts +14 -0
- package/src/liveness-checker.ts +131 -81
- package/src/liveness.ts +48 -10
- package/src/parser.ts +6 -1
- package/src/prover/smt/solver/arith-rewriter.ts +11 -3
- package/src/prover/smt/solver/array-rewriter.ts +12 -2
- package/src/prover/smt/solver/asserted-formulas.ts +109 -63
- package/src/prover/smt/solver/ast.ts +5 -3
- package/src/prover/smt/solver/auf-solver.ts +23 -12
- package/src/prover/smt/solver/bit-blast-tactic.ts +26 -0
- package/src/prover/smt/solver/bound-simplifier.ts +10 -11
- package/src/prover/smt/solver/card2bv.ts +34 -15
- package/src/prover/smt/solver/cofactor-elim-term-ite.ts +39 -23
- package/src/prover/smt/solver/context.ts +44 -11
- package/src/prover/smt/solver/dependent-expr-state.ts +19 -13
- package/src/prover/smt/solver/dt2bv-tactic.ts +36 -20
- package/src/prover/smt/solver/elim-bounds.ts +89 -0
- package/src/prover/smt/solver/elim-uncnstr.ts +1 -1
- package/src/prover/smt/solver/fd-solver.ts +146 -39
- package/src/prover/smt/solver/internalizer.ts +1 -1
- package/src/prover/smt/solver/lp/lp-settings.ts +4 -0
- package/src/prover/smt/solver/maxcore.ts +2 -1
- package/src/prover/smt/solver/maxsmt-base.ts +1 -0
- package/src/prover/smt/solver/model-checker.ts +1 -1
- package/src/prover/smt/solver/model-evaluator.ts +2 -0
- package/src/prover/smt/solver/model-generator.ts +82 -42
- package/src/prover/smt/solver/muz/dl-context.ts +12 -40
- package/src/prover/smt/solver/muz/dl-mk-coi-filter.ts +1 -1
- package/src/prover/smt/solver/muz/dl-rule.ts +6 -7
- package/src/prover/smt/solver/muz/hnf.ts +2 -2
- package/src/prover/smt/solver/muz/horn-tactic.ts +14 -1
- package/src/prover/smt/solver/muz/rule-properties.ts +22 -0
- package/src/prover/smt/solver/muz/spacer-prop-solver.ts +1 -1
- package/src/prover/smt/solver/opt-context.ts +12 -4
- package/src/prover/smt/solver/opt-pareto.ts +19 -0
- package/src/prover/smt/solver/opt-solver.ts +4 -3
- package/src/prover/smt/solver/parallel-tactic.ts +1 -1
- package/src/prover/smt/solver/poly-rewriter.ts +1 -0
- package/src/prover/smt/solver/proto-model.ts +4 -2
- package/src/prover/smt/solver/push-app-ite.ts +37 -0
- package/src/prover/smt/solver/qsat.ts +23 -8
- package/src/prover/smt/solver/rewriter-tpl.ts +7 -6
- package/src/prover/smt/solver/rewriter.ts +31 -25
- package/src/prover/smt/solver/sat/goal2sat.ts +0 -1
- package/src/prover/smt/solver/sat/inc-sat-solver.ts +56 -28
- package/src/prover/smt/solver/sat/sat-tactic.ts +13 -4
- package/src/prover/smt/solver/sat/sat2goal.ts +10 -7
- package/src/prover/smt/solver/smt-consequences.ts +1 -1
- package/src/prover/smt/solver/smt-kernel.ts +39 -4
- package/src/prover/smt/solver/smt-setup.ts +28 -4
- package/src/prover/smt/solver/smtlib-parser.ts +31 -4
- package/src/prover/smt/solver/smtlib-script.ts +219 -82
- package/src/prover/smt/solver/solve-eqs.ts +24 -17
- package/src/prover/smt/solver/solver.ts +18 -3
- package/src/prover/smt/solver/tactic.ts +132 -78
- package/src/prover/smt/solver/theory-bv.ts +11 -1
- package/src/prover/smt/solver/theory-fpa.ts +1 -1
- package/src/prover/smt/solver/theory-lra-final-check.ts +1 -0
- package/src/prover/smt/solver/theory-lra-internalize.ts +1 -0
- package/src/prover/smt/solver/theory-lra-propagate.ts +7 -1
- package/src/prover/smt/solver/theory-lra.ts +1 -0
- package/src/prover/smt/solver/tseitin-cnf.ts +1 -0
- package/src/resolve.ts +242 -80
- package/src/runtime.ts +4 -0
- package/src/search.ts +161 -92
- package/src/simulate.ts +165 -102
- package/src/spec-description.ts +3 -4
- package/src/standard-modules.ts +56 -22
- package/src/subexpressions.ts +71 -16
- package/src/successors.ts +6 -3
- package/src/symmetry.ts +1 -0
- package/src/tlc/random.ts +2 -1
- package/src/tlc/replay.ts +22 -14
- package/src/tlc/tlc-operators.ts +7 -7
- package/src/tlc/tlcext-operators.ts +26 -10
- package/src/tlc/trace-spec.ts +6 -20
- package/src/typed-tier.ts +9 -4
- package/src/values.ts +95 -57
package/src/search.ts
CHANGED
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
type Context,
|
|
53
53
|
type Environment,
|
|
54
54
|
type Scope,
|
|
55
|
+
type State,
|
|
55
56
|
} from "./evaluate";
|
|
56
57
|
import { EXIT_STATUS, setExitCode } from "./exit-codes";
|
|
57
58
|
import type { JavaOverride } from "./java-overrides";
|
|
@@ -85,11 +86,13 @@ import { createTlcOrder } from "./tlc/order";
|
|
|
85
86
|
import { getTlcFingerprint, getTlcFingerprints, setFingerprintPolynomial } from "./tlc/fingerprint";
|
|
86
87
|
import type { TlcVersion } from "./tlc/version";
|
|
87
88
|
import {
|
|
89
|
+
createModelValue,
|
|
88
90
|
formatValue,
|
|
89
91
|
freezeStringOrder,
|
|
90
92
|
getWrittenPairs,
|
|
91
93
|
isFunctionValue,
|
|
92
94
|
isUpdatedElementOf,
|
|
95
|
+
markNormalized,
|
|
93
96
|
setAliasName,
|
|
94
97
|
setStringOrder,
|
|
95
98
|
setValueOptions,
|
|
@@ -656,20 +659,26 @@ const getPredicate = (expression: Expression, environment: Environment) => {
|
|
|
656
659
|
};
|
|
657
660
|
|
|
658
661
|
const getStateChecks = (named: NamedExpression[], environment: Environment): StateCheck[] =>
|
|
659
|
-
named.flatMap((item) =>
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
662
|
+
named.flatMap((item) => {
|
|
663
|
+
const predicate = getPredicate(item.expression, environment);
|
|
664
|
+
const isImpure =
|
|
665
|
+
item.scope === undefined && getReadVariables(predicate, environment) === undefined;
|
|
666
|
+
// TLC evaluates an invariant whole, so one that prints isn't split into conjuncts.
|
|
667
|
+
return (isImpure ? [predicate] : getConjuncts(item.expression, environment)).map(
|
|
668
|
+
(expression) => {
|
|
669
|
+
const variables =
|
|
670
|
+
item.scope === undefined ? getReadVariables(expression, environment) : undefined;
|
|
671
|
+
return {
|
|
672
|
+
name: item.name,
|
|
673
|
+
expression,
|
|
674
|
+
scope: item.scope,
|
|
675
|
+
variables,
|
|
676
|
+
membership: getMembership(expression, variables, environment),
|
|
677
|
+
predicate,
|
|
678
|
+
};
|
|
679
|
+
},
|
|
680
|
+
);
|
|
681
|
+
});
|
|
673
682
|
|
|
674
683
|
const isUnchangedFor = (stateCheck: StateCheck, state: Value[], parent: Value[] | undefined) => {
|
|
675
684
|
const variables = stateCheck.variables;
|
|
@@ -712,8 +721,8 @@ export interface Search {
|
|
|
712
721
|
toRecord: (state: Value[]) => Record<string, Value>;
|
|
713
722
|
evaluateAlias: (
|
|
714
723
|
alias: string,
|
|
715
|
-
state:
|
|
716
|
-
next:
|
|
724
|
+
state: State,
|
|
725
|
+
next: State | undefined,
|
|
717
726
|
isTool: boolean,
|
|
718
727
|
) => Record<string, Value>;
|
|
719
728
|
spec: Specification;
|
|
@@ -738,12 +747,13 @@ export interface Search {
|
|
|
738
747
|
}
|
|
739
748
|
| undefined;
|
|
740
749
|
findViolatedInvariant: (state: Value[], parent?: Value[]) => StateCheck | undefined;
|
|
741
|
-
|
|
750
|
+
forEachViolatedInvariant: (state: Value[], onViolated: (invariant: StateCheck) => void) => void;
|
|
742
751
|
checkReplayedInitialState: (
|
|
743
752
|
state: Value[],
|
|
744
753
|
tracing: Environment,
|
|
745
754
|
addFingerprint: () => void,
|
|
746
|
-
|
|
755
|
+
onViolated: (violation: Pick<InitialStateViolation, "status" | "name">) => void,
|
|
756
|
+
) => void;
|
|
747
757
|
checkReplayedSuccessor: (
|
|
748
758
|
state: Value[],
|
|
749
759
|
next: Value[],
|
|
@@ -783,8 +793,8 @@ export const getIncompleteSuccessorMessage = (
|
|
|
783
793
|
|
|
784
794
|
export const getContext = (
|
|
785
795
|
environment: Environment,
|
|
786
|
-
state:
|
|
787
|
-
next:
|
|
796
|
+
state: State | undefined,
|
|
797
|
+
next: State | undefined,
|
|
788
798
|
scope?: Scope,
|
|
789
799
|
) => ({ environment, scope, state, next });
|
|
790
800
|
|
|
@@ -817,7 +827,7 @@ const getExpectedBoolean = (expression: Expression, environment: Environment) =>
|
|
|
817
827
|
|
|
818
828
|
const holdsAsConjunct = (check: StateCheck, context: Context) =>
|
|
819
829
|
holdsLikeTlc(check.expression, context, (expression, environment) => {
|
|
820
|
-
holdsLikeTlc(check.predicate, context);
|
|
830
|
+
if (check.predicate !== check.expression) holdsLikeTlc(check.predicate, context);
|
|
821
831
|
return getExpectedBoolean(expression, environment);
|
|
822
832
|
});
|
|
823
833
|
|
|
@@ -1052,8 +1062,20 @@ export const createSearch = (
|
|
|
1052
1062
|
...getCoveredChecks("invariant", configInvariants),
|
|
1053
1063
|
...getCoveredChecks("invariant", properties.invariants, false),
|
|
1054
1064
|
];
|
|
1065
|
+
const coveredInvariantChecks = new Map(
|
|
1066
|
+
[...configInvariants, ...properties.invariants].map((item, index) => [
|
|
1067
|
+
getPredicate(item.expression, environment),
|
|
1068
|
+
coveredInvariants[index],
|
|
1069
|
+
]),
|
|
1070
|
+
);
|
|
1055
1071
|
const coveredActionConstraints = getCoveredChecks("constraint", actionConstraints);
|
|
1056
1072
|
const coveredConstraints = getCoveredChecks("constraint", namedConstraints);
|
|
1073
|
+
const coveredConstraintChecks = new Map(
|
|
1074
|
+
coveredConstraints.map((check) => [check.expression, check]),
|
|
1075
|
+
);
|
|
1076
|
+
const constraintPredicates = [
|
|
1077
|
+
...new Map(constraints.map((constraint) => [constraint.predicate, constraint])).values(),
|
|
1078
|
+
];
|
|
1057
1079
|
const coveredInitialPredicates = getCoveredChecks("implied", properties.initialPredicates, false);
|
|
1058
1080
|
const coveredActionProperties = getCoveredChecks(
|
|
1059
1081
|
"implied",
|
|
@@ -1074,9 +1096,14 @@ export const createSearch = (
|
|
|
1074
1096
|
return undefined;
|
|
1075
1097
|
}
|
|
1076
1098
|
};
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
|
|
1099
|
+
const holdsReplayed = (
|
|
1100
|
+
covered: CoveredCheck | undefined,
|
|
1101
|
+
expression: Expression,
|
|
1102
|
+
context: Context,
|
|
1103
|
+
) =>
|
|
1104
|
+
coverage && covered
|
|
1105
|
+
? runAtCoverageNode(coverage, covered.node, () => holdsLikeTlc(covered.expression, context))
|
|
1106
|
+
: holdsLikeTlc(expression, context);
|
|
1080
1107
|
const satisfiesCovered = (checks: CoveredCheck[], state: Value[], next?: Value[]) => {
|
|
1081
1108
|
if (!coverage) return undefined;
|
|
1082
1109
|
for (const check of checks) {
|
|
@@ -1132,9 +1159,15 @@ export const createSearch = (
|
|
|
1132
1159
|
};
|
|
1133
1160
|
const getViewValue = (expression: Expression, state: Value[]) =>
|
|
1134
1161
|
evaluate(expression, getContext(environment, state, undefined));
|
|
1162
|
+
const getRepresentativeState = (state: Value[]) => {
|
|
1163
|
+
// TLC's TLCStateMut#fingerPrint deep-normalizes a state before it evaluates the view.
|
|
1164
|
+
if (view !== undefined) state.forEach(markNormalized);
|
|
1165
|
+
return symmetryGroup === undefined
|
|
1166
|
+
? state
|
|
1167
|
+
: getRepresentative(state, symmetryGroup, getTlcOrder());
|
|
1168
|
+
};
|
|
1135
1169
|
const getTlcStateFingerprint = (state: Value[]) => {
|
|
1136
|
-
const representative =
|
|
1137
|
-
symmetryGroup === undefined ? state : getRepresentative(state, symmetryGroup, getTlcOrder());
|
|
1170
|
+
const representative = getRepresentativeState(state);
|
|
1138
1171
|
return getTlcFingerprint(
|
|
1139
1172
|
view === undefined
|
|
1140
1173
|
? getTlcOrder().map((index) => representative[index])
|
|
@@ -1142,15 +1175,16 @@ export const createSearch = (
|
|
|
1142
1175
|
);
|
|
1143
1176
|
};
|
|
1144
1177
|
const findFailedInitialPredicate = (state: Value[]) =>
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
),
|
|
1153
|
-
|
|
1178
|
+
properties.initialPredicates.find((predicate, index) => {
|
|
1179
|
+
const value =
|
|
1180
|
+
coverage && evaluateCovered(coverage, coveredInitialPredicates[index], state, undefined);
|
|
1181
|
+
return typeof value === "boolean"
|
|
1182
|
+
? !value
|
|
1183
|
+
: !holdsLikeTlc(
|
|
1184
|
+
predicate.expression,
|
|
1185
|
+
getContext(environment, state, undefined, predicate.scope),
|
|
1186
|
+
);
|
|
1187
|
+
});
|
|
1154
1188
|
const violatingStates = new WeakSet<Value[]>();
|
|
1155
1189
|
const isViolated = (invariant: StateCheck, state: Value[], parent: Value[] | undefined) => {
|
|
1156
1190
|
const checkedParent = parent && !violatingStates.has(parent) ? parent : undefined;
|
|
@@ -1174,6 +1208,21 @@ export const createSearch = (
|
|
|
1174
1208
|
);
|
|
1175
1209
|
}
|
|
1176
1210
|
};
|
|
1211
|
+
const isPredicateViolated = (
|
|
1212
|
+
predicate: StateCheck,
|
|
1213
|
+
state: Value[],
|
|
1214
|
+
parent: Value[] | undefined,
|
|
1215
|
+
) => {
|
|
1216
|
+
const covered = coveredInvariantChecks.get(predicate.predicate);
|
|
1217
|
+
const value =
|
|
1218
|
+
coverage && covered ? evaluateCovered(coverage, covered, state, undefined) : undefined;
|
|
1219
|
+
return typeof value === "boolean"
|
|
1220
|
+
? !value
|
|
1221
|
+
: invariants.some(
|
|
1222
|
+
(invariant) =>
|
|
1223
|
+
invariant.predicate === predicate.predicate && isViolated(invariant, state, parent),
|
|
1224
|
+
);
|
|
1225
|
+
};
|
|
1177
1226
|
const isFingerprintedLikeTlc = hasWideString(config, environment);
|
|
1178
1227
|
runtime.getFingerprint = getTlcStateFingerprint;
|
|
1179
1228
|
const findUnwitnessedPossible = () => {
|
|
@@ -1229,14 +1278,16 @@ export const createSearch = (
|
|
|
1229
1278
|
spec,
|
|
1230
1279
|
toRecord,
|
|
1231
1280
|
evaluateAlias: (alias, state, next, isTool) => {
|
|
1281
|
+
const getStateRecord = () =>
|
|
1282
|
+
toRecord(state.map((value) => value ?? createModelValue("null")));
|
|
1232
1283
|
try {
|
|
1233
1284
|
getConfigDefinition("alias", alias, environment);
|
|
1234
1285
|
const value = evaluate(createIdentifier(alias), getContext(environment, state, next));
|
|
1235
1286
|
const record = toAliasRecord(value);
|
|
1236
|
-
return record === undefined ?
|
|
1287
|
+
return record === undefined ? getStateRecord() : setAliasName(record, alias);
|
|
1237
1288
|
} catch (error) {
|
|
1238
1289
|
if (!(error instanceof TlaConfigError || error instanceof TlaEvaluationError)) throw error;
|
|
1239
|
-
return { ...
|
|
1290
|
+
return { ...getStateRecord(), _ALIASEvalError: formatNestedMessage(error.message, isTool) };
|
|
1240
1291
|
}
|
|
1241
1292
|
},
|
|
1242
1293
|
isSymmetric: symmetryGroup !== undefined,
|
|
@@ -1320,64 +1371,81 @@ export const createSearch = (
|
|
|
1320
1371
|
},
|
|
1321
1372
|
getFingerprintState: (state) => {
|
|
1322
1373
|
if (isFingerprintedLikeTlc) return [String(getTlcStateFingerprint(state))];
|
|
1323
|
-
const representative =
|
|
1324
|
-
symmetryGroup === undefined
|
|
1325
|
-
? state
|
|
1326
|
-
: getRepresentative(state, symmetryGroup, getTlcOrder());
|
|
1374
|
+
const representative = getRepresentativeState(state);
|
|
1327
1375
|
return view === undefined ? representative : [getViewValue(view.expression, representative)];
|
|
1328
1376
|
},
|
|
1329
1377
|
findViolatedInvariant: (state, parent) => {
|
|
1330
|
-
const
|
|
1331
|
-
|
|
1378
|
+
const violated =
|
|
1379
|
+
coverage === undefined
|
|
1380
|
+
? invariants.find((invariant) => isViolated(invariant, state, parent))
|
|
1381
|
+
: invariantPredicates.find((predicate) => isPredicateViolated(predicate, state, parent));
|
|
1332
1382
|
if (violated) violatingStates.add(state);
|
|
1333
1383
|
return violated;
|
|
1334
1384
|
},
|
|
1335
|
-
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1385
|
+
forEachViolatedInvariant: (state, onViolated) => {
|
|
1386
|
+
for (const predicate of invariantPredicates) {
|
|
1387
|
+
if (!isPredicateViolated(predicate, state, undefined)) continue;
|
|
1388
|
+
violatingStates.add(state);
|
|
1389
|
+
onViolated(predicate);
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1392
|
+
checkReplayedInitialState: (state, tracing, addFingerprint, onViolated) => {
|
|
1393
|
+
const holdsIn = (
|
|
1394
|
+
covered: CoveredCheck | undefined,
|
|
1395
|
+
expression: Expression,
|
|
1396
|
+
scope: Scope | undefined,
|
|
1397
|
+
) => holdsReplayed(covered, expression, getContext(tracing, state, undefined, scope));
|
|
1398
|
+
const isInModel = constraintPredicates.every((constraint) =>
|
|
1399
|
+
holdsIn(
|
|
1400
|
+
coveredConstraintChecks.get(constraint.predicate),
|
|
1401
|
+
constraint.predicate,
|
|
1402
|
+
constraint.scope,
|
|
1340
1403
|
),
|
|
1341
1404
|
);
|
|
1342
|
-
if (
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
holdsLikeTlc(expression, getContext(tracing, state, undefined, scope));
|
|
1348
|
-
if (constraints.every((constraint) => holdsIn(constraint.predicate, constraint.scope))) {
|
|
1349
|
-
addFingerprint();
|
|
1405
|
+
if (isInModel) addFingerprint();
|
|
1406
|
+
for (const invariant of invariantPredicates) {
|
|
1407
|
+
const covered = coveredInvariantChecks.get(invariant.predicate);
|
|
1408
|
+
if (holdsIn(covered, invariant.predicate, invariant.scope)) continue;
|
|
1409
|
+
onViolated({ status: "invariant-violation", name: invariant.name });
|
|
1350
1410
|
}
|
|
1351
|
-
const invariant = invariantPredicates.find((check) => !holdsIn(check.predicate, check.scope));
|
|
1352
|
-
if (invariant) return { status: "invariant-violation", name: invariant.name };
|
|
1353
1411
|
const predicate = properties.initialPredicates.find(
|
|
1354
|
-
(check) => !holdsIn(check.expression, check.scope),
|
|
1412
|
+
(check, index) => !holdsIn(coveredInitialPredicates[index], check.expression, check.scope),
|
|
1355
1413
|
);
|
|
1356
|
-
|
|
1414
|
+
if (predicate) onViolated({ status: "liveness-violation", name: predicate.name });
|
|
1357
1415
|
},
|
|
1358
1416
|
checkReplayedSuccessor: (state, next, tracing, addFingerprint) => {
|
|
1359
1417
|
const isInModel =
|
|
1360
|
-
|
|
1361
|
-
|
|
1418
|
+
constraintPredicates.every((constraint) =>
|
|
1419
|
+
holdsReplayed(
|
|
1420
|
+
coveredConstraintChecks.get(constraint.predicate),
|
|
1362
1421
|
constraint.predicate,
|
|
1363
1422
|
getContext(tracing, next, undefined, constraint.scope),
|
|
1364
1423
|
),
|
|
1365
1424
|
) &&
|
|
1366
|
-
actionConstraints.every((constraint) =>
|
|
1367
|
-
|
|
1425
|
+
actionConstraints.every((constraint, index) =>
|
|
1426
|
+
holdsReplayed(
|
|
1427
|
+
coveredActionConstraints[index],
|
|
1428
|
+
constraint.expression,
|
|
1429
|
+
getContext(tracing, state, next, constraint.scope),
|
|
1430
|
+
),
|
|
1368
1431
|
);
|
|
1369
1432
|
// TLC checks the invariants of a successor it has not seen, even outside the model.
|
|
1370
1433
|
const isUnseen = isInModel ? addFingerprint() : true;
|
|
1371
1434
|
return (
|
|
1372
1435
|
(!isUnseen ||
|
|
1373
1436
|
invariantPredicates.every((invariant) =>
|
|
1374
|
-
|
|
1437
|
+
holdsReplayed(
|
|
1438
|
+
coveredInvariantChecks.get(invariant.predicate),
|
|
1375
1439
|
invariant.predicate,
|
|
1376
1440
|
getContext(tracing, next, undefined, invariant.scope),
|
|
1377
1441
|
),
|
|
1378
1442
|
)) &&
|
|
1379
|
-
actionProperties.every((property) =>
|
|
1380
|
-
|
|
1443
|
+
actionProperties.every((property, index) =>
|
|
1444
|
+
holdsReplayed(
|
|
1445
|
+
coveredActionProperties[index],
|
|
1446
|
+
property.box,
|
|
1447
|
+
getContext(tracing, state, next, property.scope),
|
|
1448
|
+
),
|
|
1381
1449
|
)
|
|
1382
1450
|
);
|
|
1383
1451
|
},
|
|
@@ -1390,31 +1458,32 @@ export const createSearch = (
|
|
|
1390
1458
|
),
|
|
1391
1459
|
findFailedInitialPredicate,
|
|
1392
1460
|
findViolatedActionProperty: (state, next) =>
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
)
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1461
|
+
actionProperties.find((property, index) => {
|
|
1462
|
+
const value =
|
|
1463
|
+
coverage && evaluateCovered(coverage, coveredActionProperties[index], state, next);
|
|
1464
|
+
if (typeof value === "boolean") return !value;
|
|
1465
|
+
try {
|
|
1466
|
+
return (
|
|
1467
|
+
!holdsLikeTlc(
|
|
1468
|
+
property.action,
|
|
1469
|
+
getContext(environment, state, next, property.scope),
|
|
1470
|
+
() =>
|
|
1471
|
+
`Attempted to evaluate an expression of form [A]_e, but A was not a boolean.\n${describeRange(property.box)}`,
|
|
1472
|
+
) &&
|
|
1473
|
+
!holds(
|
|
1474
|
+
property.unchanged,
|
|
1475
|
+
getContext(environment, state, next, property.scope),
|
|
1476
|
+
"a subscript",
|
|
1477
|
+
)
|
|
1478
|
+
);
|
|
1479
|
+
} catch (error) {
|
|
1480
|
+
throw withHeadline(
|
|
1481
|
+
withNextStateExitCode(error),
|
|
1482
|
+
MESSAGE_CODE.actionPropertyEvaluationFailed,
|
|
1483
|
+
`Evaluating action property ${property.name} failed.`,
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
}),
|
|
1418
1487
|
satisfiesActionConstraints: (state, next) =>
|
|
1419
1488
|
satisfiesCovered(coveredActionConstraints, state, next) ??
|
|
1420
1489
|
actionConstraints.every((constraint) => holdsActionConstraint(constraint, state, next)),
|