Download and Installation of Theorem Prover HOL

Posted by benwhitmore on Thu, 02 Dec 2021 16:41:30 +0100

HOL Download Installation

Install directly on windows:

1. Source download:

git clone (downloaded using git tools):
git clone https://github.com/HOL-Theorem-Prover/HOL.git

2. Download sml-system:

https://polyml.org/download.html

git clone https://github.com/polyml/polyml.git

cd E://Modelchecking
cd polyml
./configure

Report errors:

  1. Missing gcc compiler;
  2. Missing make;

Reason:

git-bash is a mingw64 environment, shell is bash, basically the same as linux, but it does not carry programs such as gcc and make.

Always fail to find c compiler under Path path;

  • Re-checked and configured environment variables;
  • The path is also a non-Chinese path without spaces.
  • Changing the downloaded gcc folder following the online tutorial was unsuccessful.

Windows 10 Configuration WSL (ubuntu18)

Re-read the HOL website documentation and learn that pure windows environments are not supported and that you need to install a WSL environment (i.e. windows subsystems of linux)
Consult WSL's on Microsoft windows Installation Tutorial , install the Linux environment.

ubuntu account: kaixuan
ubuntu password: lab

Tips:

  • Access the windows folder under WSL using:
    cd /mnt
  • If you want to access a wsl file on Windows, type:
    explorer.exe .

Reason:

When WSL is enabled and a Linux distribution is installed, a new file system separated from Windows NTFS C:\ will be installed. Drives. On Linux, no letters will be provided for the drives. Mount points will be provided for them. The root directory of the file system is the mount point for the root partition or folder (for / WSL) . Not all / content below is on the same drive. For example, on a laptop, I have two versions of Ubuntu (20.04 and 18.04) and Debian installed. If I open these distributions, use the command to select the home directory, and then enter the command, Windows File Explorer will open and show me the cd ~ explorer.exe. directory path for the distribution.

GIT can be installed on either WINDOWS or WSL. However, they cannot be shared.

Linux distributionWindows path to access home folder
Ubuntu 20.04\\wsl$\Ubuntu-20.04\home\username
Ubuntu 18.04\\wsl$\Ubuntu-18.04\home\username
Debian\\wsl$\Debian\home\username
Windows PowerShellC:\Users\username

If you are looking for access to the Windows file directory from the WSL distribution command line (instead of) use the access directory, as the Linux distribution considers the Windows file system to be a loaded C:\Users\username/mnt/c/Users/username drive.
[External chain picture transfer failed, source station may have anti-theft chain mechanism, it is recommended to save the picture and upload it directly (img-yYr5g385-1630589144728)(./WSL_Windows.png)]

1. Configure gcc, make:

sudo apt update
sudo apt install build-essential

You can use gcc-v and make-v commands to display their versions to verify that the installation was successful.

2. Install git:

sudo apt-get install git

3.git clone polyml:

git clone https://github.com/polyml/polyml.git

4. Compile, make, and install

./configure
make
make install

Notes on official documents:

GIT Source.

