Skip to content

Commit

Permalink
Require base/input propositions in order for games to pass validation,
Browse files Browse the repository at this point in the history
since they're part of the official GDL spec.
  • Loading branch information
samschreiber committed Nov 19, 2013
1 parent 01e13f5 commit 1ba33d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/org/ggp/base/validator/BasesInputsValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public void checkValidity(Game theGame) throws ValidatorException {
Set<GdlSentence> bases = prover.askAll(basesQuery, Collections.<GdlSentence>emptySet());
GdlSentence inputsQuery = GdlPool.getRelation(INPUT, new GdlTerm[] {X, Y});
Set<GdlSentence> inputs = prover.askAll(inputsQuery, Collections.<GdlSentence>emptySet());

if (bases.size() == 0) {
throw new ValidatorException("Could not find base propositions.");
} else if (inputs.size() == 0) {
throw new ValidatorException("Could not find input propositions.");
}

Set<GdlSentence> truesFromBases = new HashSet<GdlSentence>();
for (GdlSentence base : bases) {
truesFromBases.add(GdlPool.getRelation(TRUE, base.getBody()));
Expand Down

0 comments on commit 1ba33d0

Please sign in to comment.