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

Format Inference doesn't respect literals #467

Open
willow-ahrens opened this issue Mar 14, 2024 · 0 comments
Open

Format Inference doesn't respect literals #467

willow-ahrens opened this issue Mar 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@willow-ahrens
Copy link
Owner

willow-ahrens commented Mar 14, 2024

Literals aren't treated as literals in format inference, so we can't evaluate certain cases where the default would be clear. For example, A + 1 will densify. This was discovered in #465 (comment). Though that case could be resolved by adding the some rules to Finch about /, we might also want to consider how to get the format inference trait system to understand literals better. It's also unclear whether we should interpret A + 1 as a program that adds the literal 1 to A, or a program that adds an unspecified integer value to A.

        (@rule call(/, ~a, ~b::isliteral) => if iszero(b.val) Inf end),
        (@rule call(\, ~a::isliteral, ~b) => if iszero(a.val) Inf end),
@willow-ahrens willow-ahrens added the enhancement New feature or request label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant