11FROM ubuntu:22.04
2- LABEL description="This is a docker image for HOL4P4"
2+ LABEL description="Docker image for the PolyGram artifact (FMCAD 2026)"
3+
34ARG DEBIAN_FRONTEND=noninteractive
45ENV DEBCONF_NOWARNINGS="yes"
6+
57USER root
68
7- # First, get the repo
8- # RUN apt update
9- # RUN apt-get install -y build-essential git python3
10- # RUN git clone --depth 1 https://github.com/kth-step/HOL4P4.git
11- # Version without git
9+ # ── 1. System dependencies ────────────────────────────────────────────────────
10+ RUN apt-get update && apt-get install -y -q \
11+ build-essential git python3 file \
12+ zlib1g-dev libbz2-dev liblzma-dev wget sudo \
13+ opam make nano && \
14+ rm -rf /var/lib/apt/lists/*
15+
16+ # ── 2. Copy the full project into the image ───────────────────────────────────
17+ # (.dockerignore excludes the prebuilt cakeml/ folder)
1218COPY . /HOL4P4
1319
14- # This lets us use the same installation scripts
15- RUN apt update && apt-get install -y -q sudo
20+ # ── 3. Install Poly/ML 5.9.2 ─────────────────────────────────────────────────
21+ WORKDIR /HOL4P4
22+ RUN wget https://github.com/polyml/polyml/archive/refs/tags/v5.9.2.tar.gz && \
23+ tar -xvf v5.9.2.tar.gz && \
24+ cd polyml-5.9.2 && \
25+ ./configure --prefix=/usr && \
26+ make && \
27+ make install && \
28+ cd .. && rm -rf polyml-5.9.2 v5.9.2.tar.gz
29+
30+ # ── 4. Install HOL4 Trindemossen-2 ───────────────────────────────────────────
31+ WORKDIR /HOL4P4
32+ RUN git clone https://github.com/HOL-Theorem-Prover/HOL.git && \
33+ cd HOL && \
34+ git checkout trindemossen-2 && \
35+ sed -i 's/CFLAGS = -Wall -ffloat-store -fno-strict-aliasing.*/& -std=c++14/g' \
36+ src/HolSat/sat_solvers/minisat/Makefile && \
37+ sed -i 's/g++ -O3 Proof.o File.o zc2hs.cpp -o zc2hs.*/& -std=c++14/g' \
38+ src/HolSat/sat_solvers/zc2hs/Makefile && \
39+ poly < tools/smart-configure.sml && \
40+ bin/build
41+
42+ ENV PATH="/HOL4P4/HOL/bin:$PATH"
43+
44+ # ── 5. Install OPAM + OCaml ───────────────────────────────────────────────────
45+ RUN opam init --disable-sandboxing -y && \
46+ eval $(opam env)
47+
48+ # ── 6. Clone and build CakeML (vHOL-Trindemossen-2) fresh inside Docker ───────
49+ WORKDIR /HOL4P4
50+ RUN git clone https://github.com/CakeML/cakeml.git && \
51+ cd cakeml && \
52+ git checkout vHOL-Trindemossen-2 && \
53+ eval $(opam env) && \
54+ cd misc && Holmake && cd .. && \
55+ cd basis && Holmake && cd .. && \
56+ cd translator && Holmake && cd .. && \
57+ cd unverified/sexpr-bootstrap && Holmake && cd ../..
58+
59+ # ── 7. Make preprocessing scripts executable ─────────────────────────────────
60+ WORKDIR /HOL4P4
61+ RUN chmod +x hol/polygram/policy_test_cases*/prepp.sh
62+
1663
17- # Then, just run the regular install script
18- RUN ./HOL4P4/scripts/install.sh
19- WORKDIR /HOL4P4/
64+ # ── 8. Set working directory for reviewers ────────────────────────────────────
65+ WORKDIR /HOL4P4
2066
21- # Test compilation
22- # RUN export PATH=$PATH:/HOL4P4/HOL/bin && opam exec -- make hol
67+ # Reviewers run in order:
68+ # make hol
69+ # make polygram
70+ # make cake
71+ # make test
2372
24- ENTRYPOINT ["/bin/bash" , "--login" ]
73+ ENTRYPOINT ["/bin/bash" , "--login" ]
0 commit comments