Package org.ggp.base.util.gdl.model.assignments

Examples of org.ggp.base.util.gdl.model.assignments.Assignments


    Map<SentenceForm, ? extends Collection<GdlSentence>> completedSentenceFormValues = allSentences.getSentences().asMap();

    for (GdlSentence chosenNewSentence : chosenNewSentences) {
      Map<GdlVariable, GdlConstant> preassignments = GdlUtils.getAssignmentMakingLeftIntoRight(chosenLiteral, chosenNewSentence);
      if (preassignments != null) {
        Assignments assignments = new AssignmentsImpl(preassignments, rule, varDomains, functionInfoMap, completedSentenceFormValues);
        AssignmentIterator asnItr = assignments.getIterator();
        while (asnItr.hasNext()) {
          Map<GdlVariable, GdlConstant> assignment = asnItr.next();

          boolean allSatisfied = true;
          for (GdlLiteral literal : rule.getBody()) {
View Full Code Here


      for(GdlSentence alwaysTrueSentences : model.getSentencesListedAsTrue(curForm))
        trueFlowSentences.add(alwaysTrueSentences);
      for(GdlRule rule : model.getRules(curForm)) {
        GdlSentence head = rule.getHead();
        List<GdlVariable> varsInHead = GdlUtils.getVariables(head);
        Assignments assignments = AssignmentsFactory.getAssignmentsForRule(rule, model, functionInfoMap, Collections.EMPTY_MAP);

        AssignmentIterator asnItr = assignments.getIterator();
        while(asnItr.hasNext()) {
          Map<GdlVariable, GdlConstant> assignment = asnItr.next();
          boolean isGoodAssignment = true;

          GdlSentence transformedHead = CommonTransforms.replaceVariables(head, assignment);
View Full Code Here

      return;
    }

    Map<GdlSentence, Set<Component>> inputsToOr = new HashMap<GdlSentence, Set<Component>>();
    for(GdlRule rule : rules) {
      Assignments assignments = AssignmentsFactory.getAssignmentsForRule(rule, model, functionInfoMap, completedSentenceFormValues);

      //Calculate vars in live (non-constant, non-distinct) conjuncts
      Set<GdlVariable> varsInLiveConjuncts = getVarsInLiveConjuncts(rule, constantChecker.getConstantSentenceForms());
      varsInLiveConjuncts.addAll(GdlUtils.getVariables(rule.getHead()));
      Set<GdlVariable> varsInRule = new HashSet<GdlVariable>(GdlUtils.getVariables(rule));
      boolean preventDuplicatesFromConstants =
        (varsInRule.size() > varsInLiveConjuncts.size());

      //Do we just pass those to the Assignments class in that case?
      for(AssignmentIterator asnItr = assignments.getIterator(); asnItr.hasNext(); ) {
        Map<GdlVariable, GdlConstant> assignment = asnItr.next();
        if(assignment == null) continue; //Not sure if this will ever happen

        ConcurrencyUtils.checkForInterruption();
View Full Code Here

TOP

Related Classes of org.ggp.base.util.gdl.model.assignments.Assignments

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.