Package edu.cmu.cs.fusion

Examples of edu.cmu.cs.fusion.Relationship


   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.TRUE);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.TRU, val);
   
    assertEquals(1, delta.numberOfChanges());
  }
View Full Code Here


   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.FALSE);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.FAL, val);
   
    assertEquals(1, delta.numberOfChanges());
  }
View Full Code Here

   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.UNKNOWN);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.UNK, val);
   
    assertEquals(1, delta.numberOfChanges());
  }
View Full Code Here

   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.TRUE);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.FAL, val);
   
    assertEquals(1, delta.numberOfChanges());
  }
View Full Code Here

   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.FALSE);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.TRU, val);
   
    assertEquals(1, delta.numberOfChanges());
  }
View Full Code Here

   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.UNKNOWN);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.UNK, val);
   
    assertEquals(1, delta.numberOfChanges());
 
  }
View Full Code Here

 
  @Test
  public void testTrueTrue() throws FusionException {
    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]);

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, partialSub, cons);

    Relationship eRel = new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[6], labels[1]});

    assertEquals(1, deltas.fst().numberOfChanges());
    assertEquals(SevenPointLattice.FAL, deltas.fst().getValue(eRel));
   
    assertFalse(checkFullyBound(env, partialSub, cons));
View Full Code Here

  }

  @Test
  public void testTrueErrorU() throws FusionException {
    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);

    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[1]);

    Relationship eRel = new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[6], labels[1]});

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, partialSub, cons);

    assertEquals(1, deltas.fst().numberOfChanges());
View Full Code Here

  }

  @Test
  public void testTrueErrorF() throws FusionException {
    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.FAL);
    startRels.setRelationship(new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[1], labels[6]}), SevenPointLattice.FAL);
    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[1]);

    Relationship eRel = new Relationship(utils.getRelation(1), new ObjectLabel[]{labels[6], labels[1]});

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, partialSub, cons);

    assertEquals(1, deltas.fst().numberOfChanges());
View Full Code Here

  }

  @Test
  public void testFalse() throws FusionException {
    RelationshipDelta startRels = new RelationshipDelta();
    startRels.setRelationship(new Relationship(utils.getRelation(0), new ObjectLabel[]{utils.getLabel(0), utils.getLabel(2)}), SevenPointLattice.FAL);
    RelationshipContext rels = new RelationshipContext(false).applyChangesFromDelta(startRels);
   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(new TestEnvironment(rels, variant), utils.getSub(1), cons);

    assertEquals(0, deltas.fst().numberOfChanges());
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.Relationship

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.