Package stanfordlogic.prover

Examples of stanfordlogic.prover.VariableFact


  /* (non-Javadoc)
   * @see tud.gamecontroller.game.jocular.ReasonerInterface#isLegal(tud.gamecontroller.game.jocular.State, tud.gamecontroller.game.Role, tud.gamecontroller.game.Move)
   */
  public synchronized boolean isLegal(ProofContext state, RoleInterface<Term> role, MoveInterface<Term> move) {
    return stanfordlogicReasoner.getAnAnswer(new VariableFact(parser.TOK_LEGAL, role.getTerm().getExpr(), move.getTerm().getExpr()), state)!=null;
  }
View Full Code Here


  /* (non-Javadoc)
   * @see tud.gamecontroller.game.jocular.ReasonerInterface#GetGoalValue(tud.gamecontroller.game.jocular.State, tud.gamecontroller.game.Role)
   */
  public synchronized int getGoalValue(ProofContext state, RoleInterface<Term> role) {
    GroundFact f=stanfordlogicReasoner.getAnAnswer(new VariableFact(parser.TOK_GOAL, role.getTerm().getExpr(), TermVariable.makeTermVariable()), state);
    return Integer.parseInt(f.getTerm(1).toString(parser.getSymbolTable()));
  }
View Full Code Here

  /* (non-Javadoc)
   * @see tud.gamecontroller.game.jocular.ReasonerInterface#GetLegalMoves(tud.gamecontroller.game.jocular.State, tud.gamecontroller.game.Role)
   */
  public synchronized Collection<? extends MoveInterface<Term>> getLegalMoves(ProofContext state, RoleInterface<Term> role) {
    Iterable<GroundFact> legalFacts=stanfordlogicReasoner.getAllAnswersIterable(new VariableFact(parser.TOK_LEGAL, role.getTerm().getExpr(), TermVariable.makeTermVariable()), state);
    Collection<MoveInterface<Term>> moveslist=new LinkedList<MoveInterface<Term>>();
        for (GroundFact fact : legalFacts) {
          moveslist.add(new Move<Term>(new Term(parser.getSymbolTable(), fact.getTerm(1))));
        }
    return moveslist;
View Full Code Here

TOP

Related Classes of stanfordlogic.prover.VariableFact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.