-
Notifications
You must be signed in to change notification settings - Fork 3
/
value-inference.sh
executable file
·56 lines (43 loc) · 1.66 KB
/
value-inference.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
JSR308=$(cd $(dirname "$0")/.. && pwd)
echo "$JSR308"/value-inference
CFI=$JSR308/checker-framework-inference
VI=$JSR308/value-inference
VIPATH=$VI/build/classes/java/main:$VI/build/resources/main:$VI/build/libs/value-inference.jar
export AFU=$JSR308/annotation-tools/annotation-file-utilities
export PATH=$AFU/scripts:$PATH
CHECKER=value.ValueChecker
SOLVER=value.solver.ValueSolverEngine
DEBUG_SOLVER=checkers.inference.solver.DebugSolver
IS_HACK=true
# SOLVER="$DEBUG_SOLVER"
# IS_HACK=false
# DEBUG_CLASSPATH=""
if [ -n "$1" ] && [ $1 = "true" ]; then
SOLVERARGS=solver=Z3smt,optimizingMode=true,collectStatistics=true,writeSolutions=true,noAppend=true
else
SOLVERARGS=solver=Z3smt,collectStatistics=true,writeSolutions=true,noAppend=true
fi
export CLASSPATH=$VIPATH:$DEBUG_CLASSPATH:.
export external_checker_classpath=$VIPATH
CFI_LIB=$CFI/lib
export DYLD_LIBRARY_PATH=$CFI_LIB
export LD_LIBRARY_PATH=$CFI_LIB
export JAVA_LIBRARY_PATH=$CFI_LIB
# NOTE: ROUNDTRIP mode actually writes out files to annotated, INFER mode only
# performs inference without writing to annotated
# Inference
if [ -n "$1" ] && [ $1 = "true" ]; then
$CFI/scripts/inference-dev -m ROUNDTRIP --checker "$CHECKER" \
--solver "$SOLVER" --solverArgs="$SOLVERARGS" \
--hacks="$IS_HACK" -afud ./annotated "${@:2}"
else
# Logging level set to SEVERE to hide output spam
# --logLevel "SEVERE" \
# see java.util.logging.Level
$CFI/scripts/inference-dev -m ROUNDTRIP --checker "$CHECKER" \
--solver "$SOLVER" --solverArgs="$SOLVERARGS" \
--logLevel "INFO" \
--hacks="$IS_HACK" -afud ./annotated "$@"
# --cfArgs "-doe" \
fi