Prolog 给出错误“未定义的过程"尝试使用时:- [英] Prolog gives error "undefined procedure" when trying to use :-

查看:48
本文介绍了Prolog 给出错误“未定义的过程"尝试使用时:-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 上使用 SWI-Prolog 并收到以下错误:

I'm using SWI-Prolog on Windows and am getting the following error:

14 ?- parent(X, Y) :- child(Y, X).
ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct)

我不完全确定发生了什么,因为这在上周起作用了,而且我刚刚开始学习 Prolog.

I'm not entirely sure what's going on, as this worked last week and I am just starting to learn Prolog.

推荐答案

FAQ 说明了一切:http://www.swi-prolog.org/FAQ/ToplevelMode.html

The FAQ says it all: http://www.swi-prolog.org/FAQ/ToplevelMode.html

您需要创建一个文件并在那里编写带有规则的程序.顶级命令行将只允许您发出查询.

You need to create a file and write your program with rules there. The top level command line will only allow you to issue queries.

这篇关于Prolog 给出错误“未定义的过程"尝试使用时:-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