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

Flag that lists functions to inline #60

Closed
fortunac opened this issue Aug 20, 2019 · 1 comment
Closed

Flag that lists functions to inline #60

fortunac opened this issue Aug 20, 2019 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers WP Involves the Weakest Precondition computation

Comments

@fortunac
Copy link

fortunac commented Aug 20, 2019

Currently, the inline flag (--wp-inline) will inline all of the function calls. We should have a flag that lists which functions we want to inline, ex: --wp-inline-funcs=food,bar,baz.

When the inline flag is set, the wp plugin creates an inline_env which passes in spec_inline as the default function spec: https://github.com/draperlaboratory/cbat_tools/blob/master/wp/lib/bap_wp/src/precondition.ml#L464-L475

When the environment is created, it initializes a handler for each sub in the program. If the subroutine doesn't match the prerequisites for spec_verifier_error, spec_verifier_assume, or spec_verifier_nondet, it will be mapped to spec_inline as seen in https://github.com/draperlaboratory/cbat_tools/blob/master/wp/lib/bap_wp/src/environment.ml#L114-L122

At this point, we can specify exactly which functions we want to be inlined and map other specs to the remaining functions.

BAP flags can be set in the wp.ml plugin file: https://github.com/draperlaboratory/cbat_tools/blob/master/wp/plugin/wp.ml#L142-L161

@fortunac fortunac added enhancement New feature or request good first issue Good for newcomers WP Involves the Weakest Precondition computation labels Aug 20, 2019
@fortunac
Copy link
Author

Handled in #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers WP Involves the Weakest Precondition computation
Projects
None yet
Development

No branches or pull requests

1 participant