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

Errors when running test files on Linux #56

Open
mohitWrangler opened this issue Apr 8, 2023 · 2 comments
Open

Errors when running test files on Linux #56

mohitWrangler opened this issue Apr 8, 2023 · 2 comments

Comments

@mohitWrangler
Copy link

mohitWrangler commented Apr 8, 2023

I tested Vale with F* in Linux with the following command:

mono $HOME/vale-release-0.3.19/bin/vale.exe -fstarText -in common.vaf -out common.fst -outi common.fsti
fstar.exe --query_stats common.fst

I'm able to run it for common.vaf and forall.vaf but most of the instruction-specific files which include files like

include "../../../fstar/code/arch/x64/X64.Vale.InsBasic.vaf"
include{:fstar}{:open} "TestFStar"
include{:fstar}{:open} "FStar.Seq.Base"

are giving the following errors:

error at line 21 column 9 of file $HOME/hacl-star/vale/code/test/Vale.Test.X64.Memcpy.vaf:
cannot find id 'locs_disjoint'

error at line 18 column 14 of file $HOME/vale-0.3.19/tools/Vale/test/test.vaf:
cannot find type 'nat64'

error at line 41 column 5 of file $HOME/vale/tools/Vale/test/FTypeVale.vaf:
cannot find type 'byte'

I'm assuming these types have been defined in F* and somehow the compilation is not able to fetch these into the code.

Any help would be helpful.

@mohitWrangler mohitWrangler changed the title Can not find types errors Errors when running test files on Linux Apr 8, 2023
@Chris-Hawblitzel
Copy link
Member

Vale cannot read F* files directly, so the types have to be declared as Vale types in a Vale file. To help with this, we use the tool bin/importFStarTypes.exe to read in F* "dump" files and extract the F* types into Vale .vaf files. The SConstruct file contains examples of how to use this. It runs importFStarTypes.exe as follows: Command(types_vaf, dumps, f'{mono} {import_fstar_types_exe} {dumps_string} -out {types_vaf}'), where types_vaf is defined as types_vaf = f'{source_base}.types.vaf'. This puts the types into a new .vaf file with the suffix .types.vaf. Later, the SConstruct file adds these as extra include files using the -include {target}.types.vaf option to Vale.

@mohitWrangler
Copy link
Author

mohitWrangler commented Apr 17, 2023

After a long effort, I was able to run the SConstruct using scons. However, I had to copy the Fstar-master repo into the Vale/tools folder. Then running scons --FSTAR --FSTAR-MY-VERSION helped me see what you meant by import FStar types. Thank you for help.

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