Skip to content

Address missing dependency analysis check - #1537

Open
lorchrob wants to merge 2 commits into
kind2-mc:mainfrom
lorchrob:if-block-condition-dependencies
Open

lorchrob wants to merge 2 commits into
kind2-mc:mainfrom
lorchrob:if-block-condition-dependencies

Conversation

@lorchrob

Copy link
Copy Markdown
Contributor

No description provided.

@lorchrob
lorchrob marked this pull request as ready for review September 17, 2026 22:28
| FrameBlock (_, _, nes, nis) :: items ->
let* gs, lhss = mk_graph_node_items m items in
R.ok (union_dependency_analysis_data g gs, eqn_lhss eqn @ lhss)
| IfBlock (_, cond, nis1, nis2) :: items

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR adds the condition edges only to each node's own dependency graph, here in mk_graph_node_items. The node summary is built separately by mk_node_summary, which reads equations through LH.extract_node_equation, and that helper drops block conditions. So a node's summary never records that an output depends on the inputs its block condition reads, and a cycle that goes through a node call is still accepted.

Reproduction:

node M(x:int) returns (y:int); let if x > 0 then y = 0; else y = 1; fi tel
node N() returns (z:int); let z = M(z); check z >= 0; tel

Kind 2 accepts this and reports the property as valid (k=1). The interpreter then fails with "Transition relation not satisfiable". Writing M as y = if x > 0 then 0 else 1 is correctly rejected as a cyclic dependency.

Suggested fix: make mk_node_summary include the same condition edges, either through an equation extractor that keeps block conditions or by building the summary from what mk_graph_node_items produces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants