forked from langcog/ibr_pragmods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemos.R
60 lines (50 loc) · 1.65 KB
/
demos.R
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
54
55
56
57
58
59
######################################################################
## DEMOS:
## Example from p. 9ff of the Jaeger handbook article:
ScalarImplicature = function() {
print("======================================================================")
print('Scalars')
print(IBR(scalars))
}
## No Scales condition from the Stiller et al. paper:
StillerNoscales = function() {
print("======================================================================")
print('Stiller no scales.')
print(IBR(stiller.noscales))
MatrixViz(stiller.noscales)
}
## Science paper referential game:
FrankGoodman = function() {
print("======================================================================")
print('Frank-Goodman')
print(IBR(fg))
}
## Example from p. 16-17 of the Jaeger handbook article:
Division = function() {
print("======================================================================")
print('Division of pragmatic labor (costly messages)')
print(IBR(hornutil, costs=horncosts))
}
## Evaluate from a string:
FromString = function(s) {
print("======================================================================")
print(paste('Processing string', s) )
return(eval(parse(text=s)))
}
## 4x4 matrix requring 7 iterations (the max):
Matrix7 = function() {
print("======================================================================")
print('4 x 4 matrix requiring 7 iterations in IBR')
print(IBR(m7))
ImageViz(m7, print.matrix=TRUE)
}
## All demos:
Demos = function() {
ScalarImplicature()
StillerNoscales()
FrankGoodman()
Division()
print(FromString('Lstar(Sstar(Lstar(S0(fg), fg)), fg)'))
Matrix7()
}
Demos()