Package edu.cmu.cs.fusion.constraint

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


    ImpliesPredicate val = (ImpliesPredicate)pred;
   
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
    Assert.assertTrue("Right side is a bool value", val.getRight() instanceof BooleanValue);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   
  }
View Full Code Here


    ImpliesPredicate val = (ImpliesPredicate)pred;
   
    Assert.assertTrue("Left side is a implies pred", val.getLeft() instanceof ImpliesPredicate);
    Assert.assertTrue("Right side is a bool value", val.getRight() instanceof BooleanValue);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain three free variables", 3, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("c should have a boolean type", "boolean", vars.getType(new SpecVar("c")));   
  }
View Full Code Here

    ImpliesPredicate val = (ImpliesPredicate)pred;
   
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
    Assert.assertTrue("Right side is a and pred", val.getRight() instanceof AndPredicate);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain three free variables", 3, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("c should have a boolean type", "boolean", vars.getType(new SpecVar("c")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   

  }
View Full Code Here

    Assert.assertTrue("Parsed predicate should be a RelationshipPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof RelationshipPredicate);
   
    RelationshipPredicate val = (RelationshipPredicate)pred;
    Assert.assertTrue("Parsed predicate should be positive", val.isPositive());
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());
    Assert.assertEquals("a should have a Bar type", "Bar", vars.getType(new SpecVar("a")));   
    Assert.assertEquals("b should have a Baz type", "Baz", vars.getType(new SpecVar("b")));   
  }
View Full Code Here

    Assert.assertTrue("Parsed predicate should be a RelationshipPredicate, but is " + pred.getClass().getCanonicalName(), pred instanceof RelationshipPredicate);
   
    RelationshipPredicate val = (RelationshipPredicate)pred;
    Assert.assertTrue("Parsed predicate should be negative", !val.isPositive());
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());
    Assert.assertEquals("a should have a Bar type", "Bar", vars.getType(new SpecVar("a")));   
    Assert.assertEquals("b should have a Baz type", "Baz", vars.getType(new SpecVar("b")));   
  }
View Full Code Here

    AndPredicate val = (AndPredicate)pred;
   
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
    Assert.assertTrue("Right side is a bool value", val.getRight() instanceof BooleanValue);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   
  }
View Full Code Here

    AndPredicate val = (AndPredicate)pred;
   
    Assert.assertTrue("Left side is a and pred", val.getLeft() instanceof AndPredicate);
    Assert.assertTrue("Right side is a bool value", val.getRight() instanceof BooleanValue);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain three free variables", 3, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("c should have a boolean type", "boolean", vars.getType(new SpecVar("c")));   
  }
View Full Code Here

    AndPredicate val = (AndPredicate)pred;
   
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
    Assert.assertTrue("Right side is a and pred", val.getRight() instanceof AndPredicate);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain 4 free variables", 4, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain 3 free variables", 3, vars.size());
   
    val = (AndPredicate)val.getRight();
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
    Assert.assertTrue("Right side is a and pred", val.getRight() instanceof AndPredicate);
   
    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain 2 free variables", 2, vars.size());

    val = (AndPredicate)val.getRight();
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
    Assert.assertTrue("Right side is a bool value", val.getRight() instanceof BooleanValue);

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("c should have a boolean type", "boolean", vars.getType(new SpecVar("c")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("d should have a boolean type", "boolean", vars.getType(new SpecVar("d")));   

  }
View Full Code Here

    OrPredicate val = (OrPredicate)pred;
   
    Assert.assertTrue("Left side is a bool value", val.getLeft() instanceof BooleanValue);
    Assert.assertTrue("Right side is a and pred", val.getRight() instanceof AndPredicate);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain three free variables", 3, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain one free variables", 1, vars.size());
    Assert.assertEquals("c should have a boolean type", "boolean", vars.getType(new SpecVar("c")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain two free variables", 2, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   

  }
View Full Code Here

    AndPredicate val = (AndPredicate)pred;
   
    Assert.assertTrue("Left side is a or pred", val.getLeft() instanceof OrPredicate);
    Assert.assertTrue("Right side is a bool value", val.getRight() instanceof BooleanValue);
   
    FreeVars vars = val.getFreeVariables();
    Assert.assertEquals("Should only contain three free variables", 3, vars.size());

    vars = val.getLeft().getFreeVariables();
    Assert.assertEquals("Should only contain 2 free variables", 2, vars.size());
    Assert.assertEquals("c should have a boolean type", "boolean", vars.getType(new SpecVar("c")));   
    Assert.assertEquals("b should have a boolean type", "boolean", vars.getType(new SpecVar("b")));   

    vars = val.getRight().getFreeVariables();
    Assert.assertEquals("Should only contain 1 free variables", 1, vars.size());
    Assert.assertEquals("a should have a boolean type", "boolean", vars.getType(new SpecVar("a")));   
  }
View Full Code Here

TOP

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

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.