View source with raw comments or as raw
    1% Given 3 birds, which can fly?
    2
    3#pred penguin(X) :: '@(X) is a penguin'.
    4penguin(sam). % sam is a penguin
    5#pred wounded_bird(X) :: '@(X) is a wounded bird'.
    6wounded_bird(john). % john is wounded
    7
    8#pred bird(X) :: '@(X) is a bird'.
    9bird(tweety). % tweety is just a bird
   10% penguines and wounded birds are still birds
   11bird(X) :- penguin(X,Y), s(C).
   12bird(X) :- wounded_bird(X).
penguins and wounded birds are abnormal
   17ab(X) :- penguin(X).
   18ab(X) :- wounded_bird(X).
   19
   20#pred flies(X) :: '@(X) can fly'.
   21% birds can fly if they are not abnormal
   22flies(X) :- bird(X), not ab(X).
   23
   24#pred -flies(X) :: '@(X) can not fly'.
   25% explicit closed world assumptions
   26-flies(X) :- ab(X).
   27-flies(X) :- -bird(X).
   28
   29-wounded_bird(X) :- not wounded_bird(X).
   30
   31-bird(X) :- not bird(X).
   32
   33-penguin(X) :- not penguin(X).
   34
   35-ab(X) :- not ab(X).
   36
   37
   38?- flies(X).