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:
parent
e0d0d73dc3
commit
0833cb76d9
1 changed files with 6 additions and 4 deletions
|
|
@ -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 doesn’t 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." });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue