-
Notifications
You must be signed in to change notification settings - Fork 15
Add BTOR2 Frontend #74
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
Changes from 7 commits
22d0d09
b5fa12e
42afda7
497aa16
5ee067a
368b403
4d06855
f229df7
16d755c
4dd22ae
12ac239
e35f8d6
5a850c6
4488f6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # - Try to find Btor2Tools | ||
| # Once done this will define | ||
| # BTOR2TOOLS_FOUND - System has Btor2Tools | ||
| # BTOR2TOOLS_INCLUDE_DIRS - The Btor2Tools include directories | ||
| # BTOR2TOOLS_LIBRARIES - The libraries needed to use Btor2Tools | ||
|
|
||
| if (BTOR2TOOLS_HOME) | ||
| find_path(BTOR2TOOLS_INCLUDE_DIR btor2parser/btor2parser.h PATHS "${BTOR2TOOLS_HOME}/src" NO_DEFAULT_PATH) | ||
| else() | ||
| find_path(BTOR2TOOLS_INCLUDE_DIR btor2parser/btor2parser.h) | ||
| endif() | ||
|
|
||
| if (SALLY_STATIC_BUILD) | ||
| if (BTOR2TOOLS_HOME) | ||
| find_library(BTOR2TOOLS_LIBRARY libbtor2parser.a btor2parser PATHS "${BTOR2TOOLS_HOME}/build/lib" NO_DEFAULT_PATH) | ||
| else() | ||
| find_library(BTOR2TOOLS_LIBRARY libbtor2parser.a btor2parser) | ||
| endif() | ||
| else() | ||
| if (BTOR2TOOLS_HOME) | ||
| find_library(BTOR2TOOLS_LIBRARY btor2parser PATHS "${BTOR2TOOLS_HOME}/build/lib" NO_DEFAULT_PATH) | ||
| else() | ||
| find_library(BTOR2TOOLS_LIBRARY btor2parser) | ||
| endif() | ||
| endif() | ||
|
|
||
| set(BTOR2TOOLS_LIBRARIES ${BTOR2TOOLS_LIBRARY}) | ||
| set(BTOR2TOOLS_INCLUDE_DIRS ${BTOR2TOOLS_INCLUDE_DIR}) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(Btor2Tools DEFAULT_MSG BTOR2TOOLS_LIBRARY BTOR2TOOLS_INCLUDE_DIR) | ||
|
|
||
| mark_as_advanced(BTOR2TOOLS_INCLUDE_DIR BTOR2TOOLS_LIBRARY) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "Installing btor2tools..." | ||
|
|
||
| # Clone the repository | ||
| if ! git clone https://github.com/hwmcc/btor2tools.git; then | ||
| echo "Error: Failed to clone btor2tools repository." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Navigate to btor2tools directory | ||
| if ! pushd btor2tools; then | ||
| echo "Error: Failed to enter btor2tools directory." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Run configure script | ||
| if ! ./configure.sh; then | ||
| echo "Error: Configuration failed." >&2 | ||
| popd > /dev/null 2>&1 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Enter build directory | ||
| if ! pushd build; then | ||
| echo "Error: Failed to enter build directory." >&2 | ||
| popd | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Run make | ||
| if ! make; then | ||
| echo "Error: Build failed." >&2 | ||
| popd; popd | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Return to original directories | ||
| popd | ||
| popd | ||
|
|
||
| echo "btor2tools installation completed successfully!" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,11 @@ engine::result kind_engine::query(const system::transition_system* ts, const sys | |
| // Transition formula | ||
| expr::term_ref transition_formula = ts->get_transition_relation(); | ||
|
|
||
| // Invariant formula | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment on bmc_engine |
||
| expr::term_ref invar_formula = ts->get_invariant(); | ||
| solver1->add(d_trace->get_state_formula(invar_formula, 0), smt::solver::CLASS_A); | ||
| solver2->add(d_trace->get_state_formula(invar_formula, 0), smt::solver::CLASS_A); | ||
|
|
||
| // The property | ||
| expr::term_ref property = sf->get_formula(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,10 @@ engine::result simulator::query(const system::transition_system* ts, const syste | |
| // Transition formula | ||
| expr::term_ref transition_formula = ts->get_transition_relation(); | ||
|
|
||
| // Invariant formula | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment on bmc_engine |
||
| expr::term_ref invar_formula = ts->get_invariant(); | ||
| d_solver->add(d_trace->get_state_formula(invar_formula, 0), smt::solver::CLASS_A); | ||
|
|
||
| // The property | ||
| expr::term_ref property = sf->get_formula(); | ||
|
|
||
|
|
||
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 this change?
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.
Invariants were actually never implemented before. Transition systems had methods for adding invariants, but these were never used nor accessed. This change (and to the other engines) actually implements invariants properly.
The only caveat is that I didn't implement them for the pdkind engine, so I will take a look at that.