Examples of arity()


Examples of org.ggp.base.util.gdl.grammar.GdlOr.arity()

      GdlOr or = (GdlOr) literal;
      if(or.arity() == 0)
        return;
      LinkedList<GdlVariable> vars = new LinkedList<GdlVariable>();
      getSupportedVariablesInLiteral(or.get(0), vars);
      for(int i = 1; i < or.arity(); i++) {
        Set<GdlVariable> newVars = new HashSet<GdlVariable>();
        getSupportedVariablesInLiteral(or.get(i), newVars);
        vars.retainAll(newVars);
      }
      variables.addAll(vars);
View Full Code Here

Examples of org.ggp.base.util.gdl.grammar.GdlRelation.arity()

        {
            GdlRelation relation = (GdlRelation) gdl;
            String name = relation.getName().toString();
            if(name.equals("init"))
            {
                if(relation.arity()!=1)
                    throw new RuntimeException("Can't init more than one thing as far as I know.");
                GdlTerm template = relation.get(0);
                if(template instanceof GdlConstant)
                {
                    List<GdlTerm> body = new ArrayList<GdlTerm>();
View Full Code Here

Examples of org.ggp.base.util.gdl.grammar.GdlRule.arity()

            }
            return GdlPool.getRelation(rel.getName(), rval);
        } else if(gdl instanceof GdlRule) {
            GdlRule rule = (GdlRule)gdl;
            List<GdlLiteral> rval = new ArrayList<GdlLiteral>();
            for(int i=0; i<rule.arity(); i++)
            {
                rval.add((GdlLiteral) replaceVariableInternal(rule.get(i), toSubstitute, theReplacement));
            }
            return GdlPool.getRule((GdlSentence) replaceVariableInternal(rule.getHead(), toSubstitute, theReplacement), rval);
        } else if(gdl instanceof GdlConstant) {
View Full Code Here

Examples of org.ggp.base.util.gdl.grammar.GdlSentence.arity()

            GdlRule rule = (GdlRule) gdl;
            String name = rule.getHead().getName().toString();
            if(name.equals("next"))
            {
                GdlSentence head = rule.getHead();
                if(head.arity()!=1)
                    throw new RuntimeException("Can't next more than one thing as far as I know.");
                if(head.get(0) instanceof GdlVariable)
                {   //weird case where you have rule like (next ?q)
                    Location l = new Location();
                    l.idx = 0;
View Full Code Here

Examples of org.jruby.runtime.Block.arity()

        StaticScope scope = block.getBody().getStaticScope();

        // for zsupers in define_method (blech!) we tell the proc scope to act as the "argument" scope
        scope.setArgumentScope(true);

        Arity arity = block.arity();
        // just using required is broken...but no more broken than before zsuper refactoring
        scope.setRequiredArgs(arity.required());

        if(!arity.isFixed()) {
            scope.setRestArg(arity.required());
View Full Code Here

Examples of solver.constraints.Propagator.arity()

            int pid = prop.getId();
            if (pid2arity.get(pid) > 1) {
                w += counter.getFails(prop);
            } else {
                if (pid2ari.get(pid) == null) {
                    pid2ari.putIfAbsent(prop.getId(), v.getSolver().getEnvironment().makeInt(prop.arity()));
                }
                int a = pid2ari.get(pid).get();
                pid2arity.put(pid, a);
                if (a > 1) {
                    w += counter.getFails(prop);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.