Java Code Examples for edu.cornell.cs.nlp.spf.mr.lambda.LogicLanguageServices#isArraySubPredicate()
The following examples show how to use
edu.cornell.cs.nlp.spf.mr.lambda.LogicLanguageServices#isArraySubPredicate() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GetAllPredicates.java From spf with GNU General Public License v2.0 | 5 votes |
@Override public void visit(LogicalConstant logicalConstant) { if (logicalConstant.getType().isComplex() && !LogicLanguageServices .isCoordinationPredicate(logicalConstant) && !LogicLanguageServices .isArrayIndexPredicate(logicalConstant) && !LogicLanguageServices.isArraySubPredicate(logicalConstant)) { // Case found a predicate, add it to the return set predicates.add(logicalConstant); } }
Example 2
Source File: SingleSentencePartialCreditTestingStatistics.java From spf with GNU General Public License v2.0 | 5 votes |
@Override public void visit(Literal literal) { // Visit the predicate literal.getPredicate().accept(this); final LogicalExpression pred = literal.getPredicate(); final int numArgs = literal.numArgs(); if (!LogicLanguageServices.isCoordinationPredicate(pred) && !LogicLanguageServices.isArrayIndexPredicate(pred) && !LogicLanguageServices.isArraySubPredicate(pred) && literal.getPredicate() instanceof LogicalConstant) { if (numArgs == 1 && !(literal.getArg(0) instanceof LogicalConstant)) { // Unary predicates predConstPairs.add(Pair.of(literal.getPredicate(), (LogicalExpression) null)); return; } else if (numArgs == 2 && !(literal.getArg(0) instanceof LogicalConstant) && IsExtendedConstant.of(literal.getArg(1))) { // Binary predicate predConstPairs.add(Pair.of(literal.getPredicate(), literal.getArg(1))); return; } } // Just visit the arguments and predicate for (int i = 0; i < numArgs; ++i) { literal.getArg(i).accept(this); } }
Example 3
Source File: FactoringServices.java From spf with GNU General Public License v2.0 | 5 votes |
public static boolean isFactorable(LogicalConstant constant) { return !LogicLanguageServices.isCoordinationPredicate(constant) && !LogicLanguageServices.isArrayIndexPredicate(constant) && !LogicLanguageServices.isArraySubPredicate(constant) && !LogicLanguageServices.getTypeRepository().getIndexType() .equals(constant.getType()) && INSTANCE.filter.apply(constant) && !INSTANCE.unfactoredConstants.contains(constant); }