-
Notifications
You must be signed in to change notification settings - Fork 1
/
Propositional.py
53 lines (50 loc) · 897 Bytes
/
Propositional.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from logic import *
P,Q,R,S = vars('P', 'Q', 'R', 'S')
# valid argument forms
modus_ponens = ArgumentForm(
P, P >> Q,
conclusion = Q
)
modus_tollens = ArgumentForm(
P >> Q, ~Q,
conclusion = ~P
)
disjunctive_syllogism = ArgumentForm(
P | Q, ~P,
conclusion = Q
)
hypothetical_syllogism = ArgumentForm(
P >> Q, Q >> R,
conclusion = R
)
dilemma = ArgumentForm(
P | Q, P >> R, Q >> S,
conclusion = R | S
)
explosion_principle = ArgumentForm(
False,
conclusion = P
)
tautology_from_no_premises = ArgumentForm(
conclusion = True
)
# invalid argument forms
non_sequitur = ArgumentForm(
P,
conclusion = Q
)
affirming_the_consequent = ArgumentForm(
P >> Q, Q,
conclusion = P
)
denying_the_antecedent = ArgumentForm(
P >> Q, ~P,
conclusion = ~Q
)
fallacy_of_the_excluded_middle = ArgumentForm(
P | Q, P,
conclusion = ~Q
)
contingency_from_no_premises = ArgumentForm(
conclusion = P
)