Zebra puzzle

You are encouraged to solve this task according to the task description, using any language you may know.
The Zebra puzzle, a.k.a. Einstein's Riddle,
is a logic puzzle which is to be solved programmatically.



It has several variants, one of them this:

   There are five houses.
   The English man lives in the red house.
   The Swede has a dog.
   The Dane drinks tea.
   The green house is immediately to the left of the white house.
   They drink coffee in the green house.
   The man who smokes Pall Mall has birds.
   In the yellow house they smoke Dunhill.
   In the middle house they drink milk.
   The Norwegian lives in the first house.
   The man who smokes Blend lives in the house next to the house with cats.
   In a house next to the house where they have a horse, they smoke Dunhill.
   The man who smokes Blue Master drinks beer.
   The German smokes Prince.
   The Norwegian lives next to the blue house.
   They drink water in a house next to the house where they smoke Blend. 

The question is, who owns the zebra?

Additionally, list the solution for all the houses.

Optionally, show the solution is unique.



Related tasks

   Dinesman's multiple-dwelling problem
   Twelve statements


 
remove is op x xs {filter (not (x =)) xs}
 
append_map is transformer func op seq { \
  reduce (op x xs { (func x) link xs}) (seq append []) }
 
permutations is op seq { \
  if empty seq then [[]] else \
    (append_map \
      (op head {each (op tail {head hitch tail}) \
                     (permutations (remove head seq))}) \
      seq) \
  endif}
 
f is find
tokenize is op str{string_split ' ' str}
mk is tr pred op str {filter pred permutations tokenize str}
eq is op x xs y ys{f x xs = f y ys}
adj is op x xs y ys{1 = abs(f x xs - f y ys)}
 
run is  { \
  men := mk (op xs {0 = f 'norwegian' xs}) \
    'danish english german norwegian swedish'; \
  colors := mk (op xs {1 = ((f 'white' xs) - (f 'green' xs))}) \
    'blue green red white yellow'; \
  drinks := mk (op xs {2 = f 'milk' xs}) 'beer coffee milk tea water'; \
  pets := mk (op xs {l}) 'birds cats dog horse zebra'; \
  smokes := mk (op xs {l}) 'blend blue-master dunhill pall-mall prince'; \
  for m with men do \
    for c with colors do \
      if  (eq 'english' m 'red' c) and \
          (adj 'norwegian' m 'blue' c) then \
        for d with drinks do \
          if  (eq 'danish' m 'tea' d) and \
              (eq 'coffee' d 'green' c) then \
            for s with smokes do \
              if  (eq 'yellow' c 'dunhill' s) and \
                  (eq 'blue-master' s 'beer' d) and \
                  (eq 'german' m 'prince' s) then \
                for p with pets do \
                  if  (eq 'birds' p 'pall-mall' s) and \
                      (eq 'swedish' m 'dog' p) and \
                      (adj 'blend' s 'cats' p) and \
                      (adj 'horse' p 'dunhill' s) then \
                    write (0 blend (p m c d s)) \
                  endif \
                endfor \
              endif \
            endfor \
          endif \
        endfor \
      endif \
    endfor \
  endfor }
 
abs(time - (run; time))
 