Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@makaimann
Copy link
Collaborator

@makaimann makaimann commented Feb 21, 2020

Based on earlier discussion, this PR swaps the inheritance relationship between RelationalTransitionSystem and FunctionalTransitionSystem. Furthermore, it drops Relational and just calls it a general TransitionSystem. Furthermore, it enforces that INIT/INVAR/PROP use only state variables. It adds a constrain_inputs function which will add a constraint to TRANS only over current states and inputs. There's also a convenience function that picks between add_invar and constrain_inputs, based on whether the constraint contains inputs.

Because there will sometimes be inputs in the property, the btor2_encoder will make a witness for the bad state if necessary. I'm not sure if it makes sense to do this here, or later. But, this was the easiest place to add it now. Note that this can add lots of states to the system: e.g. if the BTOR2 file has lots of bad states that have inputs in them, there's one witness for each of those, even if we're only checking one property. I'm open to other solutions if people have suggestions. In the future, maybe we should copy the transition systems for each property and modify it per property. This also make sense for COI @lonsing .

Note, I'm currently running it on the HWMCC19 benchmarks to check for any potential bugs I introduced.

@makaimann makaimann added structural Interface or structural changes to the code (not just internal refactoring) refactor labels Feb 21, 2020
@ahmed-irfan
Copy link
Collaborator

@makaimann you mentioned that you were running the HWMCC benchmarks on the cluster. Did the run finish?

@makaimann
Copy link
Collaborator Author

26Feb2020-cosa2-runs

Sorry for the delay! Here's a screenshot of the compare script showing that there's no discrepancies.

@makaimann
Copy link
Collaborator Author

And here are screenshots showing totals. We lost a couple benchmarks for k-induction. I can look at the code changes to see if there's data structure copies or something:

26Feb2020-cosa2-bmc-totals

26Feb2020-cosa2-ind-totals

26Feb2020-cosa2-interp-totals

@makaimann makaimann added the do not merge Don't merge this pull request yet (waiting on something or not yet ready). label Feb 26, 2020
@makaimann
Copy link
Collaborator Author

I just realized that the unroller needs to be updated so that it works with FunctionalTransitionSystem. I don't currently have any tests for that, but it calls next on the transition system which is disabled for functional systems. I'll handle that soon.

@makaimann
Copy link
Collaborator Author

Here are the latest results! No discrepancies with master, the two errors in master are now timeouts, and we only lose 3 benchmarks for ind and otherwise we solve the same number of benchmarks. As far as I'm concerned, this now ready, but I'd appreciate opinions on the new TransitionSystem inheritance structure (an abstract parent class, and two implementations -- relational and functional).

Screen Shot 2020-02-28 at 12 26 16 PM

Screen Shot 2020-02-28 at 12 28 12 PM

Screen Shot 2020-02-28 at 12 31 22 PM

@makaimann makaimann requested a review from lonsing February 28, 2020 20:33
@makaimann makaimann removed the do not merge Don't merge this pull request yet (waiting on something or not yet ready). label Feb 28, 2020
CMakeLists.txt Outdated

if (WITH_CVC4)
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/deps/smt-switch/local/lib/libsmt-switch-cvc4.${SHARED_LIBRARY_EXT}")
message(FATAL_ERROR "Missing smt-switch mathsat library -- try running ./contrib/setup-smt-switch.sh --with-cvc4")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: mathsat -> cvc4

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Fixed with f038c80

core/ts.cpp Outdated
throw CosaException("Unknown state variable");
}

if (!no_next(val))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatted with 1308d79

core/ts.cpp Outdated

// protected methods

bool TransitionSystem::only_curr(const Term & term) const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can create a common function contains(const Term & term, TermVec vec).
only_curr(term t) := contains(t, states_)
no_next(term t) := contains(t, states_ + inputs_)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Implemented with b78fe5a

@makaimann makaimann added the do not merge Don't merge this pull request yet (waiting on something or not yet ready). label Mar 3, 2020
@makaimann
Copy link
Collaborator Author

Because the change in b78fe5a is somewhat non-trivial, I'm going to rerun the benchmarks to ensure I didn't introduce any bugs. I'll post the results asap.

@ahmed-irfan
Copy link
Collaborator

updates on the new experiment run...

@makaimann makaimann removed the do not merge Don't merge this pull request yet (waiting on something or not yet ready). label Mar 4, 2020
@makaimann
Copy link
Collaborator Author

Here are the latest results, everything looks good:

latest-ts-fixes-comparison
latest-ts-fixes-totals

Copy link
Collaborator

@ahmed-irfan ahmed-irfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job :)

@makaimann makaimann merged commit bdd6506 into master Mar 5, 2020
@ahmed-irfan ahmed-irfan deleted the ts-fixes branch March 7, 2020 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor structural Interface or structural changes to the code (not just internal refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants