README.md 2.34 KB
Newer Older
jfschaefer's avatar
jfschaefer committed
1
GLF Demo
jfschaefer's avatar
jfschaefer committed
2
3
---

jfschaefer's avatar
jfschaefer committed
4
GLF (*G*rammatical *L*ogical *F*ramework) is a framework for developing natural-language semantics systems.
jfschaefer's avatar
jfschaefer committed
5
6
7
8
It combines the [Grammatical Framework](https://www.grammaticalframework.org/) and [MMT](https://uniformal.github.io/doc/)
to support the full pipeline from natural-language parsing to semantics construction and logic development.

We are in the process of developing an unified interface the creation of a natural-language semantics system.
jfschaefer's avatar
jfschaefer committed
9
This demo is intended as an easy-to-setup version that doesn't require setting up MMT and hopefully works out of the box if GF is installed.
jfschaefer's avatar
jfschaefer committed
10

jfschaefer's avatar
jfschaefer committed
11
You can find more information about GLF in [this](https://kwarc.info/people/mkohlhase/submit/lfmtp-19.pdf) paper.
jfschaefer's avatar
jfschaefer committed
12
13
14
15
16
17

Prerequisites
===

You need to have the [Grammatical Framework](https://www.grammaticalframework.org/) installed and `gf`
needs to be in your path.
jfschaefer's avatar
jfschaefer committed
18
Note that the demos have only been tested on UNIX systems.
jfschaefer's avatar
jfschaefer committed
19

jfschaefer's avatar
jfschaefer committed
20
21
22
23
24

Running the Demos (easy)
===

The easiest way to run the demo is to download the `demo.zip` file, extract it, and then run the
jfschaefer's avatar
jfschaefer committed
25
demo files (`quantified_demo.sh` etc.).
jfschaefer's avatar
jfschaefer committed
26
27
28
29
30
31
32
33


Running the Demos (advanced)
===

If you want to modify some code, you can create the GLF jar with `sbt assembly`.
You will need to adjust the path to `mmt.jar` in the `build.sbt` file.

jfschaefer's avatar
jfschaefer committed
34
You can also setup MMT on your machine (recommended if you want to change the language theories or semantics construction). The GLF was only tested with MMT version 16, other versions are likely to be incompatible.
jfschaefer's avatar
jfschaefer committed
35
36
37
38

In both cases, you will need to modify the class path in the demo scripts to the new GLF jar and MMT jar.


jfschaefer's avatar
jfschaefer committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Example Inputs
===

#### `life_demo.sh`

* *Joan loves herself*
* *Joan runs and Mary runs*

#### `quantified_demo.sh`

* *everyone loves John*
* *Mary loves someone*
* *John and Mary run*

#### `tableau_demo.sh`

* *John runs*
* *if John loves Mary then Mary loves John*
* *John doesn't run or John loves Mary*

#### `modal_demo.sh`

* *John runs*
* *John isn't allowed to run*
* *Mary believes John has to run*


jfschaefer's avatar
jfschaefer committed
66
67
68
69
70
71
Experimenting with the Grammars
===

You can either use the plain `.gf` or `.pgf` files in the `MathHub/COMMA/glf/source/lfmtp2019/` folder or
you can use the Jupyter notebooks containing the grammars (`jupyter_grammars` directory).
For the latter, you will need to install the GF kernel for Jupyter ([https://github.com/kwarc/gf_kernel](https://github.com/kwarc/gf_kernel)).