Mac上使用VScode运行Prover9

如何在Mac上使用VScode运行Prover9

背景:mac上安装不了可视化Prover9,使用命令行又操作繁琐,于是乎另辟蹊径——使用VScode运行.p9文件。


操作步骤

1.下载Prover9(LADR-2009-11A.tar.gz)

链接:https://www.cs.unm.edu/~mccune/prover9/download/
解压并放入此路径下:Users/这里填你的用户名/

2.打开终端(terminal)

cd 到 Users/你的用户名/LADR-2009-11A
即Navigate to the unzipped folder and then use the ‘make all’ command to compile the files
然后依次输入以下命令:

  1. make all
  2. make test1
  3. make test2
  4. make test3

Once done compiling, it will prompt you to run the software tests (to make sure everything is ok).

3.仍是终端(terminal)

输入以下命令:

  1. open ~/.bash_profile
  2. 在文件中添加export PATH="/Users/这里填你的用户名/LADR-2009-11A/bin:$PATH",然后保存
  3. source ~/.bash_profile
  4. open ~/.zshrc
  5. 在文件中添加export PATH="/Users/这里填你的用户名/LADR-2009-11A/bin:$PATH",然后保存
  6. source ~/.zshrc

4.配置VScode

  1. 下载并安装VScode,链接:https://code.visualstudio.com/Download
  2. 打开vscode,点击1图标,然后搜索框中搜索2中的两个扩展打开vscode,点击1图标,然后搜索框中搜索2中的两个扩展
  3. 点击左下角设置突变,然后点击菜单栏第一条(蓝色)
    在这里插入图片描述
  4. 搜索框搜setting,选择图示item搜索框搜setting,选择图示item
    11.将以下代码拷贝进去(全替换),注意:.p9的路径改成你自己的路径!然后保存文件
 {
    "code-runner.executorMapByFileExtension": {
        ".p9":"export PATH=$PATH:/Users/这里填你的用户名/LADR-2009-11A/BIN && prover9 -f $fullFileName | prooftrans renumber | tee > $fileNameWithoutExt.txt | open $fileNameWithoutExt.txt",
        ".vb": "cd $dir && vbc /nologo $fileName && $dir$fileNameWithoutExt",
        ".vbs": "cscript //Nologo",
        ".scala": "scala",
        ".jl": "julia",
        ".cr": "crystal",
        ".ml": "ocaml",
        ".exs": "elixir",
        ".hx": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
        ".rkt": "racket",
        ".scm": "csi -script",
        ".ahk": "autohotkey",
        ".au3": "autoit3",
        ".kt": "cd $dir && kotlinc $fileName -include-runtime -d $fileNameWithoutExt.jar && java -jar $fileNameWithoutExt.jar",
        ".kts": "kotlinc -script",
        ".dart": "dart",
        ".pas": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
        ".pp": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
        ".d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
        ".hs": "runhaskell",
        ".nim": "nim compile --verbosity:0 --hints:off --run",
        ".csproj": "dotnet run --project",
        ".fsproj": "dotnet run --project",
        ".lisp": "sbcl --script",
        ".kit": "kitc --run",
        ".v": "v run",
        ".vsh": "v run",
        ".sass": "sass --style expanded",
        ".cu": "cd $dir && nvcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        ".ring": "ring"
    },
    "code-runner.clearPreviousOutput": true,
    "code-runner.saveAllFilesBeforeRun": true

}
  1. 新建一个.p9文件或者打开一个.p9文件,运行即可

参考链接:

https://www.youtube.com/watch?v=2Wdj3xsZ-ro&t=304s
https://gist.github.com/carmenchui/88da001d96ad7e3f73ffc2623a418f07
https://www.cs.unm.edu/~mccune/prover9/manual/2009-11A/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值