Package org.mizartools.dli

Examples of org.mizartools.dli.And


      for (org.mizartools.system.xml.Formula formula1 : ((org.mizartools.system.xml.And) formula).getFormulaList()) {
        VariableId vid2 = new VariableId();
        vid2.setId(vid.getId());
        formulaList.add(getFormula(abstractSignature, formula1, vid2));
      }
      formulaDli = new And(formulaList);
    } else if (formula instanceof org.mizartools.system.xml.Not){
      formulaDli = new Not(getFormula(abstractSignature, ((org.mizartools.system.xml.Not) formula).getFormula(), vid));
    } else if (formula instanceof org.mizartools.system.xml.Pred){
      org.mizartools.system.xml.Pred pred = (org.mizartools.system.xml.Pred) formula;
      LinkedList<Term> termList = new LinkedList<Term>();
View Full Code Here


      for (org.mizartools.system.xml.Formula formula1 : ((org.mizartools.system.xml.And) formula).getFormulaList()) {
        VariableId vid2 = new VariableId();
        vid2.setId(vid.getId());
        formulaList.add(getFormula(abstractSignature, formula1, vid2));
      }
      formulaDli = new And(formulaList);
    } else if (formula instanceof org.mizartools.system.xml.Not){
      formulaDli = new Not(getFormula(abstractSignature, ((org.mizartools.system.xml.Not) formula).getFormula(), vid));
    } else if (formula instanceof org.mizartools.system.xml.Pred){
      org.mizartools.system.xml.Pred pred = (org.mizartools.system.xml.Pred) formula;
      LinkedList<Term> termList = new LinkedList<Term>();
View Full Code Here

    formula1 = insertOr(formula1, changed1);
    formula1 = insertImplies(formula1, changed1);
    formula1 = insertIff(formula1, changed1);
    formula1 = deleteNotNot(formula1, changed1);
    if (formula instanceof And) {
      And and = (And)formula;
      Changed changed2 = new Changed();
      boolean compress = false;
      LinkedList<Formula> formulaList = new LinkedList<Formula>();
      for (Formula formula2 : and.getFormulaList()){
        formulaList.add(compress(formula2, changed2));
        if (changed2.isChanged) compress = true;
      }
      if (compress) {
        formula1 = new And(formulaList);
        changed1.isChanged = true
      }
    } else if (formula instanceof Or) {
      Or or = (Or)formula;
      Changed changed2 = new Changed();
View Full Code Here

    // $not($and($formula1,...,$not($formula_n)) -> $implies($and($formula1,...),$formula_n)
    if (formula instanceof Not) {
        Not not = (Not)formula;
        Formula formula1 = not.getFormula();
      if (formula1 instanceof And) {
        And and = (And)formula1;
        Formula formula2 = and.getFormulaList().getLast();
        if (formula2 instanceof Not) {
          LinkedList<Formula> formulaList = new LinkedList<Formula>();
          for (Formula formula3 : and.getFormulaList()){
            formulaList.add(formula3);
          }
          formulaList.pollLast();
          Formula hypothesis = null;
          if (formulaList.size() == 1){
            hypothesis = formulaList.getFirst();
          } else {
            hypothesis = new And(formulaList);
          }
          Formula conclusion = ((Not)formula2).getFormula();
            changed.isChanged = true;
            return new Implies(hypothesis, conclusion);
        }
View Full Code Here

  }

  private static Formula insertIff(Formula formula, Changed changed) throws DliException {
    // $and($implies($formula1,$formula2),$implies($formula2,$formula1)) -> $iff($formula1,$formula2)
    if (formula instanceof And) {
        And and = (And)formula;
        if (and.getFormulaList().size() == 2){
          Formula formula1 = and.getFormulaList().getFirst();
          Formula formula2 = and.getFormulaList().getLast();
          if (formula1 instanceof Implies && formula2 instanceof Implies){
            Implies implies1 = (Implies)formula1;
            Implies implies2 = (Implies)formula2;
            if (implies1.getConclusion().toString().equals(implies2.getHypothesis().toString()) &&
              implies2.getConclusion().toString().equals(implies1.getHypothesis().toString())  ){
View Full Code Here

    // $not($and(list_formula)) -> $or(not(list_formula))
    if (formula instanceof Not) {
        Not not = (Not)formula;
        Formula formula1 = not.getFormula();
        if (formula1 instanceof And) {
          And and = (And)not.getFormula();
        LinkedList<Formula> formulaList = new LinkedList<Formula>();
        int nrNot = 0;
        for (Formula formula2 : and.getFormulaList()){
          if (formula2 instanceof Not) {
            nrNot++;
            formulaList.add(((Not)formula2).getFormula());
          } else {
            nrNot--;
View Full Code Here

TOP

Related Classes of org.mizartools.dli.And

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.