Debug TLAPS proof manager with ocamldebug on Ubuntu Linux 18.04

by lemmster
GNU/Linux ◆ xterm-256color ◆ bash 340 views

sudo apt-get install opam ocaml

git clone https://github.com/tlaplus/tlapm

./configure --prefix=$(pwd) # Install into current directory
make all install
cd src/
make debug
cd -


export PATH=$PATH:/usr/local/lib/tlaps/bin "Reuse back-end provers from TLAPS standard installation in /usr/local/lib/tlaps!"

ocamldebug src/tlapm.byte ../DummyProofs.tla

How to use ocamldebug

Documentation is at https://caml.inria.fr/pub/docs/manual-ocaml/debugger.html

Debug in VSCode

  • Install earlybird (wwitch to minimum ocaml version required by it)

    opam switch create 4.06.1 
    eval $(opam env)
    opam install earlybird
    
  • Install https://github.com/hackwaly/vscode-ocaml-debugger into VSCode

  • Launch code . in tlapm/ directory from the current shell

  • Launch config:

markus@avocado:/tmp/TLA/tlapm(master)$ cat .vscode/launch.json 
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "OCaml",
            "type": "ocamldebug",
            "request": "launch",
            "program": "${workspaceRoot}/src/tlapm.byte",
            "arguments": [
                 "--debug", "verbose4"
                , "--cleanfp" 
            ,"../MyProofs.tla"],
            "console": "internalConsole",
            "stopOnEntry": false
        }
    ]
}

Recording of VSCode setup at https://youtu.be/Eu46FmhpR_0

More by lemmster

untitled 05:20

by lemmster

See all