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

[aeneas] Preserve variable names #3560

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

zhassan-aws
Copy link
Contributor

@zhassan-aws zhassan-aws commented Oct 1, 2024

In #3514, the LLBC does not keep the variable names from the Rust source. This PR extracts the names of variables from MIR and carries it over to the LLBC.

For instance, for tests/expected/llbc/basic1 which has the following Rust:

fn select(s: bool, x: i32, y: i32) -> i32 {
    if s { x } else { y }
}

without this PR, running Aeneas on the output LLBC produces:

def select (b : Bool) (i : I32) (i1 : I32) : Result I32 :=
  if b
  then Result.ok i
  else Result.ok i1

but with this PR, it produces:

def select (s : Bool) (x : I32) (y : I32) : Result I32 :=
  if s
  then Result.ok x
  else Result.ok y

This should not be merged before #3514, so keeping it as a draft for the time being.

The actual diff on top of #3514 can be viewed here: zhassan-aws/kani@llbc4...zhassan-aws:kani:llbc-names

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant