Skip to content

Commit

Permalink
Correct handling negated conjectures.
Browse files Browse the repository at this point in the history
Before, when we had several negated conjectures,
we would succeed only if we refuted *all* of them.
After this change, we succeed if we refute *at least one* of them.
That way, negated conjectures behave more similarly to axioms
if we have more than one of them.

This should close #1.
  • Loading branch information
01mf02 committed Nov 2, 2023
1 parent a598af1 commit 5398bba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cop/src/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ impl<A, V> RoleMap<Vec<Fof<A, V>>> {
pub fn join(mut self) -> Option<Fof<A, V>> {
let mut th = self.remove(&Role::Other);
let mut cj = self.remove(&Role::Conjecture);
let nc = self.remove(&Role::NegatedConjecture);
cj.extend(nc.into_iter().map(|fm| -fm));
let mut nc = self.remove(&Role::NegatedConjecture);
let conj = |mut fms: Vec<_>, fm1| {
if fms.is_empty() {
fm1
Expand All @@ -56,6 +55,9 @@ impl<A, V> RoleMap<Vec<Fof<A, V>>> {
Fof::BinA(OpA::Conj, fms)
}
};
if let Some(nc1) = nc.pop() {
cj.push(-conj(nc, nc1));
}
match (th.pop(), cj.pop()) {
(Some(th1), Some(cj1)) => Some(Fof::imp(conj(th, th1), conj(cj, cj1))),
(Some(th1), None) => Some(-conj(th, th1)),
Expand Down

0 comments on commit 5398bba

Please sign in to comment.