Package aima.core.logic.fol.parsing.ast

Examples of aima.core.logic.fol.parsing.ast.QuantifiedSentence


    List<Variable> variables = new ArrayList<Variable>();
    for (Variable var : sentence.getVariables()) {
      variables.add((Variable) var.accept(this, arg));
    }

    return new QuantifiedSentence(sentence.getQuantifier(), variables,
        (Sentence) sentence.getQuantified().accept(this, arg));
  }
View Full Code Here


      }
    }

    // in addition, rules for negated quantifiers:
    if (negated instanceof QuantifiedSentence) {
      QuantifiedSentence negQuantified = (QuantifiedSentence) negated;
      // I need to ensure the ~ is moved in deeper
      Sentence notP = (Sentence) (new NotSentence(
          negQuantified.getQuantified())).accept(this, arg);

      // ~FORALL x p becomes EXISTS x ~p
      if (Quantifiers.isFORALL(negQuantified.getQuantifier())) {
        return new QuantifiedSentence(Quantifiers.EXISTS,
            negQuantified.getVariables(), notP);
      }

      // ~EXISTS x p becomes FORALL x ~p
      if (Quantifiers.isEXISTS(negQuantified.getQuantifier())) {
        return new QuantifiedSentence(Quantifiers.FORALL,
            negQuantified.getVariables(), notP);
      }
    }

    return new NotSentence((Sentence) negated.accept(this, arg));
  }
View Full Code Here

  }

  public Object visitQuantifiedSentence(QuantifiedSentence sentence,
      Object arg) {

    return new QuantifiedSentence(sentence.getQuantifier(),
        sentence.getVariables(), (Sentence) sentence.getQuantified()
            .accept(this, arg));
  }
View Full Code Here

    // names are tracked
    seenSoFar.addAll(replVariables);

    Sentence sQuantified = (Sentence) subst.accept(this, arg);

    return new QuantifiedSentence(sentence.getQuantifier(), replVariables,
        sQuantified);
  }
View Full Code Here

      consume();
      var = (Variable) parseVariable();
      variables.add(var);
    }
    Sentence sentence = parseSentence();
    return new QuantifiedSentence(quantifier, variables, sentence);
  }
View Full Code Here

TOP

Related Classes of aima.core.logic.fol.parsing.ast.QuantifiedSentence

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.