Record Class ConstructVerdict
java.lang.Object
java.lang.Record
org.ek9lang.compiler.symbolic.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)
public record ConstructVerdict(String constructFqn, boolean verified, List<ConstructVerdict.Counterexample> counterexamples, List<ConstructVerdict.DeadBranch> deadBranches)
extends Record
The result of running the Symbolic/Contract engine (
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 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).
-
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. -
Constructor Summary
ConstructorsConstructorDescriptionConstructVerdict(String constructFqn, boolean verified, List<ConstructVerdict.Counterexample> counterexamples, List<ConstructVerdict.DeadBranch> deadBranches) Creates an instance of aConstructVerdictrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.final StringtoString()Returns a string representation of this record class.booleanverified()Returns the value of theverifiedrecord component.
-
Constructor Details
-
ConstructVerdict
public ConstructVerdict(String constructFqn, boolean verified, List<ConstructVerdict.Counterexample> counterexamples, List<ConstructVerdict.DeadBranch> deadBranches) Creates an instance of aConstructVerdictrecord class.- Parameters:
constructFqn- the value for theconstructFqnrecord componentverified- the value for theverifiedrecord componentcounterexamples- the value for thecounterexamplesrecord componentdeadBranches- the value for thedeadBranchesrecord component
-
-
Method Details
-
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
-