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

Provide better documentation for concrete and symbolic attributes #3324

Merged
merged 6 commits into from
Apr 14, 2023

Conversation

ana-pantilie
Copy link
Contributor

docs/user_manual.md Outdated Show resolved Hide resolved
@radumereuta
Copy link
Contributor

@virgil-serbanuta I'm tagging you for review since you are the one that encountered the issue.

@ana-pantilie ana-pantilie marked this pull request as draft April 12, 2023 11:34
docs/user_manual.md Outdated Show resolved Hide resolved
@ana-pantilie ana-pantilie marked this pull request as ready for review April 13, 2023 09:34
@ana-pantilie
Copy link
Contributor Author

Thanks @radumereuta , I should have taken a better look at Virgil's example and at the actual code! I can confirm it's as you understood, so this is ready for re-review. Also @virgil-serbanuta please review to make sure I didn't get it wrong again :).

Copy link
Contributor

@radumereuta radumereuta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you put both concrete and symbolic on the same rule?
I would expect it to be an error.
What if you give them arguments and only half of the variables are concrete and the other half are symbolic. Then I would expect that to work.
Does that make sense? Does the backend support such a behavior?

@ana-pantilie
Copy link
Contributor Author

@radumereuta Hmm, good questions.

If you add symbolic and concrete at the same time the frontend catches it and emits an error:

[Error] Compiler: Rule cannot be both concrete and symbolic in the same
variable.
        Source(/home/ana/RV/haskell-backend/test/imp/imp.k)
        Location(223,8,223,29)
        223 |     rule X:Int +Int Y:Int => Y [simplification, symbolic, concrete]
            .          ^~~~~~~~~~~~~~~~~~~~~
[Error] Compiler: Had 1 structural errors.

The following, however, isn't caught by the frontend and I think it should be:

rule X:Int +Int Y:Int => Y [simplification, symbolic(X), concrete(X)]

The following works fine, as it should:

rule X:Int +Int Y:Int => Y [simplification, symbolic(X), concrete(Y)]

@ehildenb
Copy link
Member

ehildenb commented Apr 13, 2023

The rules for concrete and symbolic are different for axioms and for simplification rules.

@radumereuta
Copy link
Contributor

I've added a better error message for when a variable is used on both symbolic and concrete attributes.
@ana-pantilie can you please review that part? I'm going to approve it. Add automerge if everything looks good.

@rv-jenkins rv-jenkins merged commit 066a396 into develop Apr 14, 2023
@rv-jenkins rv-jenkins deleted the fix-symbolic-docs branch April 14, 2023 10:02
@virgil-serbanuta
Copy link
Contributor

Thank you!

Sorry for the late reply, I was on vacation, but this looks good!

@Baltoli Baltoli mentioned this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants