Refactor inference playground

Update the Rules of Inference Playground to allow users to build proofs step-by-step. Users can now add premises, select subsets of premises, and apply inference rules. The system provides feedback if a rule is not applicable and prompts the user to try again.
This commit is contained in:
gpt-engineer-app[bot] 2025-08-11 09:38:08 +00:00
parent e0d0d73dc3
commit 0833cb76d9

View file

@ -197,8 +197,8 @@ export default function RulesOfInferencePlayground() {
const valid = deriveCandidates(activeRule, activePremises).includes(result); const valid = deriveCandidates(activeRule, activePremises).includes(result);
if (!valid) { if (!valid) {
toast({ toast({
title: "Not quite", title: "Rule not applicable",
description: "That rule doesnt apply to the selected premises.", description: `The rule "${activeRule}" cannot be applied to the selected premises. Try a different rule or different premises.`,
variant: "destructive", variant: "destructive",
}); });
return; return;
@ -209,7 +209,9 @@ export default function RulesOfInferencePlayground() {
setActiveRule(undefined); setActiveRule(undefined);
if (result === example.conclusion) { if (result === example.conclusion) {
toast({ title: "Nice!", description: "You derived the target conclusion." }); toast({ title: "Proof complete!", description: "You successfully derived the target conclusion!" });
} else {
toast({ title: "Step added", description: "Continue building your proof with the new statement." });
} }
} }