【发布时间】:2018-09-20 23:03:09
【问题描述】:
为后续编写 Prolog 程序。我写了所有的东西,我需要知道最后两个是不是我写的。
1. saman likes maths.
2. saman likes science.
3. udara likes maths.
4. fazal likes science.
5. fazal likes music.
6. geetha likes history.
7. geetha likes science.
8. geetha likes music.
9. those who like maths and science will follow engineering for advance level.
10. those who likes history or music will follow art for advance level.
这对最后两个正确吗?
student(X):- like(X,maths_and_science),follow(X,engineering).
student(X):- likes(X,history_or_music), follow(X,art).
-
我不知道如何编写 Prolog 查询以供关注。
1) Does saman like maths or music? 2) Who likes science and music? 3) who will do engineering?
请帮帮我。
【问题讨论】:
-
我认为在你实现规则之前,首先需要定义predicates和functors对应的语义。但最后两个 - 据我所知 - 不正确。
标签: prolog