Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Logic of "all" + verbs + relative clauses, for a class at Indiana University

Path: ARC / ARC.hs
Views: 6871
1
2
:l AllVerbsRelativeClauses.hs
3
4
syntaxCheck "all admire all skunks love all who see all mammals"
5
syntaxCheck "all who admire all skunks love all who see all mammals"
6
syntaxCheck "some who admire all skunks love all who see all mammals"
7
syntaxCheck "junk who see all skunks love all mammals"
8
9
10
import Models
11
import Syntax2
12
testNouns1 =
13
[ M Cats [1,2,3,4],
14
M Dogs [4,5,6],
15
M Skunks [1,3,5,6],
16
M Sneetches [7],
17
M Chordates [1,2,3,4,5,6],
18
M Mammals []
19
]
20
21
testVerbs1 =
22
[ Vb Sees [(1,1),(1,4),(3,4),(2,5), (3,5), (3,6), (3,7)],
23
Vb Admires [(6,2), (4,1), (4,2), (4,3), (7,7)],
24
Vb Helps [(1,1), (2,2), (3,3), (4,5), (5,6)],
25
Vb Loves [],
26
Vb Hates [(6,7)]
27
]
28
29
testModel1 = Model
30
{Models.universe = [1,2,3,4,5,6,7],
31
cnDict = testNouns1,
32
verbDict = testVerbs1
33
}
34
35
testNouns2 =
36
[ M Cats [3,4],
37
M Dogs [],
38
M Skunks [1,2],
39
M Sneetches [],
40
M Chordates [1,2,3,4],
41
M Mammals []
42
]
43
44
testVerbs2 =
45
[ Vb Sees [(1,1),(1,4),(3,4)],
46
Vb Admires [(2,2), (1,1), (3,4), (4,3)],
47
Vb Helps [],
48
Vb Loves [(1,3),(1,4)],
49
Vb Hates [(2,4),(4,2)]
50
]
51
52
testModel2 = Model
53
{Models.universe = [1,2,3,4],
54
cnDict = testNouns2,
55
verbDict = testVerbs2
56
}
57
58
showModel testModel1
59
60
termEval "hate all sneetches" testModel1
61
termEval "see all hate all sneetches" testModel1
62
termEval "hate all see all sneetches" testModel2
63
termEval "dogs" testModel1
64
termEval "see all dogs" testModel1
65
66
67
evaluate testModel1 "all who admire all sneetches loves all skunks"
68
evaluate testModel1 "all who help all sneetches are sneetches"
69
evaluate testModel2 "all who see all dogs are cats"
70
evaluate testModel1 "all who see all who love all dogs are cats"
71
72
73
-- You can enter the assumptions one-by-one, as below.
74
-- Then put them in a list when you call the function.
75
76
a1 = "all who see all dogs are sneetches"
77
a2 = "all sneetches are chordates"
78
a3 = "all who love all who see all dogs are cats"
79
80
followsInARC [a1,a2,a3] "all who love all chordates are cats"
81
82
83
-- You also can list the assumptions one-on-a-line:
84
85
followsInARC ["all who see all skunks love all mammals",
86
"all who see all who hate all skunks see all mammals"]
87
"all who see all mammals hate all see all skunks"
88
89
90
-- You can do without assumptions: [] is the empty list.
91
92
followsInARC [] "all who see all dogs see all dogs"
93
94
95
followsInARC []
96
"all who see all who love all who admire all who hate all who see all skunks are mammals"
97
98
followsInARC ["all mammals hate all skunks",
99
"all skunks see all skunks",
100
"all who love all mammals are skunks",
101
"all boys see all who love all skunks",
102
"all who see all boys are mammals",
103
"all who see all boys see all skunks",
104
"all who see all skunks love all skunks"]
105
"all who see all who hate all skunks see all who love all mammals"
106
107