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

How to count implementation lines written in Vale? #41

Open
zpzigi opened this issue Nov 2, 2019 · 2 comments
Open

How to count implementation lines written in Vale? #41

zpzigi opened this issue Nov 2, 2019 · 2 comments

Comments

@zpzigi
Copy link

zpzigi commented Nov 2, 2019

In Vale's paper, implementation lines which consist of assembly instructions and control-flow code are calculated.
I've been building a system with Vale/Dafny and I am not sure how to calculate implementation lines.

For Dafny, dafny-line-count.py in IronFleet helps to calculate Spec and Proof lines.
Is there any similar script or tool for calculating implementation lines written in Vale?

Regards,

@Chris-Hawblitzel
Copy link
Member

I don't know of any scripts, but there are some Vale command-line options that the paper relied on. The -reprint <...filename...> option pretty-prints a copy of the program, discarding comments and extra blank lines. Various other options, like -reprintSpecs=false, -reprintGhostDecls=false, -reprintGhostStmts=false, -reprintLoopInvs=false, and -reprintVerbatims=false omit proof-related code from the pretty-printed copy. Comparing the line count of the pretty-printed versions with and without some of these options can tell you the implementation and proof size. This is similar to the /rprint and /printMode:NoGhost options used by dafny-line-count.py.

We kept the trusted specifications in separate files for the purpose of measuring the "Spec" size. This is similar to the is_spec in dafny-line-count.py, which looks for specification files based on a filename convention.

@Chris-Hawblitzel
Copy link
Member

Also, you might want to set -typecheck=false when reprinting. The typechecker, which was added after the original Vale paper, adds some clutter when elaborating names and expressions.

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

No branches or pull requests

2 participants