@Test public void testNormalize() { { ArrayList<LTLFormula> orElements = new ArrayList<LTLFormula>( Arrays.asList(new Negation(a), new Negation(b))); Collections.sort(orElements); And expected = new And(orElements); assertEquals(expected, a_or_b.copy().normalize(true)); } assertEquals(makeOr(a, c), a_or_c.normalize(false)); }
protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } }
Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } }
Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } Or(ArrayList<LTLFormula> children); }
Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } Or(ArrayList<LTLFormula> children); LTLType getLTLType(); LTLFormula copy(); LinkedHashSet<LinkedHashSet<LTLFormula>> toSetForm(); ATransition d(HashMap<LTLFormula, ATransition> D); static void main(String args[]); }
Or extends LTLFormula { protected LTLFormula normalize(boolean b) { if(b) { flatten(); for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, true)); } return new And(children); } else { for(int i = 0; i < children.size(); ++i){ children.set(i, getNegation(i, false)); } return this; } } Or(ArrayList<LTLFormula> children); LTLType getLTLType(); LTLFormula copy(); LinkedHashSet<LinkedHashSet<LTLFormula>> toSetForm(); ATransition d(HashMap<LTLFormula, ATransition> D); static void main(String args[]);  }