Class SymbolicPathConditionWalker
SymbolicTermValue
terms, reads the relational facts off its require/if nodes into a PathCondition,
and reports a branch dead when its accumulated facts are unsatisfiable.
This discharges the "guarded by a contradiction" obligation class end-to-end from source — e.g.
Example 6: require lo <= hi then if lo > hi yields {lo<=hi, lo>hi}, which is
unsatisfiable, so the if body is unreachable for every input.
It reuses the compiler's own relational-extraction SSOTs rather than re-deriving grammar walking:
operator+operands come off the relational EK9Parser.ExpressionContext the same way
SelfComparisonOrError reads them, the if control expression is located the way
IfStatementOrError does (ifControlBlock().get(0).preFlowAndControl().control), and the
require expression is the relational expression directly (RequireStatementContext
.expression()), as RequireStatementOrError treats it.
Proven and perturbation-verified by spike S3c (see EK9_SYMBOLIC_SCANNER_SPIKE_REFERENCE.md
§4.4). Residual hardening tracked for later slices: key terms by symbol identity (not name) for
shadowing/locals; resolve operands beyond bare identifiers; fold this into the phase-5 flow listener
with a PathCondition snapshot stack pushed/popped on the analyzer's existing branch hooks
(rather than a standalone AST walk); handle multiple require/if nodes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe base (pre-branch) path condition and the verdict for the function'sifbranch.static final recordWhether a branch is dead (unreachable for every input), and why. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanalyse(FunctionSymbol function) Analyse one function: seed params as terms, accumulate therequirefact, then test theifbranch's fact-set for unsatisfiability.
-
Constructor Details
-
SymbolicPathConditionWalker
-
-
Method Details
-
analyse
Analyse one function: seed params as terms, accumulate therequirefact, then test theifbranch's fact-set for unsatisfiability.- Parameters:
function- the resolved function symbol to analyse- Returns:
- the base condition + the
if-branch verdict (ifBranchis null if there is noif)
-