-
Notifications
You must be signed in to change notification settings - Fork 6
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
upgrade pattern matching #15
Comments
I was successfully able to rename all .coco files to .py and run them Having looked further into the code, it seems that the syntax_*.py files are not referenced in the testbuilder.py execution
Are the syntax_*.py files related to the automatic test generation process rather than the standard process I've been working on? If so is there a different way to test them? Aternatively, does it make more sense to merge my current work related to testbuilder.py, and move onto another issue for now? |
Dear James,
There is a whole bunch of python/coconut to do with tests for spin2test.*
They do not contribute to testbuilder at all.
This get triggered by the `coverage` target in the main file. So that can be ignored for now.
In what way is the python non-standard?
What errors occur in your IDE?
…--------------------------------------------------------------------
Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
***@***.***, Head of Software Foundations & Verification Research Group
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
http://www.scss.tcd.ie/Andrew.Butterfield/
--------------------------------------------------------------------
From: James Gooding Hunt ***@***.***>
Reply to: andrewbutterfield/RTEMS-SMP-Formal ***@***.***>
Date: Sunday 12 February 2023 at 19:52
To: andrewbutterfield/RTEMS-SMP-Formal ***@***.***>
Cc: ***@***.***" ***@***.***>, Author ***@***.***>
Subject: Re: [andrewbutterfield/RTEMS-SMP-Formal] upgrade pattern matching (Issue #15)
I was successfully able to rename all .coco files to .py and run them
This produced identical output and test files
However, it still does not appear to be standard python, and many errors appear in my IDE.
Having looked further into the code, it seems that the syntax_*.py files are not referenced in the testbuilder.py execution
The below output shows all files containing references to those alongside the relevant lines
grep -r -e "import.*testgen\|testgen.*py\|testgen.*coco" *
Makefile: coverage run --branch -m pytest --capture=tee-sys -vv -s $(DIR_TESTS)/test_coverage_testgen.py $(DIR_TESTS)/test_coverage_spin2test.py
examples/draft/make.sh:coconut --target 3 testgen.coco --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition
examples/draft/make.sh:exec python3 "$HOME0/testgen.py" "$@"
src/tests/library.coco:from src import testgen
src/tests/library.py:from src import testgen
src/tests/test_coverage_testgen.coco:from src import testgen
src/tests/test_coverage_testgen.coco: testgen.copy_i fic1.name fic1.name
src/tests/test_coverage_testgen.coco: testgen.copy_i fic1.name fic2.name
src/tests/test_coverage_testgen.coco: testgen.copy_i (fic1.name, fic2)
src/tests/test_coverage_testgen.coco: testgen.copy_i (fic1.name, fic2)
src/tests/test_coverage_testgen.coco: testgen.copy_i (dir_test, fic2)
src/tests/test_coverage_testgen.py:from src import testgen
src/tests/test_coverage_testgen.py: testgen.copy_i(fic1.name, fic1.name)
src/tests/test_coverage_testgen.py: testgen.copy_i(fic1.name, fic2.name)
src/tests/test_coverage_testgen.py: testgen.copy_i(fic1.name, fic2)
src/tests/test_coverage_testgen.py: testgen.copy_i(fic1.name, fic2)
src/tests/test_coverage_testgen.py: testgen.copy_i(dir_test, fic2)
testgen_ml.coco:import src.testgen
testgen_ml.py:import src.testgen
testgen_ml.sh:exec python3 "$HOME0/testgen_ml.py" "$@"
testgen_ml_spin.sh:exec python3 "$HOME0/testgen_ml.py" "$HOME0/../examples/model_checker/spin.pml" "$@"
testgen_yaml.coco:import src.testgen
testgen_yaml.py:import src.testgen
testgen_yaml.sh:exec python3 "$HOME0/testgen_yaml.py" "$@"
testgen_yaml_spin.sh:exec python3 "$HOME0/testgen_yaml.py" "$HOME0/../examples/model_checker/spin.pml" "$@"
Are the syntax_*.py files related to the automatic test generation process rather than the standard process I've been working on?
If so is there a different way to test them?
Aternatively, does it make more sense to merge my current work related to testbuilder.py, and move onto another issue for now?
—
Reply to this email directly, view it on GitHub<#15 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAEPT54R6SKQYJRCQUXWEX3WXE5PVANCNFSM6AAAAAAT5ZCLFE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
There is use of coconut syntax in areas outside that match, add_pattern format that was seen in previous files. Something like the following in syntax_yaml.coco line 79 is the most common.
from coco docs: https://coconut.readthedocs.io/en/latest/DOCS.html#match
In standard python this would become
There are multiple cases of missing brackets which get put in place by coconut:
compared to
Other examples include syntax_yaml.coco line 91
which is an unusual (I presume coconut) syntax for lambda functions
There are also examples of coconut
Rather than python
And the following from syntax_yaml.coco line 171:
Which converts to:
As far as I can tell in native python it would be something like:
Some significant refactoring needs to happen, as its unclear to me what is happening in lines like that While I'm happy to translate from coconut to native python, I wouldn't be confident to push changes without a meaningful way to test the changes. |
A lot of this seems to be the code that reads in config data from comments in PML files. This comes in under issue #16 . The approach might be see which scripts call which here - get a picture of the structure. We'll discuss this at the meeting |
Fix .gitignores so relevant py files are tracked |
Pattern matching updated. As remaining Coconut has more to do with #16, we can close this now. |
Want to get away from Coconut, use p.m. in 3.10+
The text was updated successfully, but these errors were encountered: