Skip to content
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

314 adding the abstract numeric domains of the apron library as smt solver #346

Open
wants to merge 135 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
403afed
Apron Prototyp und kleines Beispiel
Jun 26, 2023
70e0ef0
SolverContext, Type logic, Formular Creator beginnings
winnieros Jul 21, 2023
642b24e
adjustments to the git-lab annotations
winnieros Jul 24, 2023
6758f9f
NumeralFormularManager Beginnings
winnieros Jul 24, 2023
6fb8c14
ApronNumeralFormulaManager add Function
winnieros Aug 10, 2023
169dd4f
ApronNumeralFormulaManager add-function adjusted
winnieros Aug 10, 2023
0480cc4
ApronNumeralFormulaManager add-function adjusted
winnieros Aug 14, 2023
46bb452
Numeral constraints
winnieros Aug 14, 2023
b8a40bc
New Type System for ApronFormulas
winnieros Aug 14, 2023
b6d6af3
Small changes here and there
winnieros Aug 14, 2023
e3ac323
Small changes here and there
winnieros Aug 14, 2023
44c13b4
MakeVariable adjustment
winnieros Aug 15, 2023
75bdd45
Assertion stack, other small changes
winnieros Aug 21, 2023
e33581f
Trying to create a Model
winnieros Aug 21, 2023
9baf465
Code refactored
winnieros Aug 22, 2023
789dc48
mostly debugging
winnieros Aug 23, 2023
1834883
Model now working
winnieros Aug 26, 2023
a747a27
Small implementations that were missing
winnieros Aug 26, 2023
2aa423b
Testclass debugging
winnieros Aug 27, 2023
f761bc4
Rational Model
winnieros Aug 28, 2023
0846ec1
Debbugging bassed on unnit tests
winnieros Aug 28, 2023
7b4e6d9
Documentaion
winnieros Aug 28, 2023
c1ca1ac
adding and()
winnieros Aug 29, 2023
78efb3b
distinct and True/False
winnieros Aug 30, 2023
6d45ca6
small changes
winnieros Aug 30, 2023
cd40b19
Debugging
winnieros Aug 31, 2023
8d15b53
Debugging
winnieros Sep 1, 2023
c20463f
Debugging
winnieros Sep 1, 2023
94e7437
distinctTest
winnieros Sep 26, 2023
ef9c222
distinctTest
winnieros Sep 26, 2023
e15eb13
some requires for the tests
winnieros Sep 26, 2023
0df8562
Tests and rounding
winnieros Oct 1, 2023
0406931
Tests hasVar
winnieros Oct 1, 2023
029be2e
Tests hasVar
winnieros Oct 1, 2023
ab36def
Congruence api test
winnieros Oct 2, 2023
41bd763
NativeApiTest Debugging
winnieros Oct 2, 2023
1b1da3d
test debugging
winnieros Oct 4, 2023
75c0cd7
test debugging
winnieros Oct 9, 2023
8e3fb81
Comments and documentation
winnieros Oct 9, 2023
22d1139
Reformat Code
winnieros Oct 9, 2023
5944ee0
Tests all passed now
winnieros Oct 12, 2023
54232bf
Addition to API test
winnieros Oct 12, 2023
f6ab2c2
new model evaluation and small other alterations
winnieros Oct 23, 2023
d76054b
rename
winnieros Oct 23, 2023
770de6b
SAT and UNKNOWN warning
winnieros Oct 30, 2023
9fd0fb8
publishing
winnieros Nov 8, 2023
0a6bd9d
publishing
winnieros Nov 8, 2023
fe15e4d
publishing
winnieros Nov 8, 2023
c378414
publishing
winnieros Nov 8, 2023
09c5ae9
publishing
winnieros Nov 13, 2023
3094601
publishing
winnieros Nov 14, 2023
556bef8
publishing
winnieros Nov 14, 2023
ae6f5af
publishing
winnieros Nov 14, 2023
5f90d17
publishing
winnieros Nov 14, 2023
8786962
publishing
winnieros Nov 14, 2023
c341b58
publishing
winnieros Nov 14, 2023
7c3e169
publishing
winnieros Nov 14, 2023
5bd42bf
publishing
winnieros Nov 15, 2023
3be2a82
publishing
winnieros Nov 15, 2023
58acf59
publishing
winnieros Nov 16, 2023
67783fb
ant check-all
winnieros Nov 16, 2023
e6f8968
ant check-all
winnieros Nov 16, 2023
64fe394
ant check-all
winnieros Nov 16, 2023
8e4222a
ant check-all
winnieros Nov 16, 2023
a67bd7e
ant check-all
winnieros Nov 16, 2023
18b0447
ant check-all
winnieros Nov 16, 2023
4b51ef7
ant check-all
winnieros Nov 16, 2023
2511ef2
ant check-all
winnieros Nov 16, 2023
a2c04f7
ant check-all
winnieros Nov 16, 2023
121afb4
ant check-all
winnieros Nov 16, 2023
9fa9809
ant check-all
winnieros Nov 16, 2023
f01cb4e
ant check-all
winnieros Nov 16, 2023
9e0b27a
ant check-all
winnieros Nov 16, 2023
85b6225
ant check-all
winnieros Nov 16, 2023
63d276c
ant check-all
winnieros Nov 16, 2023
cd2597e
ant check-all
winnieros Nov 16, 2023
f8f6e96
ant check-all
winnieros Nov 16, 2023
1817470
ant check-all
winnieros Nov 16, 2023
ca0a3a9
ant check-all
winnieros Nov 16, 2023
ef8af65
ant check-all
winnieros Nov 16, 2023
8ea4daf
ant check-all
winnieros Nov 20, 2023
6f320e2
ant check-all
winnieros Nov 20, 2023
13f7138
ant check-all
winnieros Nov 20, 2023
7863d9e
ant check-all
winnieros Nov 20, 2023
9be8eae
ant check-all
winnieros Nov 20, 2023
809329d
ant check-all
winnieros Nov 20, 2023
7d48d25
ant check-all
winnieros Nov 20, 2023
44152b2
ant check-all
winnieros Nov 20, 2023
87dc5d0
ant check-all
winnieros Nov 20, 2023
8de9047
ant check-all
winnieros Nov 20, 2023
21b0dff
ant check-all
winnieros Nov 20, 2023
f09652c
ant check-all
winnieros Nov 20, 2023
5b5bcfa
ant check-all
winnieros Nov 20, 2023
84199c0
ant check-all
winnieros Nov 20, 2023
120cea9
ant check-all
winnieros Nov 20, 2023
a4036f1
ant check-all
winnieros Nov 20, 2023
5072604
ant check-all
winnieros Nov 20, 2023
2499415
ant check-all
winnieros Nov 20, 2023
6d7fc4b
ant check-all
winnieros Nov 20, 2023
229b37a
beforeclass test
winnieros Nov 20, 2023
4d09738
beforeclass test
winnieros Nov 20, 2023
d11354a
beforeclass test
winnieros Nov 20, 2023
00cc46f
ant publish new
winnieros Nov 20, 2023
56f93fd
ant publish new
winnieros Nov 20, 2023
988f9b5
ant publish new
winnieros Nov 20, 2023
9f6b5a7
ant publish new
winnieros Nov 20, 2023
2804bc2
ant publish new
winnieros Nov 20, 2023
5b27181
ant publish new
winnieros Nov 20, 2023
44120fa
ant publish new
winnieros Nov 20, 2023
599094c
ant publish new
winnieros Nov 20, 2023
5071f18
ant publish new
winnieros Nov 20, 2023
3ab8108
ant publish new
winnieros Nov 20, 2023
9b87f9c
ant publish new
winnieros Nov 22, 2023
ac8bf93
Some new documentaions
winnieros Nov 22, 2023
9b2abbb
load Library
winnieros Nov 28, 2023
5b2dcb5
load Library
winnieros Nov 28, 2023
a65fc09
load Library
winnieros Nov 28, 2023
7eb4620
load Library
winnieros Nov 28, 2023
ca790f6
load Library
winnieros Nov 28, 2023
526c10b
Add Symlinks for Apron and classpathentries
Nov 28, 2023
7398cc7
ModelEvaluationTest Debug
winnieros Nov 28, 2023
dd338ec
merge Versuch
winnieros Nov 28, 2023
93a87b7
Apron: Fixed broken project files.
daniel-raffler Apr 25, 2024
fbacbb6
Apron: Use StringBuilder in ApronNode.toString to address SpotBugs is…
daniel-raffler Apr 25, 2024
a7a51ae
Apron: Fixed CI issues.
daniel-raffler Apr 25, 2024
bfbfb3c
Merge remote-tracking branch 'refs/remotes/origin/master' into 314-ad…
daniel-raffler Apr 25, 2024
b9dd9c5
Apron: Moved build script for Apron to its own file.
daniel-raffler Apr 25, 2024
d06365a
Apron: Updated ApronTheoremProver to use the new interface from Abstr…
daniel-raffler Apr 25, 2024
b6c9358
Apron: Formatting
daniel-raffler Apr 25, 2024
cb13ca3
Apron: Fixed tests for Apron.
daniel-raffler Apr 25, 2024
86121db
Apron: Fixed license headers.
daniel-raffler Apr 25, 2024
26c49ba
DReal: Fixed Apron version in ivy.xml
daniel-raffler Apr 26, 2024
12a9839
DReal: Fixed several issues as suggested by baierd in https://github.…
daniel-raffler Apr 26, 2024
3b87a75
DReal: Revert to returning 'null' in convertValue if the value does n…
daniel-raffler Apr 26, 2024
899b982
DReal: Fixed formatting
daniel-raffler Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ SPDX-License-Identifier: Apache-2.0
<classpathentry kind="lib" path="lib/java/runtime-princess/scala-library.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-princess/princess-smt-parser_2.13.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-princess/java-cup-runtime.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-apron/gmp.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-apron/apron.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-z3/com.microsoft.z3.jar" sourcepath="lib/java-contrib/com.microsoft.z3-sources.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-cvc4/CVC4.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-cvc5/cvc5.jar"/>
Expand Down
18 changes: 18 additions & 0 deletions .idea/JavaSMT.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ SPDX-License-Identifier: Apache-2.0
runtime-princess,
runtime-smtinterpol,
runtime-yices2,
runtime-z3
runtime-z3,
runtime-apron
"/>
<property name="ivy.configuration.main" value="core"/>
<property name="ivy.configurations" value="build, ${ivy.configuration.main}, ${ivy.solver.configurations}, test, format-source, checkstyle, spotbugs"/>
Expand Down
3 changes: 2 additions & 1 deletion build/build-publish-solvers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SPDX-License-Identifier: Apache-2.0
-->

