saa*_*ame 6 prolog prolog-assert
我定义一个运算符如下:
:- op(500, xfx, =>).
Run Code Online (Sandbox Code Playgroud)
当我尝试这样的事情:
assert(a => b).
Run Code Online (Sandbox Code Playgroud)
Prolog引发了一个错误,上面写着"无权修改static_procedure(=>)/ 2".
有解决方案吗
你必须用另一个符号来代替(=>)/2
.可能(->)/2
是哪个是无法修改的控制结构.
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 6.1.3-116-gf1c7e06) ... ?- asserta((a -> b)). ERROR: asserta/1: No permission to modify static procedure `(->)/2' ERROR: Defined at /opt/gupu/pl-devel/lib/swipl-6.1.3/boot/init.pl:194 ?- op(500, xfx, =>). true. ?- asserta(a => b). true.