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

Configuration blocks in spthy files and a new default oraclename #512

Merged
merged 7 commits into from Feb 9, 2024

Conversation

yavivanov
Copy link
Contributor

Hi!

This PR introduces two new features.

  1. Configuration blocks in spthy files. It adapts the approach from PR Request for comments: configuration within spthy #220 to the newest Tamarin version and, in particular, the refactored Parser and the new TheoryLoader. The parsing approach itself is due to @kelnage. I implemented the configuration block as a new TheoryItem, so that it fits better with all other parts of a theory (e.g. this eases printing it).

  2. The default oraclename is changed to theory_filename.oracle. This is achieved by saving the filename of the theory in a field of the parsed theory. In this way, it can be used later to create the default oraclename (if the default oracle is needed).

The PR also adds two new regression tests (one for each feature).
I added them to the Makefile and the python script. Note that I added them to the fast examples (because they only need a fraction of a second each). The configuration block test is, additionally, a part of the feature tests.

Of course, the PR passes the regression tests.

Co-authored-by: Nick Moore <nicholas.moore@cs.ox.ac.uk>
@cascremers
Copy link
Member

Thanks! Two questions:

Q: Would it be possible to break this PR into two? It seems there are two very different things going on.

Q: Does this mean that if a user has an oracle with the old name, and updates Tamarin to develop, their current setup stops working?
If this is the case, I think it would be preferable from a user's perspective to check for the old name too, and use that as a fallback (possibly with a warning), otherwise we will probably get a lot of questions on the mailing list, and possibly waste users' time.

@yavivanov
Copy link
Contributor Author

Hi,

Thanks! Two questions:

Q: Would it be possible to break this PR into two? It seems there are two very different things going on.

Q1: Yes. The two ideas are disjoint, and so is their code.

Q: Does this mean that if a user has an oracle with the old name, and updates Tamarin to develop, their current setup stops working? If this is the case, I think it would be preferable from a user's perspective to check for the old name too, and use that as a fallback (possibly with a warning), otherwise we will probably get a lot of questions on the mailing list, and possibly waste users' time.

Q2: It only affects users that rely on the default oraclename being "oracle" (the old default).
The following scenario captures these cases:
We have an author that wrote a theory (example.spthy). They named the oracle for it "oracle". Let's say that the author relies on the default oraclename being "oracle".
They have set the global theory heuristic or some lemma heuristic to "o" without specifying an oraclename. They also don't specify an oraclename in the command line.
Thus, as no oraclename was specified, Tamarin would default to "example.oracle" when proving "example.spthy" (instead of "oracle" as it does now). So, it would raise a "non-existent file or directory" error.
I did not find occurrences of these cases in the example collection.

But "oracle" was the default oraclename for a long time, so a form of backward compatibility makes sense.

@rkunnema
Copy link
Member

Q: Would it be possible to break this PR into two? It seems there are two very different things going on.
Q1: Yes. The two ideas are disjoint, and so is their code.

Well, there is a connection and I think a good reason for the two to be in the same PR. The goal of this PR is to transfer the information about how to properly call the theory into the .spthy file. Currently, this information in the Makefile (or sometimes in external READMEs, depending). We want to simplify benchmarks in the future.

Doing this raises the question how to specify which oracle script to use. We discussed the security implications of letting the .spthy file invoking script in the original PR. Here's a link to the last comment in the thread.

#220 (comment)

Q2: Does this mean that if a user has an oracle with the old name, and updates Tamarin to develop, their current setup stops working?

This is for setups outside our repository, right? Yes, I think falling back to oracle and giving a warning is the right way of dealing with this. @yavivanov would this feature be hard to add?

@yavivanov
Copy link
Contributor Author

This is for setups outside our repository, right? Yes, I think falling back to oracle and giving a warning is the right way of dealing with this. @yavivanov would this feature be hard to add?

I think that it is easy to implement. It's just one additional "does the file exist?" check, and this is easily done in Haskell.

@rkunnema
Copy link
Member

Awesome, feel free to go ahead with that, then.

@cascremers
Copy link
Member

cascremers commented Nov 29, 2022 via email

- adapted heuristic code to the tactic code
- added backup default oracle code
- improved the default oraclename code
- adapted the terminal and Web client outputs
- fixed bugs w.r.t. oracle name workdir and printed output
@rkunnema
Copy link
Member

1832c1c adds the backward requested compatability feature. The checks pass. @kevinmorio will write the documentation in the manual. Once that PR is ready, I will hit merge on both. (So let me know if you have objections.)

@jdreier
Copy link
Member

jdreier commented Sep 21, 2023

Would it be possible to also adapt regressionTest.py to make sure it also compares the configuration block?

kevinmorio added a commit to kevinmorio/manual that referenced this pull request Oct 19, 2023
@kevinmorio
Copy link
Contributor

The PR for the manual: tamarin-prover/manual#118.

@rkunnema
Copy link
Member

@yavivanov my quick and dirty merge failed, I will need your help there.

@yavivanov
Copy link
Contributor Author

@yavivanov my quick and dirty merge failed, I will need your help there.

I'm looking into it 👍🏻

@yavivanov
Copy link
Contributor Author

@yavivanov my quick and dirty merge failed, I will need your help there.

The above commit fixes the errors.

@rkunnema
Copy link
Member

rkunnema commented Feb 7, 2024

Thanks @yavivanov ! I think we are good to merge now. I'll wait until end of the week in case somebody has another request.

@rkunnema rkunnema merged commit 662a857 into tamarin-prover:develop Feb 9, 2024
1 check passed
Lelio-Brun pushed a commit to zt-iot/tamarin-prover that referenced this pull request Apr 18, 2024
…arin-prover#512)

* support for config blocks + new default oraclename

Co-authored-by: Nick Moore <nicholas.moore@cs.ox.ac.uk>

* set backup default oracle to ./oracle

- adapted heuristic code to the tactic code
- added backup default oracle code
- improved the default oraclename code
- adapted the terminal and Web client outputs
- fixed bugs w.r.t. oracle name workdir and printed output

* added configblock comparison to regressionTests.py

* fixed errors resulting from the merge

---------

Co-authored-by: Nick Moore <nicholas.moore@cs.ox.ac.uk>
Co-authored-by: rkunnema <robert.kuennemann@cispa.de>
kevinmorio added a commit to kevinmorio/manual that referenced this pull request May 8, 2024
cascremers pushed a commit to cascremers/tamarin-prover that referenced this pull request May 15, 2024
This updates the syntax in reference to tamarin-prover#512.
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

Successfully merging this pull request may close these issues.

None yet

5 participants