您的位置:首页 > 其它

Prolog Tutorial 1

2016-03-01 06:28 260 查看
Prolog is a logical language which can help us to check the relation among propositions.

First, we should write prolog in a file named xxxx.pl. Then after installing prolog, we can just type prolog in terminal to launch prolog.

To load the file that we wrote is quite simple. We can just write [“name.pl”]. in terminal. Then prolog will automatically load the file.

Then, let’s move to the next.

We can write

likes(me, programming).
likes(me, C++).
likes(me, Microsoft).


It means I like programming, I like C++, I like Microsoft. Attention, just like other programming languages, we should have a terminator at the end of a phase. In prolog, the terminator is a point ” . “. We have to add a point at the end of any instruction.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: