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