如何在 MacOS 查询期间强制停止 SWI-prolog
How to force stop SWI-prolog during query on MacOS
有没有办法在查询期间强制停止 SWI-Prolog?例如,假设我有一个进入无限循环的谓词 (bad_foo(X)
)。当我在 SWI-Prolog 中查询这个谓词时,查询会运行一段时间(有时是几分钟)然后失败 ERROR: Out of local stack
:
?- bad_foo(1).
(% and after a long wait...)
ERROR: Out of local stack
我的问题:如何在查询用完堆栈之前跳过等待并停止查询?简而言之,我正在寻找 Ctrl + C 来自 Linux.
的等价物
我在 MacOS 上使用 SWI-Prolog 版本 7.6.4。
虽然Ctrl + C不起作用但是按Cmd + C 暂停查询并提示一条帮助消息,然后可以通过键入 a for abort:
来中止查询
?- bad_foo(1).
(% press Cmd+C and you'll be prompted:)
Action (h for help) ?
(% press a to abort)
abort
?-
有没有办法在查询期间强制停止 SWI-Prolog?例如,假设我有一个进入无限循环的谓词 (bad_foo(X)
)。当我在 SWI-Prolog 中查询这个谓词时,查询会运行一段时间(有时是几分钟)然后失败 ERROR: Out of local stack
:
?- bad_foo(1).
(% and after a long wait...)
ERROR: Out of local stack
我的问题:如何在查询用完堆栈之前跳过等待并停止查询?简而言之,我正在寻找 Ctrl + C 来自 Linux.
的等价物我在 MacOS 上使用 SWI-Prolog 版本 7.6.4。
虽然Ctrl + C不起作用但是按Cmd + C 暂停查询并提示一条帮助消息,然后可以通过键入 a for abort:
来中止查询?- bad_foo(1).
(% press Cmd+C and you'll be prompted:)
Action (h for help) ?
(% press a to abort)
abort
?-