Package edu.cmu.cs.fusion.constraint

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


   
    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]);
       
    assertNull(env.getInferredDelta(find, sub));
  }
View Full Code Here


   
    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]);
   
    assertNull(env.getInferredDelta(find, sub));   
  }
View Full Code Here

   
    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]);
   
    assertNull(env.getInferredDelta(find, sub));   
  }
View Full Code Here

   
    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]);
   
    assertNull(env.getInferredDelta(find, sub));     
  }
View Full Code Here

   
    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]);
   
    RelationshipDelta delta = env.getInferredDelta(find, sub);
    assertNotNull(delta);
    SevenPointLattice val = delta.getValue(new Relationship(relations[0], new ObjectLabel[] {labels[0], labels[0]}));
    assertEquals(SevenPointLattice.TRU, val);
View Full Code Here

   
    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]);
   
    RelationshipDelta delta = env.getInferredDelta(find, sub);
    assertNotNull(delta);
    SevenPointLattice val = delta.getValue(new Relationship(relations[1], new ObjectLabel[] {labels[0], labels[0]}));
    assertEquals(SevenPointLattice.TRU, val);
View Full Code Here

    eff.add(RelEffect.createAddEffect(relations[0], new SpecVar[] {new SpecVar("x"), new SpecVar("x")}));
   
    infEnv.addRule(new InferredRel(trigger, eff));
   
    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]);
   
    RelationshipDelta delta = env.getInferredDelta(find, sub);
    assertNotNull(delta);
    SevenPointLattice val = delta.getValue(new Relationship(relations[1], new ObjectLabel[] {labels[0], labels[0]}));
    assertEquals(SevenPointLattice.TRU, val);
View Full Code Here

    startRels.setRelationship(new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[1], labels[6]}), SevenPointLattice.TRU);
    RelationshipContext rels = new RelationshipContext(false).applyChangesFromDelta(startRels);
   
    //R0(0, 1) R1(1, 6)

    Substitution partialSub = new Substitution();
    partialSub = partialSub.addSub(utils.getVar(0), labels[0]);
    partialSub = partialSub.addSub(utils.getVar(1), labels[1]);
    partialSub = partialSub.addSub(Constraint.RESULT, labels[1]);
    partialSub = partialSub.addSub(Constraint.RECEIVER, labels[3]);

    this.variant = Variant.PRAGMATIC_VARIANT;
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, partialSub, noEffectCons);
   
View Full Code Here

    RelationshipDelta startRels = new RelationshipDelta();
    startRels.setRelationship(new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[0], labels[1]}), SevenPointLattice.TRU);
    startRels.setRelationship(new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[1], labels[6]}), SevenPointLattice.TRU);
    RelationshipContext rels = new RelationshipContext(false).applyChangesFromDelta(startRels);

    Substitution partialSub = new Substitution();
    partialSub = partialSub.addSub(utils.getVar(0), labels[0]);
    partialSub = partialSub.addSub(utils.getVar(1), labels[1]);
    partialSub = partialSub.addSub(Constraint.RESULT, labels[6]);
    partialSub = partialSub.addSub(Constraint.RECEIVER, labels[3]);

    this.variant = Variant.PRAGMATIC_VARIANT;
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, partialSub, severalEffectCons);
View Full Code Here

    RelationshipDelta startRels = new RelationshipDelta();
    startRels.setRelationship(new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[0], labels[1]}), SevenPointLattice.TRU);
    startRels.setRelationship(new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[1], labels[1]}), SevenPointLattice.TRU);
    RelationshipContext rels = new RelationshipContext(false).applyChangesFromDelta(startRels);

    Substitution partialSub = new Substitution();
    partialSub = partialSub.addSub(utils.getVar(0), labels[0]);
    partialSub = partialSub.addSub(utils.getVar(1), labels[1]);
    partialSub = partialSub.addSub(Constraint.RESULT, labels[1]);
    partialSub = partialSub.addSub(Constraint.RECEIVER, labels[3]);

    this.variant = Variant.PRAGMATIC_VARIANT;
    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, partialSub, severalEffectCons);
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.constraint.Substitution

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.