Skip to content

Commit a853143

Browse files
KJ-22 Symbolic execution - tools support. Untested yet. On Windows don't work presumably because windows maude is on 32 bits.
1 parent b47fe4a commit a853143

File tree

6 files changed

+28
-7
lines changed

6 files changed

+28
-7
lines changed

symbolic/symbolic_01_max3.cIN.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ListItem(3) ListItem(#symInt(x)) ListItem(8)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ListItem(#symInt(e1)) ListItem(#symInt(e2)) ListItem(#symInt(x))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ListItem(#symInt(e1)) ListItem(#symInt(e2)) ListItem(#symInt(x))

tools/aux-kjrun.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (( "$#" != 11 )); then
1111
echo "Your command:"
1212
echo `basename $0` $@
1313
echo "Usage: `basename $0` --time <true|false> --timeout <timeout in s> \
14-
--mode <run|search|search-count|debug> --output <none|raw|pretty> \
14+
--mode <run|search|search-count|symbolic|symbolic-count|debug> --output <none|raw|pretty> \
1515
--kast-cache <true|false> \
1616
<javaFile>"
1717
exit 1
@@ -64,6 +64,11 @@ case "$MODE" in
6464
"search"|"search-count")
6565
KRUN_CMD="$KRUN_CMD --search-final -cModelCheck=\"true\""
6666
;;
67+
"symbolic"|"symbolic-count")
68+
IN_FILE=${JAVA_FILE%.java}.cIN.in
69+
IN_VALUE=$(<${IN_FILE})
70+
KRUN_CMD="$KRUN_CMD --search -cModelCheck=\"true\" -cPC=true -cIN=\"$IN_VALUE\""
71+
;;
6772
"debug")
6873
KRUN_CMD="$KRUN_CMD --debug -cModelCheck=\"false\""
6974
;;
@@ -93,7 +98,7 @@ if [ ${KAST_CACHE} == false ];
9398
eval ${PARSER_CMD}
9499
fi
95100

96-
if [ ${MODE} == "search-count" ];
101+
if [ ${MODE} == "search-count" ] || [ ${MODE} == "symbolic-count" ];
97102
then KRUN_CMD="$KRUN_CMD | grep \"Solution\" | wc -l"
98103
fi
99104

tools/kjkompile.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ case "$OPTION" in
3333
"threading")
3434
$KOMPILE_CMD -v -transition "transition-threading" java
3535
;;
36+
"symbolic")
37+
$KOMPILE_CMD -v --backend symbolic --symbolic-rules "symbolic-rule" java
38+
;;
3639
"latex")
3740
$KOMPILE_CMD -v --backend latex --doc-style "style=math" java
3841
;;
@@ -41,7 +44,7 @@ case "$OPTION" in
4144
;;
4245
*)
4346
echo "Invalid option: $OPTION"
44-
echo "Usage: `basename $0` or `basename $0` <exec|strictness|threading|latex|pdf>"
47+
echo "Usage: `basename $0` or `basename $0` <exec|strictness|threading|symbolic|latex|pdf>"
4548
exit 1
4649
;;
4750
esac

tools/kjrun.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if (( "$#" < 1 )) || (( "$#" > 2 )); then
66
echo "Your command:"
77
echo `basename $0` $@
88
echo "Usage: `basename $0` <javaFile>"
9-
echo "Or: `basename $0` <--pretty|--raw|--none|--search|--cached|--search-cached|--debug> <javaFile>"
9+
echo "Or: `basename $0` <--pretty|--raw|--none|--search|--cached|--search-cached|--debug|--symbolic> <javaFile>"
1010
echo "For more options use aux-kjrun.sh"
1111
exit 1
1212
fi
@@ -20,18 +20,24 @@ if (( "$#" == 1 ));
2020
JAVA_FILE=$2
2121
fi
2222

23-
# OS-dependent choice of default timeout
23+
# OS-dependent choice of timeout
2424
if [[ $(uname) == *Linux* ]]
2525
then DEFAULT_TIMEOUT=30
2626
else DEFAULT_TIMEOUT=120
2727
fi
2828

29-
# OS-dependent choice of default timeout
29+
# OS-dependent choice of timeout
3030
if [[ $(uname) == *Linux* ]]
3131
then SEARCH_TIMEOUT=60
3232
else SEARCH_TIMEOUT=120
3333
fi
3434

35+
# OS-dependent choice of timeout
36+
if [[ $(uname) == *Linux* ]]
37+
then SYMBOLIC_TIMEOUT=120
38+
else SYMBOLIC_TIMEOUT=240
39+
fi
40+
3541
case "$OPTION" in
3642
"--pretty")
3743
aux-kjrun.sh --time true --timeout ${DEFAULT_TIMEOUT} --mode run --output pretty --kast-cache false ${JAVA_FILE}
@@ -54,10 +60,14 @@ case "$OPTION" in
5460
"--debug")
5561
aux-kjrun.sh --time false --timeout 0 --mode debug --output pretty --kast-cache false ${JAVA_FILE}
5662
;;
63+
"--symbolic")
64+
aux-kjrun.sh --time true --timeout ${SYMBOLIC_TIMEOUT} --mode symbolic \
65+
--output pretty --kast-cache false ${JAVA_FILE}
66+
;;
5767
*)
5868
echo "Invalid option: $OPTION"
5969
echo "Usage: `basename $0` <javaFile>"
60-
echo "Or: `basename $0` <--pretty|--raw|--none|--search|--cached|--search-cached|--debug> <javaFile>"
70+
echo "Or: `basename $0` <--pretty|--raw|--none|--search|--cached|--search-cached|--debug|--symbolic> <javaFile>"
6171
echo "For more options use aux-kjrun.sh"
6272
exit 1
6373
;;

0 commit comments

Comments
 (0)