Class WhoKilledAgatha


  • public class WhoKilledAgatha
    extends ExampleFD
    Who killed agatha? (The Dreadsbury Mansion Murder Mystery).

    This is a standard benchmark for theorem proving. http://www.lsv.ens-cachan.fr/~goubault/H1.dist/H1.1/Doc/h1003.html """ Someone in Dreadsbury Mansion killed Aunt Agatha. Agatha, the butler, and Charles live in Dreadsbury Mansion, and are the only ones to live there. A killer always hates, and is no richer than his victim. Charles hates noone that Agatha hates. Agatha hates everybody except the butler. The butler hates everyone not richer than Aunt Agatha. The butler hates everyone whom Agatha hates. Noone hates everyone. Who killed Agatha? """

    Originally from F. J. Pelletier: Seventy-five problems for testing automatic theorem provers. Journal of Automated Reasoning, 2: 191–216, 1986.

    Compare with the following models: - MiniZinc: http://www.hakank.org/minizinc/who_killed_agatha.mzn - Comet: http://www.hakank.org/comet/who_killed_agatha.mzn - Gecode: http://www.hakank.org/gecode/who_killed_agatha.cpp

    This Choco model was created by Hakan Kjellerstrand (hakank@bonetmail.com) Also, see my Choco page: http://www.hakank.org/choco/

    This JaCoP model was created by Hakan Kjellerstrand (hakank@bonetmail.com) http://www.hakank.org/JaCoP/ .

    Version:
    4.7
    • Constructor Detail

      • WhoKilledAgatha

        public WhoKilledAgatha()
    • Method Detail

      • model

        public void model()
        Description copied from class: ExampleFD
        It specifies a standard way of modeling the problem.
        Specified by:
        model in class ExampleFD
      • search

        public boolean search()
        Description copied from class: ExampleFD
        It specifies simple search method based on input order and lexigraphical ordering of values.
        Overrides:
        search in class ExampleFD
        Returns:
        true if there is a solution, false otherwise.
      • main

        public static void main​(java.lang.String[] args)
        It runs the program which solves the logic puzzle "Who killed Agatha".
        Parameters:
        args - parameters (none)