Skip to content

Commit 9db426d

Browse files
coderabbitai[bot]hyperpolymath
authored andcommitted
fix(coq): reject duplicate theory basenames and read unterminated _CoqProject lines in assumption census
1 parent 5a24ec2 commit 9db426d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎proofs/coq/census-assumptions.sh‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ for d in common category quantum lambda filesystem physics ond malbolge; do
4040
fi
4141
while IFS= read -r f; do
4242
if [ -f "$f" ]; then
43+
base="$(basename "${f%.v}")"
44+
if [ -n "${base_root[$base]+x}" ]; then
45+
echo "CENSUS FAILED: duplicate theory basename '$base' in '$f'" >&2
46+
exit 1
47+
fi
4348
theories+=("$f")
44-
base_root["$(basename "${f%.v}")"]="$root"
49+
base_root["$base"]="$root"
4550
fi
4651
done < <(find "$HERE/$d" -maxdepth 1 -name "*.v" | sort)
4752
fi
@@ -83,7 +88,7 @@ if command -v coqc >/dev/null 2>&1 && [ -f "$HERE/common/CNO.vo" ]; then
8388
} > "$tmp/Census.v"
8489

8590
RFLAGS=()
86-
while read -r flag dir ns; do
91+
while read -r flag dir ns || [ -n "$flag" ]; do
8792
[ "$flag" = "-R" ] && RFLAGS+=("-R" "$HERE/$dir" "$ns")
8893
done < "$HERE/_CoqProject"
8994

0 commit comments

Comments
 (0)