The released version has been extensively tested before being released. If you are using Poly/ML for real work this is the version you should use. The development version is kept in a GIT repository at GitHub (https://github.com/polyml). Note that the GIT code may change frequently and things may break. Bug fixes, though, are applied first to this so you may wish to try this if you have problems. To download the GIT version do the following:

git clone https://github.com/polyml/polyml.git

At this stage you can simply build Poly/ML in the normal way but this may not incorporate all the changes. In particular the compiler is not rebuilt by the normal build process so to do a complete recompile do the following:

./configure
make
make compiler
make install

When updating an existing directory from GIT it may well be worth running make distclean before the update to remove any old files.

The GIT repository contains the main development line but also bug fixes for released versions. These are branches such as fixes-5.8.

Error log during installation:

Makeinstall error prompt:

kaixuan@DESKTOP-MHHIDIM:~/polyml$ make install
Making install in libpolyml
make[1]: Entering directory '/home/kaixuan/polyml/libpolyml'
make[2]: Entering directory '/home/kaixuan/polyml/libpolyml'
 /bin/mkdir -p '/kaixuan/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libpolyml.la '/kaixuan/lib'
libtool: install: /usr/bin/install -c .libs/libpolyml.so.12.0.0 /kaixuan/lib/libpolyml.so.12.0.0
/usr/bin/install: cannot remove '/kaixuan/lib/libpolyml.so.12.0.0': Permission denied
Makefile:616: recipe for target 'install-libLTLIBRARIES' failed
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory '/home/kaixuan/polyml/libpolyml'
Makefile:892: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/kaixuan/polyml/libpolyml'
Makefile:708: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
kaixuan@DESKTOP-MHHIDIM:~/polyml$ sudo make install
[sudo] password for kaixuan:
Making install in libpolyml
make[1]: Entering directory '/home/kaixuan/polyml/libpolyml'
make[2]: Entering directory '/home/kaixuan/polyml/libpolyml'
 /bin/mkdir -p '/kaixuan/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libpolyml.la '/kaixuan/lib'
libtool: install: /usr/bin/install -c .libs/libpolyml.so.12.0.0 /kaixuan/lib/libpolyml.so.12.0.0
libtool: install: (cd /kaixuan/lib && { ln -s -f libpolyml.so.12.0.0 libpolyml.so.12 || { rm -f libpolyml.so.12 && ln -s libpolyml.so.12.0.0 libpolyml.so.12; }; })
libtool: install: (cd /kaixuan/lib && { ln -s -f libpolyml.so.12.0.0 libpolyml.so || { rm -f libpolyml.so && ln -s libpolyml.so.12.0.0 libpolyml.so; }; })
libtool: install: /usr/bin/install -c .libs/libpolyml.lai /kaixuan/lib/libpolyml.la
libtool: install: /usr/bin/install -c .libs/libpolyml.a /kaixuan/lib/libpolyml.a
libtool: install: chmod 644 /kaixuan/lib/libpolyml.a
libtool: install: ranlib /kaixuan/lib/libpolyml.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /kaixuan/lib
----------------------------------------------------------------------


Libraries have been installed in:
   /kaixuan/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

-------------------------------------

#### Run poly error message:
kaixuan@DESKTOP-MHHIDIM:~/polyml$ poly
poly: error while loading shared libraries: libpolyml.so.12: cannot open shared object file: No such file or directory

Solution inspiration:

View files in two directories

Files under New User Folder:

kaixuan@DESKTOP-MHHIDIM:/usr/local/lib$ ls
libpolymain.a  libpolymain.la  libpolyml.a  libpolyml.la  libpolyml.so  libpolyml.so.12  libpolyml.so.12.0.0  pkgconfig  polyml  python3.6

Under Shared Folders:

kaixuan@DESKTOP-MHHIDIM:/kaixuan/lib$ ls
libpolymain.a  libpolymain.la  libpolyml.a  libpolyml.la  libpolyml.so  libpolyml.so.12  libpolyml.so.12.0.0  pkgconfig  polyml

Solve:
Delete the compiled files under the shared folder;

Solution of minor errors:
File access rights are not sufficient, you need to give rights before operation;
Or use sudo directly;

The following errors were made:

kaixuan@DESKTOP-MHHIDIM:~/polyml$ make install
Making install in libpolyml
make[1]: Entering directory '/home/kaixuan/polyml/libpolyml'
make[2]: Entering directory '/home/kaixuan/polyml/libpolyml'
 /bin/mkdir -p '/kaixuan/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libpolyml.la '/kaixuan/lib'
libtool: install: /usr/bin/install -c .libs/libpolyml.so.12.0.0 /kaixuan/lib/libpolyml.so.12.0.0
/usr/bin/install: cannot remove '/kaixuan/lib/libpolyml.so.12.0.0': Permission denied
Makefile:616: recipe for target 'install-libLTLIBRARIES' failed
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory '/home/kaixuan/polyml/libpolyml'
Makefile:892: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/kaixuan/polyml/libpolyml'
Makefile:708: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

Topics: Ubuntu