Package edu.cmu.cs.fusion.constraint

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


   * A(x, y) -> B(x, x)
   * Query for B(0, 0)
   */
  @Test
  public void testWorksSingleStepDiff() {
    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[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


   * B(x, x) -> A(x, x)
   * Query for A(0, 0)
   */
  @Test
  public void testWorksTwoSteps() {
    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[1], new SpecVar[] {new SpecVar("x"), new SpecVar("x")}));
   
    infEnv.addRule(new InferredRel(trigger, eff));
   
    trigger = new RelationshipPredicate(relations[1], new SpecVar[] {new SpecVar("x"), new SpecVar("x")});
    eff = new LinkedList<RelEffect>();
    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]);
   
View Full Code Here

  }

  public void beforeAllCompilationUnits() {
    rels = new RelationsEnvironment();
    constraints = new ConstraintEnvironment(rels);
    infers = new InferenceEnvironment(rels);
    retriever = new XMLRetriever(rels);
    majorErrorOccured = false;
    try {
      ReportingUtility.clearMarkers(ResourcesPlugin.getWorkspace().getRoot());
     
View Full Code Here

  public FusionEnvironment(AC aliasLattice, RelationshipContext relLattice, BooleanContext boolLattice, TypeHierarchy types) {
    context = relLattice;
    alias = aliasLattice;
    bools = boolLattice;
    tHierarchy = types;
    inference = new InferenceEnvironment(null);
    continuation = ConsList.empty();
  }
View Full Code Here

TOP

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

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.