/* Penguin problem in Picat. From Alma-0 program penguin.a0: """ This program shows that it is possible to use Alma-0 for nonmonotonic reasoning. We stipulate the following assumptions. - The birds which are not abnormal fly (i.e., birds usually fly). - The penguins are abnormal. - Penguins and eagles are birds. - Tweety is a penguin and Toto is an eagle. The problem is to deduce which of these two birds flies. """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ % import util. % import cp. main => go. go => All = findall(B,fly(B)), println(All), nl. index(-) penguin(tweety). index(-) eagle(toto). ab(Bird) => penguin(Bird). bird(Bird) => penguin(Bird); eagle(Bird). fly(Bird) => bird(Bird), not ab(Bird).