Package edu.cmu.cs.fusion.constraint

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


  @Test
  public void testMethodInvocation2() throws ParseException {
    String string = "Foo.mName(Bar bar, Baz baz) : Baz";
   
    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a MethodInvoke, but is " + op.getClass().getCanonicalName(), op instanceof MethodInvocationOp);
   
    MethodInvocationOp invoke = (MethodInvocationOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 4, vars.size());
View Full Code Here


  @Test
  public void testConstructor0() throws ParseException {
    String string = "Foo()";
   
    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a ConstructorOp, but is " + op.getClass().getCanonicalName(), op instanceof ConstructorOp);
   
    ConstructorOp construct = (ConstructorOp)op;
       
    FreeVars vars = construct.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 1, vars.size());
View Full Code Here

  @Test
  public void testConstructor1() throws ParseException {
    String string = "Foo(Bar bar)";
   
    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a ConstructorOp, but is " + op.getClass().getCanonicalName(), op instanceof ConstructorOp);
   
    ConstructorOp construct = (ConstructorOp)op;
       
    FreeVars vars = construct.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 2, vars.size());
View Full Code Here

  @Test
  public void testConstructor2() throws ParseException {
    String string = "Foo(Bar bar, Baz baz)";
   
    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a ConstructorOp, but is " + op.getClass().getCanonicalName(), op instanceof ConstructorOp);
   
    ConstructorOp construct = (ConstructorOp)op;
       
    FreeVars vars = construct.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 3, vars.size());
View Full Code Here

  @BeforeClass
  static public void setup() {
    utils = new TestUtils();
   
    Operation op;
    Predicate trigger;
    Predicate req;
    List<Effect> effects = new LinkedList<Effect>();
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
View Full Code Here

  }

 
  @Test
  public void testNoEffects() throws FusionException {
    Operation op;
    Predicate trigger;
    Predicate req;
    List<Effect> effects = new LinkedList<Effect>();
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
View Full Code Here

    assertFalse(checkFullyBound(env, partialSub, noEffectCons));
  }

  @Test
  public void testSeveralEffectsNotOverlap() throws FusionException {
    Operation op;
    Predicate trigger;
    Predicate req;
    List<Effect> effects = new LinkedList<Effect>();
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
View Full Code Here

    assertFalse(checkFullyBound(env, partialSub, severalEffectCons));
  }

  @Test
  public void testSeveralEffectsSame() throws FusionException {
    Operation op;
    Predicate trigger;
    Predicate req;
    List<Effect> effects = new LinkedList<Effect>();
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
View Full Code Here

  @BeforeClass
  static public void setup() {
    utils = new TestUtils();
   
    Operation op;
    Predicate trigger;
    Predicate req;
    List<Effect> effects = new LinkedList<Effect>();
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
View Full Code Here

  @BeforeClass
  static public void setup() {
    utils = new TestUtils();
   
    Operation op;
    Predicate trigger;
    Predicate req;
    List<Effect> effects = new LinkedList<Effect>();
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
View Full Code Here

TOP

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

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.