-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/cvc5/cvc5
- Loading branch information
Showing
144 changed files
with
8,028 additions
and
1,423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
python-bindings: true | ||
build-documentation: true | ||
check-examples: true | ||
package-name: cvc5-Linux | ||
package-name: cvc5-Linux-x86_64 | ||
exclude_regress: 3-4 | ||
run_regression_args: --tester base --tester model --tester synth --tester abduct --tester dump | ||
|
||
|
@@ -37,7 +37,7 @@ jobs: | |
strip-bin: strip | ||
python-bindings: true | ||
check-examples: true | ||
package-name: cvc5-macOS | ||
package-name: cvc5-macOS-x86_64 | ||
macos-target: 10.13 | ||
exclude_regress: 3-4 | ||
run_regression_args: --tester base --tester model --tester synth --tester abduct --tester dump | ||
|
@@ -69,7 +69,7 @@ jobs: | |
windows-build: true | ||
shell: 'msys2 {0}' | ||
check-examples: true | ||
package-name: cvc5-Win64 | ||
package-name: cvc5-Win64-x86_64 | ||
exclude_regress: 1-4 | ||
run_regression_args: --tester base --tester model --tester synth --tester abduct --tester dump | ||
|
||
|
@@ -192,18 +192,3 @@ jobs: | |
github-token-latest: ${{ secrets.GITHUB_TOKEN }} | ||
github-token-release: ${{ secrets.ACTION_USER_TOKEN }} | ||
shell: ${{ matrix.shell }} | ||
|
||
update-pr: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'cvc5/cvc5' && github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
concurrency: | ||
group: update-pr | ||
steps: | ||
- name: Automatically update PR | ||
uses: adRise/[email protected] | ||
with: | ||
token: ${{ secrets.ACTION_USER_TOKEN }} | ||
base: 'main' | ||
sort: 'created' | ||
direction: 'asc' | ||
required_approval_count: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
############################################################################### | ||
# Top contributors (to current version): | ||
# Daniel Larraz | ||
# | ||
# This file is part of the cvc5 project. | ||
# | ||
# Copyright (c) 2009-2024 by the authors listed in the file AUTHORS | ||
# in the top-level source directory and their institutional affiliations. | ||
# All rights reserved. See the file COPYING in the top-level source | ||
# directory for licensing information. | ||
# ############################################################################# | ||
# | ||
# Find Pip | ||
# Pip_FOUND - found Python pip | ||
# Pip_VERSION - Python pip version | ||
## | ||
|
||
macro(get_pip_version) | ||
execute_process( | ||
COMMAND "${Python_EXECUTABLE}" -c "import pip; print(pip.__version__)" | ||
RESULT_VARIABLE Pip_VERSION_CHECK_RESULT | ||
OUTPUT_VARIABLE Pip_VERSION | ||
ERROR_QUIET | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
endmacro() | ||
|
||
get_pip_version() | ||
|
||
if (Pip_FIND_REQUIRED) | ||
set(Pip_FIND_MODE FATAL_ERROR) | ||
else() | ||
set(Pip_FIND_MODE STATUS) | ||
endif() | ||
|
||
if(Pip_VERSION_CHECK_RESULT EQUAL 0) | ||
set(Pip_FOUND TRUE) | ||
if(DEFINED Pip_FIND_VERSION) | ||
if(Pip_VERSION VERSION_LESS ${Pip_FIND_VERSION}) | ||
if(ENABLE_AUTO_DOWNLOAD) | ||
execute_process ( | ||
COMMAND "${Python_EXECUTABLE}" -m pip install -U pip | ||
) | ||
get_pip_version() | ||
else() | ||
message(${Pip_FIND_MODE} | ||
"Pip version >= ${Pip_FIND_VERSION} is required, " | ||
"but found version ${Pip_VERSION}") | ||
endif() | ||
endif() | ||
endif() | ||
else() | ||
set(Pip_FOUND FALSE) | ||
if(ENABLE_AUTO_DOWNLOAD) | ||
execute_process ( | ||
COMMAND "${Python_EXECUTABLE}" -m ensurepip --upgrade | ||
RESULT_VARIABLE ENSUREPIP_RESULT | ||
) | ||
if (ENSUREPIP_RESULT EQUAL 0) | ||
set(Pip_FOUND TRUE) | ||
else() | ||
message(${Pip_FIND_MODE} "Could NOT install pip for Python version " | ||
"${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}") | ||
endif() | ||
else() | ||
message(${Pip_FIND_MODE} "Could NOT find pip for Python version " | ||
"${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
############################################################################### | ||
# Top contributors (to current version): | ||
# Daniel Larraz | ||
# | ||
# This file is part of the cvc5 project. | ||
# | ||
# Copyright (c) 2009-2024 by the authors listed in the file AUTHORS | ||
# in the top-level source directory and their institutional affiliations. | ||
# All rights reserved. See the file COPYING in the top-level source | ||
# directory for licensing information. | ||
# ############################################################################# | ||
# | ||
# Find Repairwheel | ||
# Repairwheel_FOUND - system has the repairwheel executable | ||
# Repairwheel_EXECUTABLE - path to the repairwheel executable | ||
# Repairwheel_VERSION - repairwheel version | ||
## | ||
|
||
set(Python_SCRIPTS_Paths "") | ||
|
||
macro(add_scripts_path python_bin scheme) | ||
execute_process( | ||
COMMAND "${python_bin}" -c | ||
"import sysconfig; print(sysconfig.get_paths('${scheme}')['scripts'])" | ||
RESULT_VARIABLE Python_SCRIPTS_RESULT | ||
OUTPUT_VARIABLE Python_SCRIPTS | ||
ERROR_QUIET | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if (NOT Python_SCRIPTS_RESULT AND Python_SCRIPTS) | ||
list(APPEND Python_SCRIPTS_Paths ${Python_SCRIPTS}) | ||
endif() | ||
endmacro() | ||
|
||
# Look for repairwheel executable in Python "Scripts" directories | ||
add_scripts_path("${Python_EXECUTABLE}" "posix_prefix") | ||
add_scripts_path("${Python_BASE_EXECUTABLE}" "posix_user") | ||
add_scripts_path("${Python_BASE_EXECUTABLE}" "posix_prefix") | ||
if(WIN32) | ||
add_scripts_path("${Python_EXECUTABLE}" "nt") | ||
add_scripts_path("${Python_BASE_EXECUTABLE}" "nt_user") | ||
add_scripts_path("${Python_BASE_EXECUTABLE}" "nt") | ||
endif() | ||
|
||
if (Repairwheel_FIND_REQUIRED) | ||
set(Repairwheel_FIND_MODE FATAL_ERROR) | ||
else() | ||
set(Repairwheel_FIND_MODE STATUS) | ||
endif() | ||
|
||
macro(find_repairwheel) | ||
find_program(Repairwheel_EXECUTABLE repairwheel ${Python_SCRIPTS_Paths}) | ||
if(Repairwheel_EXECUTABLE) | ||
execute_process( | ||
COMMAND "${Repairwheel_EXECUTABLE}" --version | ||
RESULT_VARIABLE Repairwheel_VERSION_CHECK_RESULT | ||
OUTPUT_VARIABLE Repairwheel_VERSION | ||
) | ||
# Check we can run repairwheel successfully. | ||
# Otherwise, reset path to executable. | ||
if(NOT(Repairwheel_VERSION_CHECK_RESULT EQUAL 0)) | ||
set(Repairwheel_EXECUTABLE "") | ||
endif() | ||
endif() | ||
endmacro() | ||
|
||
find_repairwheel() | ||
|
||
if(NOT Repairwheel_EXECUTABLE AND ENABLE_AUTO_DOWNLOAD) | ||
message(STATUS "Installing repairwheel") | ||
execute_process( | ||
COMMAND ${Python_EXECUTABLE} -m pip install repairwheel | ||
) | ||
find_repairwheel() | ||
endif() | ||
|
||
if(Repairwheel_EXECUTABLE) | ||
set(Repairwheel_FOUND TRUE) | ||
message(STATUS "Found repairwheel: ${Repairwheel_EXECUTABLE}") | ||
else() | ||
set(Repairwheel_FOUND FALSE) | ||
message(${Repairwheel_FIND_MODE} "Could NOT find repairwheel executable") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Theory of Uninterpreted Functions | ||
================================== | ||
|
||
|
||
.. api-examples:: | ||
<examples>/api/cpp/uf.cpp | ||
<examples>/api/java/Uf.java | ||
<examples>/api/python/pythonic/uf.py | ||
<examples>/api/python/uf.py | ||
<examples>/api/smtlib/uf.smt2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/****************************************************************************** | ||
* Top contributors (to current version): | ||
* Yoni Zohar | ||
* | ||
* This file is part of the cvc5 project. | ||
* | ||
* Copyright (c) 2009-2024 by the authors listed in the file AUTHORS | ||
* in the top-level source directory and their institutional affiliations. | ||
* All rights reserved. See the file COPYING in the top-level source | ||
* directory for licensing information. | ||
* **************************************************************************** | ||
* | ||
* A simple demonstration of the capabilities of the cvc5 uf solver. | ||
*/ | ||
|
||
#include <cvc5/cvc5.h> | ||
|
||
#include <iostream> | ||
|
||
using namespace cvc5; | ||
|
||
int main() | ||
{ | ||
TermManager tm; | ||
Solver slv(tm); | ||
slv.setLogic("QF_UF"); | ||
|
||
// Sorts | ||
Sort u = tm.mkUninterpretedSort("U"); | ||
Sort boolean = tm.getBooleanSort(); | ||
Sort uTou = tm.mkFunctionSort({u}, u); | ||
Sort uPred = tm.mkFunctionSort({u}, boolean); | ||
|
||
// Variables | ||
Term x = tm.mkConst(u, "x"); | ||
Term y = tm.mkConst(u, "y"); | ||
|
||
// Functions | ||
Term f = tm.mkConst(uTou, "f"); | ||
Term p = tm.mkConst(uPred, "p"); | ||
|
||
// Terms | ||
Term f_x = tm.mkTerm(Kind::APPLY_UF, {f, x}); | ||
Term f_y = tm.mkTerm(Kind::APPLY_UF, {f, y}); | ||
Term p_f_x = tm.mkTerm(Kind::APPLY_UF, {p, f_x}); | ||
Term p_f_y = tm.mkTerm(Kind::APPLY_UF, {p, f_y}); | ||
|
||
// Construct the assertions | ||
Term assertions = | ||
tm.mkTerm(Kind::AND, | ||
{ | ||
tm.mkTerm(Kind::EQUAL, {x, f_x}), | ||
tm.mkTerm(Kind::EQUAL, {y, f_y}), | ||
p_f_x.notTerm(), | ||
p_f_y | ||
}); | ||
slv.assertFormula(assertions); | ||
|
||
std::cout << slv.checkSat() << std::endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ set(EXAMPLES_API_JAVA | |
SygusInv | ||
Transcendentals | ||
UnsatCores | ||
Uf | ||
) | ||
|
||
function(add_java_example example) | ||
|
Oops, something went wrong.