for(Gdl gdl : description)
System.out.println(gdl);
//We want to start with a rule graph and follow the rule graph.
//Start by finding general information about the game
SentenceDomainModel model = SentenceDomainModelFactory.createWithCartesianDomains(description);
//Restrict domains to values that could actually come up in rules.
//See chinesecheckers4's "count" relation for an example of why this
//could be useful.
model = SentenceDomainModelOptimizer.restrictDomainsToUsefulValues(model);
if(verbose)
System.out.println("Setting constants...");
ConstantChecker constantChecker = ConstantCheckerFactory.createWithForwardChaining(model);
if(verbose)
System.out.println("Done setting constants");
Set<String> sentenceFormNames = SentenceForms.getNames(model.getSentenceForms());
boolean usingBase = sentenceFormNames.contains("base");
boolean usingInput = sentenceFormNames.contains("input");
//For now, we're going to build this to work on those with a
//particular restriction on the dependency graph:
//Recursive loops may only contain one sentence form.
//This describes most games, but not all legal games.
Multimap<SentenceForm, SentenceForm> dependencyGraph = model.getDependencyGraph();
if(verbose) {
System.out.print("Computing topological ordering... ");
System.out.flush();
}
ConcurrencyUtils.checkForInterruption();
List<SentenceForm> topologicalOrdering = getTopologicalOrdering(model.getSentenceForms(), dependencyGraph, usingBase, usingInput);
if(verbose)
System.out.println("done");
List<Role> roles = Role.computeRoles(description);
Map<GdlSentence, Component> components = new HashMap<GdlSentence, Component>();