✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Consider the following Prolog program:
teaches(chris, history).teaches(chris, english).teaches(chris, drama).teaches(maria, physics). studies(alice, english).studies(jake, english).studies(emily, drama).studies(alex, physics).
What is an expected output of the query below, which uses a cut (!)?
?- teaches(chris, Course), !, studies(Student, Course).