Skip to content

nft/composition(fix): Skip recomputing synchronization types#673

Merged
Adda0 merged 1 commit into
masterfrom
fix-sync-types
Jul 2, 2026
Merged

nft/composition(fix): Skip recomputing synchronization types#673
Adda0 merged 1 commit into
masterfrom
fix-sync-types

Conversation

@Adda0

@Adda0 Adda0 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Skips recomputing synchronisation types of targets of transitions from states already computed.

Fixes #670. Fixes VeriFIT/z3-noodler#398.

@Adda0 Adda0 requested a review from koniksedy July 1, 2026 09:48
@Adda0

Adda0 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

@koniksedy Does this make sense? There are two transitions over symbols that cause get_synchronization_types() to push the state 6 onto the stack twice. The first time it is popped, its successors are computed; the second time it is popped from the stack, it tries to compute the successors again.

"q0 48 q5\n"
"q0 49 q5\n"

I am, however, not sure how it could have ever worked before.

@koniksedy

Copy link
Copy Markdown
Collaborator

I definitely agree that this is a bug.

The proposed fix will work, but we should probably avoid pushing the same state onto the stack in the first place. I'm not sure whether that can be checked efficiently when pushing.

As for the question, "How could it ever work?": we probably hadn't worked with transducers where a state had multiple transitions to the same target. Also, the root state is pushed onto the stack only once, regardless of the number of outgoing transitions, which likely masked this issue.

@koniksedy

Copy link
Copy Markdown
Collaborator

I looked into it again, and I don't think it's worth carrying additional information about whether a state is already on the stack. Skipping states that appear on the stack multiple times is the appropriate fix. It just needs a comment explaining why this is necessary.

@Adda0

Adda0 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Then we could merge this now and later consider an optimisation that properly fixes the root cause, not just mitigates the symptoms.

@Adda0

Adda0 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Ah, OK. Wilco.

…omputed states

Skip recomputing synchronization types of targets of transitions from states already computed.
@Adda0 Adda0 force-pushed the fix-sync-types branch from 0df9e35 to 284fca6 Compare July 2, 2026 13:58
@Adda0 Adda0 merged commit 136af2b into master Jul 2, 2026
17 checks passed
@Adda0 Adda0 deleted the fix-sync-types branch July 2, 2026 14:08
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.

Assertion failure in MATA NFT composition with str.replace_re over re.range [Bug]: Assert failure in NFT compose

2 participants