Skip to content

Commit e3dbbc1

Browse files
committed
clean oleans + precomp sed
1 parent 3c9f759 commit e3dbbc1

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

Benchmark/RunTrans.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ import Benchmark.Trans
1212

1313
-- TODO : replace with 6!!
1414
-- /- Transitivity benchmark -/
15-
bchmk 1 with pows 5 using trans 0
16-
bchmk 1 with pows 5 using trans 100
15+
bchmk 1 with pows 4 using trans 0
16+
bchmk 1 with pows 4 using trans 100

run-benchmark.sh

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,45 @@
44
# CONFIGURATION
55
# ==============================================================================
66

7+
# Default value for precompileModules
8+
PRECOMP=false
9+
10+
# Time format
11+
TIMEFORMAT="this took %R seconds"
12+
13+
# Parse command line arguments
14+
while [[ $# -gt 0 ]]; do
15+
case $1 in
16+
--precomp)
17+
PRECOMP="$2"
18+
shift 2
19+
;;
20+
*)
21+
echo "Unknown option: $1"
22+
echo "Usage: $0 [--precomp true|false]"
23+
exit 1
24+
;;
25+
esac
26+
done
27+
28+
# Validate precomp value
29+
if [[ "$PRECOMP" != "true" && "$PRECOMP" != "false" ]]; then
30+
echo "Error: --precomp must be 'true' or 'false'"
31+
exit 1
32+
fi
33+
34+
# Modify lakefile.toml
35+
echo "--- Setting precompileModules = $PRECOMP in lakefile.toml ---"
36+
if [[ -f "lakefile.toml" ]]; then
37+
# Use sed to replace the precompileModules line
38+
# This handles various formats: precompileModules = true/false with/without quotes
39+
# Empty string after -i means no backup (works on both Linux and macOS)
40+
sed -i '' "s/^precompileModules = .*/precompileModules = $PRECOMP/" lakefile.toml
41+
echo "Updated lakefile.toml"
42+
else
43+
echo "Warning: lakefile.toml not found"
44+
fi
45+
746
cmd_trans() {
847
lake build Benchmark.RunTrans
948
}
@@ -41,15 +80,16 @@ parse_lean_output() {
4180
'
4281
}
4382

44-
TIMEFORMAT="this took %R seconds"
83+
echo "--- Deleting .oleans ---"
84+
lake clean
4585

4686
echo "--- Running Benchmark: Transitivity ---"
4787
# Capture output and evaluate it
4888
eval $(time cmd_trans | parse_lean_output "FIG1_")
4989

5090

5191
echo "--- Running Benchmark: Depth ---"
52-
time eval $(cmd_depth | parse_lean_output "FIG2_")
92+
eval $(time cmd_depth | parse_lean_output "FIG2_")
5393

5494
{
5595
echo "Transitivity Benchmark"
@@ -175,4 +215,4 @@ if command -v pdflatex &> /dev/null; then
175215
echo "Done! Generated benchmark_results.pdf"
176216
else
177217
echo "Warning: pdflatex not found. The .tex file was created but not compiled."
178-
fi
218+
fi

0 commit comments

Comments
 (0)