Package ru.bmstu.datalog.data

Examples of ru.bmstu.datalog.data.Rule


   * Rule ::= Predicate :- Predicate (',' Predicate)*
   * @return {@link Rule}
   * @throws Exception
   */
  private static Rule parseRule() throws Exception {   
    Rule rule = new Rule();
    rule.setHead(parsePredicate());
   
    parseString(":-");
   
    rule.addToBody(parsePredicate());
   
    while (skipSymbol(','))
      rule.addToBody(parsePredicate());
   
    parseSymbol('.');
   
    return rule;
  }
View Full Code Here


       
        ArrayList<Predicate> answerBody = new ArrayList<Predicate>();
        for (Predicate predicate : rule.getBody())
          answerBody.add(unifier.unifyPredicate(predicate));
       
        answer.add(new Rule(answerHead, answerBody));
      }
    }
    return answer;
  }
View Full Code Here

TOP

Related Classes of ru.bmstu.datalog.data.Rule

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.