Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prune unreachable transitions from HOA and synthesized code #61

Open
ravenrothkopf opened this issue Nov 17, 2023 · 0 comments
Open

prune unreachable transitions from HOA and synthesized code #61

ravenrothkopf opened this issue Nov 17, 2023 · 0 comments
Assignees

Comments

@ravenrothkopf
Copy link
Member

Sometimes TSL synthesizes code that contains unreachable transitions. We can prune these to drastically improve code readability for larger specs!

For example, take this generated state written in JavaScript:

if (currentState === 0) {
  if (!x && !y) {
    w = w
    currentState = 1
  }
  else if (!x && y) {
    w = w
    currentState = 1
  }
  else if (!x && y) {
    w = z
    currentState = 1
  }
  else if (x && y) {
    currentState = 2
  }
}

The body of the second else if (!x && y) will never be executed, so we can prune that code. This should be done at the HOA level before code gen.

@ravenrothkopf ravenrothkopf self-assigned this Nov 17, 2023
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

No branches or pull requests

1 participant