engineeringsoftware / roosterize Goto Github PK
View Code? Open in Web Editor NEWTool for suggesting lemma names in Coq verification projects
License: MIT License
Tool for suggesting lemma names in Coq verification projects
License: MIT License
Right now, when Roosterize suggests lemma names for a complete project, that project has to be built first (usually using make
in it root directory). However, it would be more intuitive to pass a build command to Roosterize than build the project separately.
For example, one could introduce a buildcmd
command-line option, used as follows:
python -m roosterize.main suggest_lemmas \
--project=../StructTact \
--serapi-options="-Q theories,StructTact" \
--model-dir=./models/roosterize-ta \
--output=./output \
--buildcmd "./configure && make -j2"
I get this when I try to get suggestions for the file wmso.v in the RegLang project:
$ python -m roosterize.main suggest_lemmas --project=../reglang --serapi-options="-Q theories,RegLang" --model-dir=./models/roosterize-ta --output=./output
>>>>> Extracting lemmas ...
[ 371W]roosterize.data.DataMiner: /home/palmskog/src/coq/misc/roosterize/output/raw-data already exists, will overwrite the files.
100%|...| 12/12 [01:04<00:00, 6.03s/it]
100%|...| 12/12 [00:14<00:00, 1.24s/it]
>>>>> Initializing model ...
[ 80674W]roosterize.ml.naming.OpenNMTMultiSourceForNaming: Cuda is not available
>>>>> Processing data ...
>>>>> Applying model ...
/home/palmskog/opt/miniconda3/envs/pytorch/lib/python3.7/site-packages/seutil/project/../../torchtext/data/field.py:359: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
var = torch.tensor(arr, dtype=self.dtype, device=device)
Traceback (most recent call last):
File "/home/palmskog/opt/miniconda3/envs/pytorch/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/palmskog/opt/miniconda3/envs/pytorch/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/palmskog/src/coq/misc/roosterize/roosterize/main.py", line 250, in <module>
CliUtils.main(sys.argv[1:], globals(), normalize_options)
File "/home/palmskog/opt/miniconda3/envs/pytorch/lib/python3.7/site-packages/seutil/CliUtils.py", line 117, in main
actions[action](**options)
File "/home/palmskog/src/coq/misc/roosterize/roosterize/main.py", line 141, in suggest_lemmas
model.eval(output_dir/"eval-processed-data", model_dir, output_dir/"eval-result")
File "/home/palmskog/src/coq/misc/roosterize/roosterize/ml/naming/NamingModelBase.py", line 100, in eval
predictions_results: List[List[Tuple[str, float]]] = self.eval_impl(processed_data_dir, model_dir, self.BEAM_SEARCH_SIZE, self.K)
File "/home/palmskog/src/coq/misc/roosterize/roosterize/ml/naming/OpenNMTMultiSourceForNaming.py", line 835, in eval_impl
attn_debug=opt.attn_debug
File "/home/palmskog/src/coq/misc/roosterize/roosterize/ml/onmt/MultiSourceTranslator.py", line 194, in translate
translations = xlation_builder.from_batch(batch_data)
File "/home/palmskog/src/coq/misc/roosterize/roosterize/ml/onmt/MultiSourceTranslationBuilder.py", line 90, in from_batch
for n in range(self.n_best)]
File "/home/palmskog/src/coq/misc/roosterize/roosterize/ml/onmt/MultiSourceTranslationBuilder.py", line 90, in <listcomp>
for n in range(self.n_best)]
File "/home/palmskog/src/coq/misc/roosterize/roosterize/ml/onmt/MultiSourceTranslationBuilder.py", line 31, in _build_target_tokens
tokens.append(src_vocab.itos[tok - len(vocab)])
IndexError: list index out of range
hello! I am really interested in the "tree chopping" methods mentioned in your paper. However I know very little about the internal data structures of Coq, I wonder is there any documentation easy to read about this?
for example, when I use coq_serapi to input :
forall xyz:nat, xyz<3
I got output:
(Prod (Name (Id xyz)) (Ind (((Mutind (MPfile (DirPath ((Id Datatypes) (Id Init) (Id Coq)))) (DirPath ()) (Id nat)) 0) (Instance ()))) (App (Const ((Constant (MPfile (DirPath ((Id Peano) (Id Init) (Id Coq)))) (DirPath ()) (Id lt)) (Instance ()))) ((Rel 1) (App (Construct ((((Mutind (MPfile (DirPath ((Id Datatypes) (Id Init) (Id Coq)))) (DirPath ()) (Id nat)) 0) 2) (Instance ()))) ((App (Construct ((((Mutind (MPfile (DirPath ((Id Datatypes) (Id Init) (Id Coq)))) (DirPath ()) (Id nat)) 0) 2) (Instance ()))) ((App (Construct ((((Mutind (MPfile (DirPath ((Id Datatypes) (Id Init) (Id Coq)))) (DirPath ()) (Id nat)) 0) 2) (Instance ()))) ((Construct ((((Mutind (MPfile (DirPath ((Id Datatypes) (Id Init) (Id Coq)))) (DirPath ()) (Id nat)) 0) 1) (Instance ()))))))))))))
This looks so terrifying! I really wonder about the meanings of Mutind, MPfile and Rel blablabla....
So I can better understand what parts of the kernel tree is important for information extraction.
looking forward to your reply, thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.