ExamplesJaCoP
Class WhoKilledAgatha
java.lang.Object
ExamplesJaCoP.Example
ExamplesJaCoP.WhoKilledAgatha
public class WhoKilledAgatha
- extends Example
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/ .
- Author:
- Hakan Kjellerstrand and Radoslaw Szymanek
|
Method Summary |
static void |
main(java.lang.String[] args)
It runs the program which solves the logic puzzle "Who killed Agatha". |
void |
model()
It specifies a standard way of modeling the problem. |
boolean |
search()
It specifies simple search method based on input order and lexigraphical
ordering of values. |
| Methods inherited from class ExamplesJaCoP.Example |
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WhoKilledAgatha
public WhoKilledAgatha()
model
public void model()
- Description copied from class:
Example
- It specifies a standard way of modeling the problem.
- Specified by:
model in class Example
search
public boolean search()
- Description copied from class:
Example
- It specifies simple search method based on input order and lexigraphical
ordering of values.
- Overrides:
search in class Example
- 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 -