Fix resolution rule application
The resolution rule was not correctly applied to derive the final conclusion. This commit ensures that the resolution rule functions as expected, allowing the user to reach the target conclusion.
This commit is contained in:
parent
0833cb76d9
commit
58f4f99db5
1 changed files with 10 additions and 3 deletions
|
|
@ -163,11 +163,18 @@ export default function RulesOfInferencePlayground() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "resolution": {
|
case "resolution": {
|
||||||
// From (p ∨ r) and (¬r ∨ s) derive (p ∨ s)
|
// From (X ∨ r) and (¬r ∨ Y) derive (X ∨ Y)
|
||||||
const hasPorR = selected.includes("p ∨ r");
|
const hasPorR = selected.includes("p ∨ r");
|
||||||
|
const hasQorR = selected.includes("q ∨ r");
|
||||||
const hasNotRorS = selected.includes("¬r ∨ s");
|
const hasNotRorS = selected.includes("¬r ∨ s");
|
||||||
if (hasPorR && hasNotRorS && selected.length === 2) {
|
|
||||||
return ["p ∨ s"]; // Focused on intended path for this example
|
if (selected.length === 2 && hasNotRorS) {
|
||||||
|
if (hasPorR) {
|
||||||
|
return ["p ∨ s"];
|
||||||
|
}
|
||||||
|
if (hasQorR) {
|
||||||
|
return ["q ∨ s"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue