From 58f4f99db5b70269f62e6f49260d9641d2156c21 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 09:56:53 +0000 Subject: [PATCH] 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. --- src/components/RulesOfInferencePlayground.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/RulesOfInferencePlayground.tsx b/src/components/RulesOfInferencePlayground.tsx index 37dd187..0cf186c 100644 --- a/src/components/RulesOfInferencePlayground.tsx +++ b/src/components/RulesOfInferencePlayground.tsx @@ -163,11 +163,18 @@ export default function RulesOfInferencePlayground() { break; } 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 hasQorR = selected.includes("q ∨ r"); 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; }