Examples of TruePredicate


Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

          }
        }
      }
     
      if (trigger == null)
        trigger = new TruePredicate();
      if (restrict == null)
        restrict = new TruePredicate();
      if (requires == null)
        requires = new TruePredicate();
       
      String owner = contextType.getFullyQualifiedName()
      constraints.add(new Constraint(owner, op, trigger, restrict, requires, effects));
    } catch (ParseException e) {
      ReportingUtility.reportParseError(constraint.getResource(), constraint.getNameRange(), e.getMessage());
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

          parser.reset(node.getTextContent());
          effects.add(parser.effect());
        }
      }
      if (trigger == null)
        trigger = new TruePredicate();
      if (restrict == null)
        restrict = new TruePredicate();
      if (requires == null)
        requires = new TruePredicate();
     
      constraints.add(new Constraint(resource.getName(), op, trigger, restrict, requires, effects));
    } catch (ParseException e) {
      ReportingUtility.reportParseError(resource, null, e.getMessage());
    }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

        opParams[ndx] = new SpecVar(method.getParameterNames()[ndx]);
      }
      op = new MethodInvocationOp(methodName, receiverType, opParams, paramTypes, returnType, isStatic);
    }
    String owner = method.getDeclaringType().getFullyQualifiedName();
    constraints.add(new Constraint(owner, op, new TruePredicate(), new TruePredicate(), new TruePredicate(), effects));
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

    Operation op = new BeginOfMethodOp(declaringType.getFullyQualifiedName(), methodType.getElementName(), params, paramTypes, isStatic);
    List<Effect> effects = new LinkedList<Effect>();
    effects.add(RelEffect.createAddEffect(relation, new SpecVar[] {Constraint.RECEIVER}));
   
    String owner = methodType.getDeclaringType().getFullyQualifiedName();
    constraints.add(new Constraint(owner, op, new TruePredicate(), new TruePredicate(), new TruePredicate(), effects));
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

    Predicate rst;
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
    trigger = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    rst = new RelationshipPredicate(utils.getRelation(1), new SpecVar[] {utils.getVar(1), utils.getVar(2)});
    cons = new Constraint("", op, trigger, rst, new TruePredicate(), new LinkedList<Effect>());
   
   
    labels = new ObjectLabel[7];
    labels[0] = new AbstractObjectLabel("0", "Foo");
    labels[1] = new AbstractObjectLabel("1", "Bar");
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

  }
 
  @Test
  public void testTrueNoSubs() throws FusionException {
    Predicate rst = new RelationshipPredicate(new Relation("D", new String[] {"Bar", "NewType"}), new SpecVar[] {utils.getVar(1), utils.getVar(2)});
    Constraint noSubCons = new Constraint("", cons.getOp(), cons.getTrigger(), rst, new TruePredicate(), new LinkedList<Effect>());
 
    RelationshipDelta startRels = new RelationshipDelta();
    startRels.setRelationship(new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[0], labels[1]}), SevenPointLattice.TRU);
    RelationshipContext rels = new RelationshipContext(false).applyChangesFromDelta(startRels);
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

    Predicate trigger;
    Predicate req;
    List<Effect> effects = new LinkedList<Effect>();
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0)}, new String[] {"Bar"}, "Foo", false);
    trigger = new TruePredicate();
    req = new TruePredicate();
    effects.add(RelEffect.createRemoveEffect(utils.getRelation(0), new SpecVar[] {Constraint.RECEIVER, utils.getVar(0)}));
    effects.add(RelEffect.createAddEffect(utils.getRelation(0), new SpecVar[] {Constraint.RESULT, utils.getVar(0)}));
   
    cons = new Constraint("", op, trigger, new TruePredicate(), req, effects);
   
    labels = new ObjectLabel[7];
    labels[0] = new AbstractObjectLabel("0", "Foo");
    labels[1] = new AbstractObjectLabel("1", "Bar");
    labels[2] = new AbstractObjectLabel("2", "Baz");
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.predicates.TruePredicate

    Operation op = new ConstructorOp("Foo", new SpecVar[] {utils.getVar(0)}, new String[] {"Bar"});
    List<Effect> effects = new LinkedList<Effect>();
    effects.add(RelEffect.createRemoveEffect(utils.getRelation(1), new SpecVar[] {utils.getVar(0), utils.getVar(0)}));
    effects.add(RelEffect.createAddEffect(utils.getRelation(0), new SpecVar[] {Constraint.RESULT, utils.getVar(0)}));
   
    Constraint cons = new Constraint("", op, new TruePredicate(), new TruePredicate(), new TruePredicate(), effects);

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, AliasDelta> deltas = runSingleConstraint(env, cons, instr);
    FusionErrorReport error = checkSingleConstraint(env, cons, instr);
    Relationship eff1 = new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[5], labels[5]});
View Full Code Here

Examples of org.jquantlib.math.functions.TruePredicate

    \f[ \langle x \rangle = \frac{\sum w_i x_i}{\sum w_i}. \f]
     */
    public final double mean() {
        final int size = getSampleSize();
        QL.require(size > 0 , empty_sample_set); // QA:[RG]::verified
        return expectationValue(new Identity(), new TruePredicate()).getFirst();
    }
View Full Code Here

Examples of org.jquantlib.math.functions.TruePredicate

        functions.add(new Square());
        functions.add(new Bind2nd(new Minus(), mean()));
        final Expression comp = new Expression(functions);

        // Evaluate the composed function in the specified range (ie. everyWhere).
        final double s2 = expectationValue(comp, new TruePredicate()).getFirst();
        return s2*n/(n-1.0);
    }
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.