@Test public void testFindCounterExample() { final DefaultQuery<Boolean, Boolean> ce = oracle.findCounterExample(automaton, inputs); Assert.assertEquals(ce, query); Mockito.verify(po1, Mockito.times(1)).disprove(automaton, inputs); Mockito.verify(po2).disprove(automaton, inputs); Mockito.verify(po2, Mockito.never()).doFindCounterExample(automaton, inputs); }
@Override public @Nullable DefaultQuery<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs) { for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { po.disprove(hypothesis, inputs); } } for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { final DefaultQuery<I, D> ce = po.doFindCounterExample(hypothesis, inputs); if (ce != null) { assert isCounterExample(hypothesis, ce.getInput(), ce.getOutput()); return ce; } } } return null; }
DisproveFirstOracle implements BlackBoxOracle<A, I, D> { @Override public @Nullable DefaultQuery<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs) { for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { po.disprove(hypothesis, inputs); } } for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { final DefaultQuery<I, D> ce = po.doFindCounterExample(hypothesis, inputs); if (ce != null) { assert isCounterExample(hypothesis, ce.getInput(), ce.getOutput()); return ce; } } } return null; } }
DisproveFirstOracle implements BlackBoxOracle<A, I, D> { @Override public @Nullable DefaultQuery<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs) { for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { po.disprove(hypothesis, inputs); } } for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { final DefaultQuery<I, D> ce = po.doFindCounterExample(hypothesis, inputs); if (ce != null) { assert isCounterExample(hypothesis, ce.getInput(), ce.getOutput()); return ce; } } } return null; } DisproveFirstOracle();  DisproveFirstOracle(PropertyOracle<I, ? super A, ?, D> propertyOracle);  DisproveFirstOracle(Collection<? extends PropertyOracle<I, ? super A, ?, D>> propertyOracles); }
DisproveFirstOracle implements BlackBoxOracle<A, I, D> { @Override public @Nullable DefaultQuery<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs) { for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { po.disprove(hypothesis, inputs); } } for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { final DefaultQuery<I, D> ce = po.doFindCounterExample(hypothesis, inputs); if (ce != null) { assert isCounterExample(hypothesis, ce.getInput(), ce.getOutput()); return ce; } } } return null; } DisproveFirstOracle();  DisproveFirstOracle(PropertyOracle<I, ? super A, ?, D> propertyOracle);  DisproveFirstOracle(Collection<? extends PropertyOracle<I, ? super A, ?, D>> propertyOracles); @Override List<PropertyOracle<I, ? super A, ?, D>> getPropertyOracles(); @Override @Nullable DefaultQuery<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs); }
DisproveFirstOracle implements BlackBoxOracle<A, I, D> { @Override public @Nullable DefaultQuery<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs) { for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { po.disprove(hypothesis, inputs); } } for (PropertyOracle<I, ? super A, ?, D> po : propertyOracles) { if (!po.isDisproved()) { final DefaultQuery<I, D> ce = po.doFindCounterExample(hypothesis, inputs); if (ce != null) { assert isCounterExample(hypothesis, ce.getInput(), ce.getOutput()); return ce; } } } return null; } DisproveFirstOracle();  DisproveFirstOracle(PropertyOracle<I, ? super A, ?, D> propertyOracle);  DisproveFirstOracle(Collection<? extends PropertyOracle<I, ? super A, ?, D>> propertyOracles); @Override List<PropertyOracle<I, ? super A, ?, D>> getPropertyOracles(); @Override @Nullable DefaultQuery<I, D> findCounterExample(A hypothesis, Collection<? extends I> inputs);  }