MacOS使用Prolog命令行工具

1、看一下SWI-Prolog的安装说明,发现命令行工具在下面的路径

/Applications/SWI-Prolog.app/Contents/MacOS

2、修改PATH变量,添加SWI-Prolog命令行工具在下面的路径

#查看命令行工具
cd /Applications/SWI-Prolog.app/Contents/MacOS
ls

#查看PATH变量
echo "$PATH"

#修改PATH变量
vi $HOME/.bash_profile
#增加一行
export PATH=${PATH}:/Applications/SWI-Prolog.app/Contents/MacOS

3、重启命令行

#查看PATH变量
echo "$PATH"

#测试一下
swipl hello.pl 

Leave a Reply

Your email address will not be published. Required fields are marked *

*