Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这些事实注册(hazem,数学)。注册(hazem,科学)。依此类推,我想要学生(X,ListOfCourses)。返回列表中 X 正在学习的课程。
看看 findall/3 bagof/3, setof/3,例如:
student(X, ListOfCourses) :- findall(Courses, enroll(X, Courses), ListOfCourses).