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

Add variable_names_mapping to APRProof, counterexample generation #4574

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

palinatolmach
Copy link
Contributor

@palinatolmach palinatolmach commented Aug 6, 2024

Related to runtimeverification/kontrol#747.

This PR adds an additional field variable_name_mapping to APRProof. The field is supposed to store a dictionary that is generated during kontrol build, which stores a mapping between the K representation (VV0_from_114b9705) and original (from) function input names. This mapping is needed to translate variable names back from a K representation during model/counterexample generation.

Generally, we only need it when computing proof.failure_info, but I couldn't find a better way to propagate this mapping info there, other than adding it to APRProof. The dictionary only contains several globally accessible variables (block.timestamp, etc.) and inputs to the specific proof, so it shouldn't take up much space when serialized.

A mapping that will be generated in Kontrol looks like this:

    "VV0_owner_114b9705": "owner",
    "VV1_spender_114b9705": "spender"
    ...

@ehildenb
Copy link
Member

This seems too specific to store in APRProof, could it instead be stored in the Foundry object in Kontrol directly?

@palinatolmach palinatolmach marked this pull request as draft August 29, 2024 11:57
@palinatolmach
Copy link
Contributor Author

As suggested by @ehildenb, the better approach would be to allow semantics to customize failure info and counterexample printing, in a manner similar to node printing:

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 this pull request may close these issues.

3 participants