equal
deleted
inserted
replaced
20 |
20 |
21 subsection \<open>The datatype of propositions\<close> |
21 subsection \<open>The datatype of propositions\<close> |
22 |
22 |
23 datatype 'a pl = |
23 datatype 'a pl = |
24 false |
24 false |
25 | var 'a ("#_" [1000]) |
25 | var 'a (\<open>#_\<close> [1000]) |
26 | imp "'a pl" "'a pl" (infixr "\<rightharpoonup>" 90) |
26 | imp "'a pl" "'a pl" (infixr \<open>\<rightharpoonup>\<close> 90) |
27 |
27 |
28 |
28 |
29 subsection \<open>The proof system\<close> |
29 subsection \<open>The proof system\<close> |
30 |
30 |
31 inductive thms :: "['a pl set, 'a pl] \<Rightarrow> bool" (infixl "\<turnstile>" 50) |
31 inductive thms :: "['a pl set, 'a pl] \<Rightarrow> bool" (infixl \<open>\<turnstile>\<close> 50) |
32 for H :: "'a pl set" |
32 for H :: "'a pl set" |
33 where |
33 where |
34 H: "p \<in> H \<Longrightarrow> H \<turnstile> p" |
34 H: "p \<in> H \<Longrightarrow> H \<turnstile> p" |
35 | K: "H \<turnstile> p\<rightharpoonup>q\<rightharpoonup>p" |
35 | K: "H \<turnstile> p\<rightharpoonup>q\<rightharpoonup>p" |
36 | S: "H \<turnstile> (p\<rightharpoonup>q\<rightharpoonup>r) \<rightharpoonup> (p\<rightharpoonup>q) \<rightharpoonup> p\<rightharpoonup>r" |
36 | S: "H \<turnstile> (p\<rightharpoonup>q\<rightharpoonup>r) \<rightharpoonup> (p\<rightharpoonup>q) \<rightharpoonup> p\<rightharpoonup>r" |
40 |
40 |
41 subsection \<open>The semantics\<close> |
41 subsection \<open>The semantics\<close> |
42 |
42 |
43 subsubsection \<open>Semantics of propositional logic.\<close> |
43 subsubsection \<open>Semantics of propositional logic.\<close> |
44 |
44 |
45 primrec eval :: "['a set, 'a pl] => bool" ("_[[_]]" [100,0] 100) |
45 primrec eval :: "['a set, 'a pl] => bool" (\<open>_[[_]]\<close> [100,0] 100) |
46 where |
46 where |
47 "tt[[false]] = False" |
47 "tt[[false]] = False" |
48 | "tt[[#v]] = (v \<in> tt)" |
48 | "tt[[#v]] = (v \<in> tt)" |
49 | eval_imp: "tt[[p\<rightharpoonup>q]] = (tt[[p]] \<longrightarrow> tt[[q]])" |
49 | eval_imp: "tt[[p\<rightharpoonup>q]] = (tt[[p]] \<longrightarrow> tt[[q]])" |
50 |
50 |
65 text \<open> |
65 text \<open> |
66 For every valuation, if all elements of \<open>H\<close> are true then so |
66 For every valuation, if all elements of \<open>H\<close> are true then so |
67 is \<open>p\<close>. |
67 is \<open>p\<close>. |
68 \<close> |
68 \<close> |
69 |
69 |
70 definition sat :: "['a pl set, 'a pl] => bool" (infixl "\<Turnstile>" 50) |
70 definition sat :: "['a pl set, 'a pl] => bool" (infixl \<open>\<Turnstile>\<close> 50) |
71 where "H \<Turnstile> p = (\<forall>tt. (\<forall>q\<in>H. tt[[q]]) \<longrightarrow> tt[[p]])" |
71 where "H \<Turnstile> p = (\<forall>tt. (\<forall>q\<in>H. tt[[q]]) \<longrightarrow> tt[[p]])" |
72 |
72 |
73 |
73 |
74 subsection \<open>Proof theory of propositional logic\<close> |
74 subsection \<open>Proof theory of propositional logic\<close> |
75 |
75 |