Skip to content

Commit 6be724b

Browse files
Fixed bugs and rebuild the API
1 parent 5f9025f commit 6be724b

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
</attributes>
2828
</classpathentry>
2929
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
30-
<classpathentry kind="lib" path="/home/lubuntu/SAHEED/gsoc/CODE/java-smt/lib/stpJavaAPI.jar"/>
30+
<classpathentry kind="lib" path="lib/stpJavaAPI.jar"/>
3131
<classpathentry kind="output" path="bin"/>
3232
</classpath>

lib/native/x86_64-linux/libstpJapi.so

-9.5 KB
Binary file not shown.

native-library-files/stp_project/build_raw_to_java_api.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PRJ_NAME=$(basename "$PRJ_DIR")
1919

2020
# confirm expected directory structure
2121
# MUST BE like java-smt/../../this_script.sh
22-
if [[ "$PRJ_NAME"!="java-smt" ]]
22+
if [[ "$PRJ_NAME" != "java-smt" ]]
2323
then
2424
echo "this script is not place in the proper directory" >&2
2525
echo "this script expects to reside in somewhere like\
@@ -29,7 +29,7 @@ fi
2929

3030
# set destination directory for final libraries
3131
JAR_LIB_DIR="${PRJ_DIR}/lib/"
32-
SO_LIB_DIR="${JAR_LIB_DIR}/native/x86_64-linux/
32+
SO_LIB_DIR="${JAR_LIB_DIR}/native/x86_64-linux/"
3333

3434

3535
# echo $FILE

native-library-files/stp_project/stpJ/StpJavaApi.i

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ struct Type {};
153153
%nodefaultctor WholeCounterExample;
154154
struct WholeCounterExample {};
155155

156-
156+
/*
157157
%inline%{
158158
159159
// typedef void* VC;
160160
161-
/* TODO: hanldle this in Java Code; Remove if confirmed. Envoronment configs
161+
// TODO: hanldle this in Java Code; Remove if confirmed. Envoronment configs
162162
struct Flags {
163163
const char a;
164164
const char c;
@@ -188,10 +188,11 @@ struct WholeCounterExample {};
188188
.w = 'w',
189189
.y = 'y'
190190
};
191-
*/
192191
193192
%}
193+
*/
194194

195+
%inline%{
195196

196197
/////////////////////////////////////////////////////////////////////////////
197198
/// API INITIALISATION AND CONFIG

src/org/sosy_lab/java_smt/solvers/stp/StpNativeApiTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,25 @@ public void testingSAT() {
8484
Expr x = StpJavaApi.vc_varExpr(stpContextVC, "x", StpJavaApi.vc_bvType(stpContextVC, width));
8585

8686
// Create bitvector x + x
87-
Expr xPlusx = StpJavaApi.vc_bvPlusExpr(stpContextVC, width, x, x);
87+
Expr xPlusx = StpJavaApi.vc_bvPlusExpr(stpContextVC, width, x, x); // Non-Formla can't assert
8888

8989
// Create bitvector constant 2
9090
Expr two = StpJavaApi.vc_bvConstExprFromInt(stpContextVC, width, 20);
9191

9292
// Create bitvector 2*x
93-
Expr xTimes2 = StpJavaApi.vc_bvMultExpr(stpContextVC, width, two, x);
93+
Expr xTimes2 = StpJavaApi.vc_bvMultExpr(stpContextVC, width, two, x); // Non-Formla can't assert
9494

9595
// Create bool expression x + x = 2*x
9696
Expr equality = StpJavaApi.vc_eqExpr(stpContextVC, xPlusx, xTimes2);
9797

98-
// StpJavaApi.vc_assertFormula(stpContextVC, StpJavaApi.vc_trueExpr(stpContextVC));
99-
StpJavaApi.vc_assertFormula(stpContextVC, xTimes2);
98+
StpJavaApi.vc_assertFormula(stpContextVC, StpJavaApi.vc_trueExpr(stpContextVC));
99+
StpJavaApi.vc_assertFormula(stpContextVC, equality);
100100

101101
// Print the assertions
102102
System.out.println("Assertions:\n");
103103
StpJavaApi.vc_printAsserts(stpContextVC, 0);
104-
System.out.println("Query:\n");
105-
StpJavaApi.vc_printQuery(stpContextVC);
104+
// System.out.println("Query:\n");
105+
// StpJavaApi.vc_printQuery(stpContextVC);
106106

107107
}
108108

0 commit comments

Comments
 (0)