Package org.ggp.base.util.propnet.architecture.components

Examples of org.ggp.base.util.propnet.architecture.components.Not


    else if ( literal instanceof GdlNot )
    {
      GdlNot not = (GdlNot) literal;

      Proposition input = convertConjunct(not.getBody());
      Not no = new Not();
      Proposition output = new Proposition(GdlPool.getProposition(GdlPool.getConstant("anon")));

      link(input, no);
      link(no, output);
View Full Code Here


          if (pn != null) {
            pn.removeComponent(or);
          }
        }
      } else if(output instanceof Not) {
        Not not = (Not) output;
        //Disconnect from falseComponent
        not.removeInput(falseComponent);
        falseComponent.removeOutput(not);
        //Connect all children of the not to trueComponent
        for(Component child : not.getOutputs()) {
          //Disconnect
          child.removeInput(not);
          //not.removeOutput(child); //Do at end
          //Connect to trueComponent
          child.addInput(trueComponent);
          trueComponent.addOutput(child);
        }
        not.removeAllOutputs();
        if(pn != null)
            pn.removeComponent(not);
      } else if(output instanceof Transition) {
        //???
        System.err.println("Fix optimizeAwayFalse's case for Transitions");
View Full Code Here

          if (pn != null) {
            pn.removeComponent(and);
          }
        }
      } else if(output instanceof Not) {
        Not not = (Not) output;
        //Disconnect from trueComponent
        not.removeInput(trueComponent);
        trueComponent.removeOutput(not);
        //Connect all children of the not to falseComponent
        for(Component child : not.getOutputs()) {
          //Disconnect
          child.removeInput(not);
          //not.removeOutput(child); //Do at end
          //Connect to falseComponent
          child.addInput(falseComponent);
          falseComponent.addOutput(child);
        }
        not.removeAllOutputs();
        if(pn != null)
            pn.removeComponent(not);
      } else if(output instanceof Transition) {
        //???
        System.err.println("Fix optimizeAwayTrue's case for Transitions");
View Full Code Here

                positive = tempProp;
              }
              //Positive is now set and in temporaryComponents
              //Evidently, wasn't in temporaryNegations
              //So we add the "not" gate and set it in temporaryNegations
              Not not = new Not();
              //Add positive as input
              not.addInput(positive);
              positive.addOutput(not);
              temporaryNegations.put(transformed, not);
              conj = not;
            }
            if(conj == null) {
              Component positive = components.get(transformed);
              //No, because then that will be attached to "negations", which could be bad

              if(positive == null) {
                //So the positive can't possibly be true (unless we have recurstion)
                //and so this would be positive always
                //We want to just skip this conjunct, so we continue to the next

                continue; //to the next conjunct
              }

              //Check if we're sharing a component with another sentence with a negation
              //(i.e. look for "nots" in our outputs and use those instead)
              Not existingNotOutput = getNotOutput(positive);
              if(existingNotOutput != null) {
                componentsToConnect.add(existingNotOutput);
                negations.put(transformed, existingNotOutput);
                continue; //to the next conjunct
              }

              Not not = new Not();
              not.addInput(positive);
              positive.addOutput(not);
              negations.put(transformed, not);
              conj = not;
            }
            componentsToConnect.add(conj);
View Full Code Here

TOP

Related Classes of org.ggp.base.util.propnet.architecture.components.Not

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.