-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
225 changed files
with
3,212 additions
and
325 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,56 @@ | ||
# - Try to find LibPoly | ||
# Once done this will define | ||
# LIBPOLY_FOUND - System has LibPoly | ||
# LIBPOLY_INCLUDE_DIRS - The LibPoly include directories | ||
# LIBPOLY_LIBRARIES - The libraries needed to use LibPoly | ||
|
||
if (LIBPOLY_HOME) | ||
find_path(LIBPOLY_INCLUDE_DIR poly/poly.h PATHS "${LIBPOLY_HOME}/include") | ||
else() | ||
find_path(LIBPOLY_INCLUDE_DIR poly/poly.h) | ||
endif() | ||
|
||
if (SALLY_STATIC_BUILD) | ||
if (LIBPOLY_HOME) | ||
find_library(LIBPOLY_LIBRARY libpoly.a poly PATHS "${LIBPOLY_HOME}/lib") | ||
else() | ||
find_library(LIBPOLY_LIBRARY libpoly.a poly) | ||
endif() | ||
else() | ||
if (LIBPOLY_HOME) | ||
find_library(LIBPOLY_LIBRARY poly PATHS "${LIBPOLY_HOME}/lib") | ||
else() | ||
find_library(LIBPOLY_LIBRARY poly) | ||
endif() | ||
endif() | ||
|
||
# If library found, check the version | ||
if (LIBPOLY_INCLUDE_DIR AND LibPoly_FIND_VERSION) | ||
|
||
# Check version. It is in poly/version.h of the form | ||
# | ||
# #define LIBPOLY_VERSION 0.1.1 | ||
|
||
# Extract version lines from yices.h | ||
file(STRINGS "${LIBPOLY_INCLUDE_DIR}/poly/version.h" LIBPOLY_H_VERSION REGEX "#define LIBPOLY_VERSION") | ||
if("${LIBPOLY_H_VERSION}" MATCHES ".*#define LIBPOLY_VERSION[ ]+([0-9]+\\.[0-9]+\\.[0-9]+).*") | ||
set(LIBPOLY_VERSION "${CMAKE_MATCH_1}") | ||
endif() | ||
|
||
# Compare the found version to asked for version | ||
if ("${LIBPOLY_VERSION}" VERSION_LESS "${LibPoly_FIND_VERSION}") | ||
unset(LIBPOLY_INCLUDE_DIR CACHE) | ||
unset(LIBPOLY_LIBRARY CACHE) | ||
elseif (LibPoly_FIND_VERSION_EXACT AND NOT "${LIBPOLY_VERSION}" VERSION_EQUAL "${LibPoly_FIND_VERSION}") | ||
unset(LIBPOLY_INCLUDE_DIR CACHE) | ||
unset(LIBPOLY_LIBRARY CACHE) | ||
endif() | ||
endif() | ||
|
||
set(LIBPOLY_LIBRARIES ${LIBPOLY_LIBRARY}) | ||
set(LIBPOLY_INCLUDE_DIRS ${LIBPOLY_INCLUDE_DIR}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LibPoly DEFAULT_MSG LIBPOLY_LIBRARY LIBPOLY_INCLUDE_DIR) | ||
|
||
mark_as_advanced(LIBPOLY_INCLUDE_DIR LIBPOLY_LIBRARY) |
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 |
---|---|---|
@@ -1,11 +1,21 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Check if the yices2 folder is empty | ||
if [ ! -d "$HOME/yices2/lib" ]; then | ||
wget "http://yices.csl.sri.com/cgi-bin/yices2-newnewdownload.cgi?file=yices-2.3.1-src.tar.gz&accept=I+Agree" -O yices.tar.gz | ||
tar xzvf yices.tar.gz | ||
cd yices* && autoconf && ./configure --prefix=$HOME/yices2 && make MODE=release && make MODE=release install && cd .. | ||
else | ||
echo 'Using cached directory.'; | ||
fi | ||
# libpoly | ||
pushd . | ||
git clone https://github.com/SRI-CSL/libpoly.git | ||
cd libpoly/build | ||
cmake -DCMAKE_BUILD_TYPE=Release .. | ||
make | ||
sudo make install | ||
popd | ||
|
||
# yices2 | ||
pushd . | ||
git clone https://github.com/SRI-CSL/yices2.git | ||
cd yices2 | ||
autoconf | ||
./configure --enable-mcsat | ||
make | ||
sudo make install | ||
popd |
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,30 @@ | ||
;; Maintain Sum and n | ||
(define-state-type ST ((Sum Real) (n Real))) | ||
;; Initial states: Sum = 0, n = 0 | ||
(define-states Init ST (and (= Sum 0) (= n 0))) | ||
|
||
;; Transition: Sum += n | ||
(define-transition Trans1 ST | ||
(and | ||
(= next.Sum (+ state.Sum state.n)) | ||
(= next.n (+ state.n 1)) | ||
) | ||
) | ||
|
||
;; Transition system: Sum = 1 + 2 + ... + (n-1) | ||
(define-transition-system T1 ST Init Trans1) | ||
;; Sum = n*(n-1)/2 | ||
(query T1 (= Sum (/ (* n (- n 1)) 2))) | ||
|
||
;; Transition: Sum += n^2 | ||
(define-transition Trans2 ST | ||
(and | ||
(= next.Sum (+ state.Sum (* state.n state.n))) | ||
(= next.n (+ state.n 1)) | ||
) | ||
) | ||
|
||
;; Transition system: Sum = 1^2 + 2^2 + ... + (n-1)^2 | ||
(define-transition-system T2 ST Init Trans2) | ||
;; Sum = n*(n-1)/2 | ||
(query T2 (= Sum (/ (* n (- n 1) (- (* 2 n) 1)) 6))) |
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
Oops, something went wrong.