-
Notifications
You must be signed in to change notification settings - Fork 7
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
Issue 31: Added SPOT 2.X wrapper #82
Conversation
Mapping files have updated the previous class/function calls to reside in texada namespace instead of spot since these calls may be defunct in SPOT 2.X
Cannot use SPOT namespace with current object calls so we use the texada namespace and use the mappings created for Texada
Wow, thank you so much for the contribution! Let me have a look at the changes and in particular the failing tests --- I should be able to get to this sometime next week. |
@@ -980,6 +980,8 @@ map<int, statistic> prefix_tree_checker::not_map(map<int, statistic> map) { | |||
*/ | |||
void prefix_tree_checker::add_satisfying_values(map<int, statistic>& returned_vals, | |||
bool to_satisfy, map<int, statistic>& map_to_return, set<int>& to_check) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this extra whitespace.
@@ -336,9 +338,9 @@ int main(int ac, char* av[]) { | |||
outFile << ", "; | |||
print_json(outFile, *it, opts_map.count("print-stats")); | |||
} else { | |||
const spot::ltl::formula * valid_form = texada::instantiate( | |||
const ltl::formula * valid_form = texada::instantiate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're using namespace texada, why do we need texada::instantiate rather than just instantiate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true, we can use just instantiate.
@@ -68,15 +67,15 @@ TEST(ConstInstantsPoolTest,UsableByLinearChecker) { | |||
ASSERT_EQ(l_valid_instants.at(0).first.at("a"), "a"); | |||
ASSERT_EQ(l_valid_instants.at(0).first.at("c"), "c"); | |||
|
|||
f->destroy(); | |||
//f->destroy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is f->destroy removed in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPOT 2.X does not use the destroy function externally like this anymore, a lot of the destruction of formula classes is done internally. In this test, the instantiated_prop_type used in 'valid_instants_on_traces' instantiated the formula by recusing on the formula. In this case, when creating the visitor this is just returning the pointer to the formula so when destroy is called in the function it is also destroying the original formula.
@@ -9,8 +9,7 @@ | |||
#include "../src/main/opts.h" | |||
#include "../src/checkers/statistic.h" | |||
#include <gtest/gtest.h> | |||
#include <ltlvisit/tostring.hh> | |||
#include <ltlparse/public.hh> | |||
#include "../src/instantiation-tools/texadatospotmapping.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this import necessary? It doesn't look like this is used anywhere.
(left a few minor comments above, hoping to tackle the core of the review tomorrow) |
Thanks again for the contribution :). I looked at the overall changes. The PR works great overall, I got everything running against the latest version of SPOT! Two main things remain:
This leaves us with 2 options:
What do you think? If 2., I will open a new SPOT 2.X support branch, and you can create a PR that targets that branch. I can help fix some of the formatting issues there. |
I am happy with option 2 both for myself and users who do not plan to use Texada for commercial use. I think it is good to think about for future contributions. If it were possible to iterate on the wrapper by moving the copied code to make an independent library and then have Texada depend on it seperately would this address the licencing issue? This would effectively have Texada depend on both SPOT and this "SPOT adjacent" library. I am not sure how easy it is to do though.. |
Sorry I'm being so slow on this! So, I just made a new spot-2.x support branch. I think a few changes are needed before merging there:
I've done most of 2. and just need to check that everything builds, but if I'm taking too long just ping me here. After all that is done merge and close the PR, and I'll update the main README.md to point to this branch. I don't think we should make another independent library that Texada depends on at this point. First I want to see how much of the copied code can be removed. I think we might be able to get rid of most of it:
I think other than that, the primary borrowings from spot are the visitor pattern --- like the postfix visitor and clone visitor, correct? Code similarity is I think inevitable for such a standard pattern, and I think we should be able to simplify things to not need both the clone visitor and postfix visitor --- at that point the code will probably be fresh enough to not have these duplications issues. Is there anything else major I'm missing? If you want to tackle some of these things, we can iterate on it (and I'll make the thoughts I outlined above more precise), but I figure we might as well incorporate your contribution now so that other users can take advantage of it. The refformula/ memory management stuff in particular seems like it could get hairy. What do you think? |
Merged, thanks again for all the hard work adding this support :) |
Thank you for the quick responses! Sorry I've been so behind on catching up to these messages..I'm glad the additions I made were useful. If I have time in a month or so I'd be happy to put a little more effort into addressing the main branch licencing issues. Thanks again! |
#31
Hi, I've managed to create the wrapper for SPOT 2.X in order to enhance compatibility with Texada. Could you take a look and let me know if you have any questions/comments? I also ran
./texadatest
with the following output:[----------] Global test environment tear-down
[==========] 63 tests from 13 test suites ran. (6218 ms total)
[ PASSED ] 61 tests.
[ FAILED ] 2 tests, listed below:
[ FAILED ] AtomicPropositionSubbingClonerTest.SimpleTest
[ FAILED ] AtomicPropositionSubbingClonerTest.SimpleConstantEventTest
2 FAILED TESTS
YOU HAVE 2 DISABLED TESTS
If you have any suggestions on how to pass these last two tests that would be very helpful. Thanks!