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

Symbolic{Bool} and simplification #67

Closed
shashi opened this issue May 6, 2020 · 0 comments · Fixed by #75
Closed

Symbolic{Bool} and simplification #67

shashi opened this issue May 6, 2020 · 0 comments · Fixed by #75

Comments

@shashi
Copy link
Member

shashi commented May 6, 2020

Allow symbolic conditions in rules:

@rule abs(~x) => ~x >= 0 ? ~x : -~x
# In a Bool ruleset:
@rule ~x >= 0 => isnonnegative(~x, @CTX) # isnonnegative returns Union{Bool, Nothing}

This should be lowered such that if the truth value of ~x >= 0 cannot be ascertained, then it would leave the input expression unchanged.

We can potentially allow expressions with if conditions. Maybe just by adding an ifelse method.

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 a pull request may close this issue.

1 participant