'"Illegal schematic variable(s)" in code generated by proof (cases rule: ...)`
I defined a cases rule for case_option in the hope of making some proofs more readable.
However, when applying it with proof (cases rule: ...) and using the code snippet suggested by the proof statement,
the Isar case syntax tells me Illegal schematic variable(s) in case ..., even though the rule works in other cases.
lemma case_option_cases[case_names None Some]: (* removing the "case_names" tag does not solve the issue *)
assumes "x = None ==> P a"
and "!!y. x = Some y ==> P (b y)"
shows "P (case x of None => a | Some y => b y)"
using assms unfolding option.split_sel by blast
notepad
begin
fix P :: "'y => bool" and x :: "'x option" and a :: "'y" and b :: "'x => 'y"
(* sanity check *)
assume "x = None ==> P a" and "!!y. x = Some y ==> P (b y)"
then have "P (case x of None => a | Some y => b y)"
by (cases rule: case_option_cases) (* also works just "by (rule ...)" *)
have "P (case x of None => a | Some y => b y)"
proof (cases rule: case_option_cases) (* this line generates and suggests the following structure *)
case None (* Illegal schematic variable(s) in case "None" *)
then show ?thesis sorry
next
case (Some y) (* same here *)
then show ?thesis sorry
qed
end
Is there a way to fix this?
Solution 1:[1]
This can be caused/fixed by a few possible things:
If you make modifications to your
PATH, you'll have to reopen your command prompt for the changes to take effect.If you have multiple versions of Python installed, you'll have multiple
Scripts/folders, so make sure the Python version you want is not only in thePATH, but also appears in thePATHbefore any other Python version installed.
Path modification steps for Windows:
- From the desktop Start Menu, search for "environment variables" (will be in the Control Panel). In the "System Properties" window, click on the "Advanced" tab. In the "Advanced" tab, click the "Environment Variables..." button. Search for the "Path" variable under the "Systems variables" section and click the "Edit" button. Make sure the "...Scripts/" folder of the Python version you want appears at the top before any other "Scripts/" folder. Click "OK", then close/reopen any command prompts.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Michael Mintz |
