@Test public void testDiamond() { ModalLogicFormula formula = new ModalLogicDiamond(new ModalLogicProposition("P")); HashSet<World> expResult = new HashSet<>(Arrays.asList(a, d)); HashSet<Integer> expResultId = new HashSet<>(); for (var w : expResult) expResultId.add(w.id); HashSet<Integer> resultId = new HashSet<>(); for (var w : formula.interpretation(structure)) resultId.add(w.id); assertEquals(expResultId, resultId); }
public abstract HashSet<World> interpretation(KripkeStructure structure);
ModalLogicFormula { public abstract HashSet<World> interpretation(KripkeStructure structure); }
ModalLogicFormula { public abstract HashSet<World> interpretation(KripkeStructure structure); ModalLogicFormula(); }
ModalLogicFormula { public abstract HashSet<World> interpretation(KripkeStructure structure); ModalLogicFormula(); abstract HashSet<World> interpretation(KripkeStructure structure); @Override String toString(); abstract String toString(FormulaPosition pos); }
ModalLogicFormula { public abstract HashSet<World> interpretation(KripkeStructure structure); ModalLogicFormula(); abstract HashSet<World> interpretation(KripkeStructure structure); @Override String toString(); abstract String toString(FormulaPosition pos);  }