Record Class ConstructVerdict
- Record Components:
constructFqn- the fully qualified name of the analysed constructverified- true when no counterexample was found within the bounded modelcounterexamples- the undischarged obligations refuted by a concrete inputdeadBranches- the branches proven unreachable for every input (discharged by contradiction)provedSafe- the obligations the engine discharged — proved cannot fail (the green✓list: a literal divisor, arequire/ifguard, a constrained value that stays in window). As the addendum argues, the proved-safe list matters as much as the failures — it is what turns "no counterexample" into "positively verified here, and here's why" in the IDE Flow pane. Distinct fromdeadBranches(a whole branch is unreachable) and from the silently-skipped sites the engine cannot model either way.unanalysableReason- why the engine could not analyse this construct at all, ornullwhen it did. Non-null forcesverifiedfalse — seenotAnalysed(String, String).
SymbolicEngine) over one construct
(docs/tooling/EK9_SYMBOLIC_SCANNER_IMPLEMENTATION_SPEC.md §3/§4.4/§6). It is the ∃-polarity payoff of
the scanner: the M1 census (Layer 1) says how many obligations a construct carries and how
many an existing analysis already discharges; this verdict says, for the undischarged ones,
whether a concrete input refutes them and, if so, what that witnessing input is.
Two independent signals are folded together here — this is the tie of the two M3 engine cores:
- Dead branches from the
phase5.flow.SymbolicPathConditionWalker(slice A): a branch whose accumulated relational facts are unsatisfiable is unreachable for every input, so any obligation it guards is discharged by construction (Example 6:require lo <= hithenif lo > hi— theifbody is dead). - Counterexamples from the
WitnessEnumerator(slice B): an undischarged obligation driven through a type's representative value-classes, yielding the first input that violates it (Example 1:total / count—count=0).
A construct is verified() exactly when the engine analysed it and found no
counterexample to any of its obligations within the bounded model. This is the value asserted by the
@Verified directive; each ConstructVerdict.Counterexample.witness() is the value asserted by
@Counterexample (§4.2).
"No counterexample" is not the same as "verified". When the engine cannot reach a
construct's body at all it must say so, never fall through to a green light: an empty counterexample
list would otherwise self-certify a body that was never read. notAnalysed(String, String) is that third
outcome, and the compact constructor makes the bad state unrepresentable — a verdict carrying an
unanalysableReason() can never also be verified. This is the eliminate, don't
mitigate rule applied to the verdict itself.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA concrete input that violates an obligation — the witness a developer can paste into a test.static final recordA branch proven dead (unreachable for every input) by a contradiction in its path condition.static final recordAn obligation the engine proved cannot fail within the bounded model — the green✓entry. -
Constructor Summary
ConstructorsConstructorDescriptionConstructVerdict(String constructFqn, boolean verified, List<ConstructVerdict.Counterexample> counterexamples, List<ConstructVerdict.DeadBranch> deadBranches, List<ConstructVerdict.ProvedSafe> provedSafe, String unanalysableReason) Guard the one state that must not exist: a construct claimed verified that the engine never read. -
Method Summary
Modifier and TypeMethodDescriptionbooleananalysed()Whether the engine actually read this construct's body (false = no claim either way).Returns the value of theconstructFqnrecord component.Returns the value of thecounterexamplesrecord component.Returns the value of thedeadBranchesrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanWhether the engine refuted at least one obligation with a concrete counterexample.final inthashCode()Returns a hash code value for this object.static ConstructVerdictnotAnalysed(String constructFqn, String reason) The verdict for a construct whose body the bounded model could not reach — not a pass.Returns the value of theprovedSaferecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theunanalysableReasonrecord component.booleanverified()Returns the value of theverifiedrecord component.
-
Constructor Details
-
ConstructVerdict
public ConstructVerdict(String constructFqn, boolean verified, List<ConstructVerdict.Counterexample> counterexamples, List<ConstructVerdict.DeadBranch> deadBranches, List<ConstructVerdict.ProvedSafe> provedSafe, String unanalysableReason) Guard the one state that must not exist: a construct claimed verified that the engine never read.
-
-
Method Details
-
notAnalysed
The verdict for a construct whose body the bounded model could not reach — not a pass. Carries no counterexamples because none were looked for, which is precisely why it must not be reported asverified.- Parameters:
constructFqn- the fully qualified name of the construct that could not be analysedreason- why it could not be analysed, in terms a developer can act on- Returns:
- a verdict that is neither verified nor refuted
-
analysed
public boolean analysed()Whether the engine actually read this construct's body (false = no claim either way). -
hasCounterexample
public boolean hasCounterexample()Whether the engine refuted at least one obligation with a concrete counterexample. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
constructFqn
Returns the value of theconstructFqnrecord component.- Returns:
- the value of the
constructFqnrecord component
-
verified
-
counterexamples
Returns the value of thecounterexamplesrecord component.- Returns:
- the value of the
counterexamplesrecord component
-
deadBranches
Returns the value of thedeadBranchesrecord component.- Returns:
- the value of the
deadBranchesrecord component
-
provedSafe
Returns the value of theprovedSaferecord component.- Returns:
- the value of the
provedSaferecord component
-
unanalysableReason
Returns the value of theunanalysableReasonrecord component.- Returns:
- the value of the
unanalysableReasonrecord component
-