<!-- vim: set tabstop=8 shiftwidth=4 expandtab sts=4 filetype=ant fdm=marker: -->
<project name="publish-solvers" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<project name="publish-solvers" basedir=".">

<import file="build-publish-solvers/solver-boolector.xml"/>
<import file="build-publish-solvers/solver-cvc4.xml"/>
Expand All @@ -20,5 +20,6 @@ SPDX-License-Identifier: Apache-2.0
<import file="build-publish-solvers/solver-opensmt.xml"/>
<import file="build-publish-solvers/solvers-yices.xml"/>
<import file="build-publish-solvers/solver-z3.xml"/>
<import file="build-publish-solvers/solver-apron.xml"/>

</project>
108 changes: 108 additions & 0 deletions build/build-publish-solvers/solver-apron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!--
This file is part of JavaSMT,
an API wrapper for a collection of SMT solvers:
https://github.com/sosy-lab/java-smt

SPDX-FileCopyrightText: 2024 Dirk Beyer <https://www.sosy-lab.org>

SPDX-License-Identifier: Apache-2.0
-->

<!-- vim: set tabstop=8 shiftwidth=4 expandtab sts=4 filetype=ant fdm=marker: -->
<!-- SECTION: Publishing Apron {{{1
==================================================================
-->
<project name="publish-solvers-apron" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<import file="macros.xml"/>

<target name="package-apron" depends="">
<!-- Copy Apron repository to the root folder along with the version postfix. -->
<fail unless="apron.path">
Please specify the path to Apron with the flag -Dapron.path=/path/to/apron.
The path has to point to the root Apron folder, i.e.,
a checkout of the official git repositoy from 'https://github.com/antoinemine/apron'.
Note that shell substitutions do not work and a full absolute path has to be specified.
</fail>
<fail unless="apron.customRev">
Please specify a custom revision with the flag -Dapron.customRev=XXX.
The custom revision has to be unique amongst the already known version
numbers from the ivy repository. The script will append the git revision.
</fail>
<!-- get a naive version -->
<exec executable="git" dir="${apron.path}" outputproperty="apron.revision"
failonerror="true">
<arg value="show"/>
<arg value="-s"/>
<arg value="--format=%h"/>
</exec>
<property name="apron.version" value="${apron.customRev}-g${apron.revision}"/>
<echo message="Building Apron in version '${apron.version}'"/>

<!-- build apron -->
<exec executable="./configure" dir="${apron.path}" failonerror="true">
<arg value="-java-prefix"/>
<arg value="/usr/lib/jvm/java-11-openjdk-amd64"/>
<arg value="--no-cxx"/>
<arg value="--no-ocaml"/>
<arg value="--no-ppl"/>
<arg value="--prefix"/>
<arg value="${apron.path}/install"/>
<arg value="--no-ocaml-plugins"/>
<arg value="--no-ocamlfind"/>
</exec>
<exec executable="make" dir="${apron.path}" failonerror="true">
</exec>

<!-- fix RPATH and library dependencies -->
<exec executable="patchelf" dir="${apron.path}/apron" failonerror="true">
<arg value="--set-rpath"/><arg value="$ORIGIN"/>
<arg value="libapron.so"/>
</exec>
<exec executable="patchelf" dir="${apron.path}/box" failonerror="true">
<arg value="--set-rpath"/><arg value="$ORIGIN"/>
<arg value="libboxD.so"/>
</exec>
<exec executable="patchelf" dir="${apron.path}/japron" failonerror="true">
<arg value="--set-rpath"/><arg value="$ORIGIN"/>
<arg value="libjapron.so"/>
</exec>
<exec executable="patchelf" dir="${apron.path}/japron" failonerror="true">
<arg value="--set-rpath"/><arg value="$ORIGIN"/>
<arg value="libjgmp.so"/>
</exec>
<exec executable="patchelf" dir="${apron.path}/octagons" failonerror="true">
<arg value="--set-rpath"/><arg value="$ORIGIN"/>
<arg value="liboctD.so"/>
</exec>
<exec executable="patchelf" dir="${apron.path}/newpolka" failonerror="true">
<arg value="--set-rpath"/><arg value="$ORIGIN"/>
<arg value="libpolkaMPQ.so"/>
</exec>

<!-- copy library files into directory to be published for IVY -->
<copy file="${apron.path}/japron/apron.jar"
tofile="apron-${apron.version}.jar"/>
<copy file="${apron.path}/japron/gmp.jar"
tofile="gmp-${apron.version}.jar"/>
<copy file="${apron.path}/apron/libapron.so"
tofile="libapron-${apron.version}.so"/>
<copy file="${apron.path}/box/libboxD.so"
tofile="libboxD-${apron.version}.so"/>
<copy file="${apron.path}/japron/libjapron.so"
tofile="libjapron-${apron.version}.so"/>
<copy file="${apron.path}/japron/libjgmp.so"
tofile="libjgmp-${apron.version}.so"/>
<copy file="${apron.path}/octagons/liboctD.so"
tofile="liboctD-${apron.version}.so"/>
<copy file="${apron.path}/newpolka/libpolkaMPQ.so"
tofile="libpolkaMPQ-${apron.version}.so"/>
</target>

<target name="publish-apron" depends="package-apron, load-ivy"
description="Publish Apron binaries to Ivy repository.">
<ivy:resolve conf="solver-apron" file="solvers_ivy_conf/ivy_apron.xml" />
<publishToRepository solverName="Apron" solverVersion="${apron.version}"/>
</target>
</project>
7 changes: 5 additions & 2 deletions lib/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ SPDX-License-Identifier: Apache-2.0
<license name="The Apache Software License, Version 2.0" url="http://www.apache.org/licenses/LICENSE-2.0.txt"/>

<description homepage="https://github.com/sosy-lab/java-smt">
Java wrapper for SMT solvers like Z3, MathSAT5, SMTInterpol, Princess, CVC4, CVC5, Boolector, and Yices2.
Java wrapper for SMT solvers like Z3, MathSAT5, SMTInterpol, Princess, CVC4, CVC5,
Boolector, Yices2, OpenSMT and Apron.
</description>
</info>

Expand All @@ -41,6 +42,7 @@ SPDX-License-Identifier: Apache-2.0
<conf name="runtime-cvc5" extends="core" description="only one solver included"/>
<conf name="runtime-boolector" extends="core" description="only one solver included"/>
<conf name="runtime-yices2" extends="core" description="only one solver included"/>
<conf name="runtime-apron" extends="core" description="only one solver included"/>

<!-- The normal dependencies with all solvers included. -->
<conf name="runtime"
Expand All @@ -49,7 +51,7 @@ SPDX-License-Identifier: Apache-2.0

<!-- The normal dependencies with all solvers included, except those unter GPL. -->
<conf name="runtime-without-gpl"
extends="runtime-mathsat,runtime-opensmt,runtime-optimathsat,runtime-smtinterpol,runtime-princess,runtime-z3,runtime-cvc4,runtime-cvc5,runtime-boolector"
extends="runtime-mathsat,runtime-opensmt,runtime-optimathsat,runtime-smtinterpol,runtime-princess,runtime-z3,runtime-cvc4,runtime-cvc5,runtime-boolector,runtime-apron"
description="all solvers included, except those unter GPL"/>

<!-- Dependencies needed for building or running tests. -->
Expand Down Expand Up @@ -165,6 +167,7 @@ SPDX-License-Identifier: Apache-2.0
<dependency org="org.sosy_lab" name="javasmt-solver-cvc4" rev="1.8-prerelease-2020-06-24-g7825d8f28" conf="runtime-cvc4->solver-cvc4" />
<dependency org="org.sosy_lab" name="javasmt-solver-cvc5" rev="1.0.5-g4cb2ab9eb" conf="runtime-cvc5->solver-cvc5" />
<dependency org="org.sosy_lab" name="javasmt-solver-boolector" rev="3.2.2-g1a89c229" conf="runtime-boolector->solver-boolector" />
<dependency org="org.sosy_lab" name="javasmt-solver-apron" rev="0.9.14-g718470b" conf="runtime-apron->solver-apron" />

<!-- additional JavaSMT components with Solver Binaries -->
<dependency org="org.sosy_lab" name="javasmt-yices2" rev="4.1.1-59-gaf9c0520c" conf="runtime-yices2->runtime; contrib->sources" />
Expand Down
1 change: 1 addition & 0 deletions lib/native/x86_64-linux/libapron.so
1 change: 1 addition & 0 deletions lib/native/x86_64-linux/libboxD.so
1 change: 1 addition & 0 deletions lib/native/x86_64-linux/libjapron.so
1 change: 1 addition & 0 deletions lib/native/x86_64-linux/libjgmp.so
1 change: 1 addition & 0 deletions lib/native/x86_64-linux/liboctD.so
1 change: 1 addition & 0 deletions lib/native/x86_64-linux/libpolkaMPQ.so
41 changes: 41 additions & 0 deletions solvers_ivy_conf/ivy_apron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
This file is part of JavaSMT,
an API wrapper for a collection of SMT solvers:
https://github.com/sosy-lab/java-smt

SPDX-FileCopyrightText: 2024 Dirk Beyer <https://www.sosy-lab.org>

SPDX-License-Identifier: Apache-2.0
-->

<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="org.sosy_lab" module="javasmt-solver-apron">
<license name="GNU Lesser General Public License" url="https://github.com/antoinemine/apron/blob/master/COPYING"/>
<description>
Apron Numerical Abstract Domain library.
Apron provided with GNU Lesser General Public License.
</description>
</info>

<configurations>
<conf name="solver-apron" />
</configurations>

<publications defaultconf="solver-apron">
<artifact name="apron" conf="solver-apron"/>
<artifact name="gmp" conf="solver-apron"/>
<artifact name="libjapron" conf="solver-apron" type="shared-object" ext="so"/>
<artifact name="libjgmp" conf="solver-apron" type="shared-object" ext="so"/>
<artifact name="libapron" conf="solver-apron" type="shared-object" ext="so"/>
<artifact name="libboxD" conf="solver-apron" type="shared-object" ext="so"/>
<artifact name="liboctD" conf="solver-apron" type="shared-object" ext="so"/>
<artifact name="libpolkaMPQ" conf="solver-apron" type="shared-object" ext="so"/>
</publications>

<dependencies></dependencies>

</ivy-module>
7 changes: 6 additions & 1 deletion src/org/sosy_lab/java_smt/SolverContextFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.sosy_lab.java_smt.delegate.logging.LoggingSolverContext;
import org.sosy_lab.java_smt.delegate.statistics.StatisticsSolverContext;
import org.sosy_lab.java_smt.delegate.synchronize.SynchronizedSolverContext;
import org.sosy_lab.java_smt.solvers.apron.ApronSolverContext;
import org.sosy_lab.java_smt.solvers.boolector.BoolectorSolverContext;
import org.sosy_lab.java_smt.solvers.cvc4.CVC4SolverContext;
import org.sosy_lab.java_smt.solvers.cvc5.CVC5SolverContext;
Expand Down Expand Up @@ -57,7 +58,8 @@ public enum Solvers {
BOOLECTOR,
CVC4,
CVC5,
YICES2
YICES2,
APRON
}

@Option(secure = true, description = "Export solver queries in SmtLib format into a file.")
Expand Down Expand Up @@ -290,6 +292,9 @@ private SolverContext generateContext0(Solvers solverToCreate)
case BOOLECTOR:
return BoolectorSolverContext.create(config, shutdownNotifier, logfile, randomSeed, loader);

case APRON:
return ApronSolverContext.create(nonLinearArithmetic, shutdownNotifier, logger);

default:
throw new AssertionError("no solver selected");
}
Expand Down
Loading