Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Logic of "all" + verbs + relative clauses, for a class at Indiana University
Project: moss notebooks
Views: 72451:l AllVerbsRelativeClauses.hs23syntaxCheck "all admire all skunks love all who see all mammals"4syntaxCheck "all who admire all skunks love all who see all mammals"5syntaxCheck "some who admire all skunks love all who see all mammals"6syntaxCheck "junk who see all skunks love all mammals"789import Models10import Syntax211testNouns1 =12[ M Cats [1,2,3,4],13M Dogs [4,5,6],14M Skunks [1,3,5,6],15M Sneetches [7],16M Chordates [1,2,3,4,5,6],17M Mammals []18]1920testVerbs1 =21[ Vb Sees [(1,1),(1,4),(3,4),(2,5), (3,5), (3,6), (3,7)],22Vb Admires [(6,2), (4,1), (4,2), (4,3), (7,7)],23Vb Helps [(1,1), (2,2), (3,3), (4,5), (5,6)],24Vb Loves [],25Vb Hates [(6,7)]26]2728testModel1 = Model29{Models.universe = [1,2,3,4,5,6,7],30cnDict = testNouns1,31verbDict = testVerbs132}3334testNouns2 =35[ M Cats [3,4],36M Dogs [],37M Skunks [1,2],38M Sneetches [],39M Chordates [1,2,3,4],40M Mammals []41]4243testVerbs2 =44[ Vb Sees [(1,1),(1,4),(3,4)],45Vb Admires [(2,2), (1,1), (3,4), (4,3)],46Vb Helps [],47Vb Loves [(1,3),(1,4)],48Vb Hates [(2,4),(4,2)]49]5051testModel2 = Model52{Models.universe = [1,2,3,4],53cnDict = testNouns2,54verbDict = testVerbs255}5657showModel testModel15859termEval "hate all sneetches" testModel160termEval "see all hate all sneetches" testModel161termEval "hate all see all sneetches" testModel262termEval "dogs" testModel163termEval "see all dogs" testModel1646566evaluate testModel1 "all who admire all sneetches loves all skunks"67evaluate testModel1 "all who help all sneetches are sneetches"68evaluate testModel2 "all who see all dogs are cats"69evaluate testModel1 "all who see all who love all dogs are cats"707172-- You can enter the assumptions one-by-one, as below.73-- Then put them in a list when you call the function.7475a1 = "all who see all dogs are sneetches"76a2 = "all sneetches are chordates"77a3 = "all who love all who see all dogs are cats"7879followsInARC [a1,a2,a3] "all who love all chordates are cats"808182-- You also can list the assumptions one-on-a-line:8384followsInARC ["all who see all skunks love all mammals",85"all who see all who hate all skunks see all mammals"]86"all who see all mammals hate all see all skunks"878889-- You can do without assumptions: [] is the empty list.9091followsInARC [] "all who see all dogs see all dogs"929394followsInARC []95"all who see all who love all who admire all who hate all who see all skunks are mammals"9697followsInARC ["all mammals hate all skunks",98"all skunks see all skunks",99"all who love all mammals are skunks",100"all boys see all who love all skunks",101"all who see all boys are mammals",102"all who see all boys see all skunks",103"all who see all skunks love all skunks"]104"all who see all who hate all skunks see all who love all mammals"105106107