Examples of InferenceEnvironment


Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

    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]});
    Relationship eff2 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[3], labels[5]});
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[5])


    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(0), new ObjectLabel[]{labels[0], labels[5]});
    Relationship eff2 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[3], labels[5]});
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

    AliasDelta expected = new AliasDelta();
    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[2])

    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(0), new ObjectLabel[]{labels[0], labels[2]});
    Relationship eff2 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[3], labels[2]});
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getTarget(), labels[4]);
    expected.addChange(instr.getArgOperands().get(0), labels[5])

    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(0), new ObjectLabel[]{labels[0], labels[5]});
    Relationship eff2 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[3], labels[5]});
    Relationship eff3 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[4], labels[5]});
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[1])
    expected.addChange(instr.getArgOperands().get(0), labels[2])

    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(0), new ObjectLabel[]{labels[0], labels[1]});
    Relationship eff2 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[3], labels[1]});
    Relationship eff3 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[0], labels[2]});
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

   * A(x, y) -> B(x, y)
   * Query for A(0, 0)
   */
  @Test
  public void testNoMatchForProduce() {
    InferenceEnvironment infEnv = new InferenceEnvironment(null);
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, ctx, null, testH, infEnv, Variant.PRAGMATIC_VARIANT);
   
    RelationshipPredicate trigger = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("b")});
    List<RelEffect> eff = new LinkedList<RelEffect>();
    eff.add(RelEffect.createAddEffect(relations[1], new SpecVar[] {new SpecVar("a"), new SpecVar("b")}));
   
    InferredRel inf = new InferredRel(trigger, eff);
    infEnv.addRule(inf);
   
    RelationshipPredicate find = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("a")});
    Substitution sub = new Substitution();
    sub = sub.addSub(new SpecVar("a"), labels[0]);
       
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

   * A(x, y) -> A(y, x)
   * Query for A(0, 0)
   */
  @Test
  public void testNoVariablesWork() {
    InferenceEnvironment infEnv = new InferenceEnvironment(null);
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, ctx, null, testH, infEnv, Variant.PRAGMATIC_VARIANT);
   
    RelationshipPredicate trigger = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("b")});
    List<RelEffect> eff = new LinkedList<RelEffect>();
    eff.add(RelEffect.createAddEffect(relations[0], new SpecVar[] {new SpecVar("b"), new SpecVar("a")}));
   
    InferredRel inf = new InferredRel(trigger, eff);
    infEnv.addRule(inf);
   
    RelationshipPredicate find = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("a")});
    Substitution sub = new Substitution();
    sub = sub.addSub(new SpecVar("a"), labels[0]);
    sub = sub.addSub(new SpecVar("b"), labels[1]);
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

   * A(x, y) -> !A(x, x)
   * Query for A(0, 0)
   */
  @Test
  public void testWrongValue() {
    InferenceEnvironment infEnv = new InferenceEnvironment(null);
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, ctx, null, testH, infEnv, Variant.PRAGMATIC_VARIANT);
   
    RelationshipPredicate trigger = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("b")});
    List<RelEffect> eff = new LinkedList<RelEffect>();
    eff.add(RelEffect.createRemoveEffect(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("a")}));
   
    InferredRel inf = new InferredRel(trigger, eff);
    infEnv.addRule(inf);
   
    RelationshipPredicate find = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("a")});
    Substitution sub = new Substitution();
    sub = sub.addSub(new SpecVar("a"), labels[0]);
    sub = sub.addSub(new SpecVar("b"), labels[1]);
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

   * A(x, y) -> !A(x, y), B(x, x)
   * Query for B(0, 0)
   */
  @Test
  public void testThrashes() {
    InferenceEnvironment infEnv = new InferenceEnvironment(null);
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, ctx, null, testH, infEnv, Variant.PRAGMATIC_VARIANT);
   
    RelationshipPredicate trigger = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("x"), new SpecVar("y")});
    List<RelEffect> eff = new LinkedList<RelEffect>();
    eff.add(RelEffect.createRemoveEffect(relations[0], new SpecVar[] {new SpecVar("x"), new SpecVar("y")}));
    eff.add(RelEffect.createAddEffect(relations[1], new SpecVar[] {new SpecVar("x"), new SpecVar("x")}));
   
    InferredRel inf = new InferredRel(trigger, eff);
    infEnv.addRule(inf);
   
    RelationshipPredicate find = new RelationshipPredicate(relations[1], new SpecVar[] {new SpecVar("a"), new SpecVar("a")});
    Substitution sub = new Substitution();
    sub = sub.addSub(new SpecVar("a"), labels[0]);
   
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.InferenceEnvironment

   * A(x, y) -> A(x, x)
   * Query for A(0, 0)
   */
  @Test
  public void testWorksSingleStepSame() {
    InferenceEnvironment infEnv = new InferenceEnvironment(null);
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, ctx, null, testH, infEnv, Variant.PRAGMATIC_VARIANT);
   
    RelationshipPredicate trigger = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("x"), new SpecVar("y")});
    List<RelEffect> eff = new LinkedList<RelEffect>();
    eff.add(RelEffect.createAddEffect(relations[0], new SpecVar[] {new SpecVar("x"), new SpecVar("x")}));
   
    InferredRel inf = new InferredRel(trigger, eff);
    infEnv.addRule(inf);
   
    RelationshipPredicate find = new RelationshipPredicate(relations[0], new SpecVar[] {new SpecVar("a"), new SpecVar("a")});
    Substitution sub = new Substitution();
    sub = sub.addSub(new SpecVar("a"), labels[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.