Skip to content

[hls-fuzzer] Add termination type system#1007

Open
zero9178 wants to merge 2 commits into
mainfrom
users/zero9178/disallow-write-iter-variable-typesystem
Open

[hls-fuzzer] Add termination type system#1007
zero9178 wants to merge 2 commits into
mainfrom
users/zero9178/disallow-write-iter-variable-typesystem

Conversation

@zero9178

Copy link
Copy Markdown
Collaborator

A common choice in (currently all) targets is to only generate terminating programs. This requires a few tricks especially in handling for loops such as limiting ranges and also limiting loop variable assignments.

This PR therefore introduces a new TerminationTypeSystem that can just be combined into any other type system to generate terminating programs. Internally it reuses the bitwidth type system for limiting the ranges of the iter, start and end values of a structured-for loop (as was previously done manually in random-c and the bitwidth type system, but is now reused) and additionally blocks the iter variables of a for loop from ever being assigned to.

Alternative to #990

A common choice in (currently all) targets is to only generate terminating programs. This requires a few tricks especially in handling for loops such as limiting ranges and also limiting loop variable assignments.

This PR therefore introduces a new `TerminationTypeSystem` that can just be combined into any other type system to generate terminating programs.
Internally it reuses the bitwidth type system for limiting the ranges of the iter, start and end values of a structured-for loop (as was previously done manually in random-c and the bitwidth type system, but is now reused) and additionally blocks the iter variables of a for loop from ever being assigned to.
@zero9178
zero9178 requested a review from Jiahui17 July 13, 2026 15:06
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.

1 participant