HOL-Theorem-Prover / HOL

Canonical sources for HOL4 theorem-proving system. Branch develop is where “mainline development” occurs; when develop passes our regression tests, master is merged forward to catch up.
https://hol-theorem-prover.org
Other
630 stars 142 forks source link

Zero-terminated REPL #1311

Closed digama0 closed 2 months ago

digama0 commented 2 months ago

This adds a new flag --zero to hol, which when enabled in conjunction with --repl causes HOL to use a zero-terminated REPL. This has the following semantics:

This resolves some parsing issues I encountered when writing the VSCode wrapper over the REPL.

mn200 commented 2 months ago

Nice!

mn200 commented 2 months ago

This may well turn out to be something that is constantly exercised, making explicit tests unnecessary, but just in case, can you think about putting something into a test directory for the regression machinery to check please?

digama0 commented 2 months ago

Sure, although you'll have to walk me through what that entails

digama0 commented 2 months ago

(I'm going to start working on the vscode parser for this format shortly, which may uncover more bugs.)

mn200 commented 2 months ago

For a shell-level thing like this, I guess you could just add a Holmakefile target that runs a specified file into a built --zero REPL and then compares the result of the output with an "expected" file. E.g., in tools/Holmake/tests/quote-filter, we have

all: $(DEPS)
        $(protect $(HOLDIR)/bin/unquote) < input > output
        $(protect $(HOLDIR)/tools/cmp/cmp.exe) output expected-$(ML_SYSNAME)