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

[P4Testgen] Fix stringliteral conversion. Value must be a literal, NOT a constant #4298

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

fruffy
Copy link
Collaborator

@fruffy fruffy commented Dec 18, 2023

Quite the subtle issue I ran into. In the Z3 solver, string_constants are not constants but functions. We need to assign a value instead to get the correct semantic behavior. Otherwise, the solver can freely assign a value to the function.

@fruffy fruffy added the p4tools Topics related to the P4Tools back end label Dec 18, 2023
@fruffy fruffy requested review from jnfoster and vlstill December 18, 2023 11:41
Copy link
Contributor

@vlstill vlstill left a comment

Choose a reason for hiding this comment

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

I agree with the change, good catch. I just have a question about the tests.

@fruffy fruffy force-pushed the fruffy/stringliteral_hotfix branch from b324f96 to a4f320b Compare December 19, 2023 08:27
@fruffy fruffy force-pushed the fruffy/stringliteral_hotfix branch from a4f320b to b1130c2 Compare December 19, 2023 09:38
@fruffy fruffy merged commit 7b84f38 into main Dec 19, 2023
12 checks passed
@fruffy fruffy deleted the fruffy/stringliteral_hotfix branch December 19, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4tools Topics related to the P4Tools back end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants