Skip to content

Commit 2bf80fb

Browse files
committed
Update experiments, fix type in cli, rename files with grammars
1 parent ea8db26 commit 2bf80fb

File tree

6 files changed

+23
-22
lines changed

6 files changed

+23
-22
lines changed

README.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This conversion uses the same set of generators as the original, but smaller siz
3434
### Second modified conversion (in `second_b` approach)
3535
This conversion uses different set of generators as opposed to the first conversion
3636

37-
<img src="https://latex.codecogs.com/png.latex?\\&space;G(T)&space;=&space;\{&space;q,&space;h,&space;s_0,&space;\ldots,&space;s_M,&space;q_0,&space;\ldots,&space;q_N,&space;q^R_0,&space;\ldots,&space;q^R_N&space;\}&space;\\&space;R(T)&space;=&space;\forall&space;\alpha&space;\in&space;0..N,&space;\beta&space;\in&space;0..M&space;:&space;\\&space;\begin{array}{r@{~=~}lc@{~if~}c@{~\in&space;T}}&space;q_i&space;s_j&space;&&space;q_l&space;s_k&space;&&space;&&space;q_i&space;s_j&space;s_k&space;q_l&space;\\&space;q_i&space;s_j&space;&&space;s_j&space;q_l&space;&&space;&&space;q_i&space;s_i&space;R&space;q_l&space;\\&space;s_j&space;q^R_i&space;&&space;q^R_l&space;s_j&space;&&space;&&space;q_i&space;s_i&space;L&space;q_l&space;\\&space;q_\alpha&space;s_\beta&space;&&space;s_\beta&space;q^R_\alpha&space;\\&space;q_\alpha&space;h&space;&&space;s_0&space;q^R_\alpha&space;h&space;\\&space;h&space;q^R_\alpha&space;&&space;h&space;q_\alpha&space;s_0&space;\\&space;q_0&space;s_\beta&space;&&space;q_0&space;\\&space;s_\beta&space;q_0&space;h&space;&&space;q_0&space;h&space;\\&space;h&space;q_0&space;h&space;&&space;q&space;\end{array}" />
37+
<img src="https://latex.codecogs.com/png.latex?\\&space;G(T)&space;=&space;\{&space;q,&space;h,&space;s_0,&space;\ldots,&space;s_M,&space;q_0,&space;\ldots,&space;q_N,&space;q^R_0,&space;\ldots,&space;q^R_N&space;\}&space;\\&space;R(T)&space;=&space;\forall&space;\alpha&space;\in&space;0..N,&space;\beta&space;\in&space;0..M&space;:&space;\\&space;\begin{array}{r@{~=~}lc@{~if~}c@{~\in&space;T}}&space;q_i&space;s_j&space;&&space;q_l&space;s_k&space;&&space;&&space;q_i&space;s_j&space;s_k&space;q_l&space;\\&space;q_i&space;h&space;&&space;q_l&space;s_k&space;h&space;&&space;&&space;q_i&space;s_0&space;s_k&space;q_l&space;\\&space;q_i&space;s_j&space;&&space;s_j&space;q_l&space;&&space;&&space;q_i&space;s_i&space;R&space;q_l&space;\\&space;q_i&space;h&space;&&space;s_0&space;q_l&space;h&space;&&space;&&space;q_i&space;s_0&space;R&space;q_l&space;\\&space;s_j&space;q^R_i&space;&&space;q^R_l&space;s_j&space;&&space;&&space;q_i&space;s_i&space;L&space;q_l&space;\\&space;h&space;q^R_i&space;&&space;h&space;q^R_l&space;s_0&space;&&space;&&space;q_i&space;s_0&space;L&space;q_l&space;\\&space;q_\alpha&space;s_\beta&space;&&space;s_\beta&space;q^R_\alpha&space;\\&space;q_\alpha&space;h&space;&&space;s_0&space;q^R_\alpha&space;h&space;\\&space;h&space;q^R_\alpha&space;&&space;h&space;q_\alpha&space;s_0&space;\\&space;q_0&space;s_\beta&space;&&space;q_0&space;\\&space;s_\beta&space;q_0&space;h&space;&&space;q_0&space;h&space;\\&space;h&space;q_0&space;h&space;&&space;q&space;\end{array}" />
3838

3939
## Build status
4040
[![Build Status](https://travis-ci.org/YaccConstructor/LangToGroup.svg?branch=master)](https://travis-ci.org/YaccConstructor/LangToGroup)
@@ -62,12 +62,12 @@ Options:
6262
-e file_path --error=file_path Full path to file, where errors should be recorded during parsing
6363
-a approach --approach=approach Used approach, can be 'first', 'second', 'second_a' or 'second_b'
6464
-L --LaTeX Print result in LaTeX format (while doesn't work)
65-
-I objects --info=objects Print useful information about objects. Objects must be separeted by comma. Every object must be 'grammar', 'turing_machine' or 'group_presentation' string.
65+
-I objects --info=objects Print useful information about objects. Objects must be separeted by comma without spaces. Every object must be 'grammar', 'turing_machine' or 'group_presentation' string.
6666
-h --help Print help and exit
6767
```
6868

6969
For example, if you want build presentation of grammar via second modification of the second approach and get metrics of produced group presentation, you should type options:
70-
`-i grammar.txt -a second_b -I group_presentation`
70+
`-i grammar.txt -a second_b -I grammar,turing_machine,group_presentation`
7171

7272
And if you want to build presentation of grammar via first approach and save produced group presentation to file, you should type options:
7373
`-i grammar.txt -o group_presentation.txt -a first`
@@ -105,17 +105,18 @@ Here are the tables with some examples of building group presentations by differ
105105

106106
| Language | Grammar | N | States | Generators | Relations |
107107
| -- | -- |-- | -- | -- | --|
108-
| 1 rule | CFG |1 | 4 | 56187 | 89508 |
109-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{*} \}"> | CFG |3 | 9 | 204903 | 347370 |
110-
| Dyck | CFG |6 | 19 | 957619 | 1478859 |
108+
| 1 rule | CFG | 1 | 6 | 89508 | 56187 |
109+
| Dyck language without empty word| CFG | 10 | 77 | 2798322 | 1773449 |
110+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} \mid n \in N \}"> | CFG| 2 | 10 | 228160 | 129611 |
111+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} \mid n \in N \}"> | CFG| 5 | 63 | 2241518 | 1355357 |
111112

112113

113114
### Running experiments for the second approach
114115

115116
| Language | Grammar | N | States | Generators | Relations |
116117
|----------|---------|---|------------|-----------| --|
117118
| 1 rule | CFG | 1 | 120 | 2300 | 28171 |
118-
| Dyck language without empty word | CFG | 10 | 1471 | 69755 | 1911168 |
119+
| Dyck language without empty word | CFG | 10 | 943 | 40414 | 1025570 |
119120
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} \mid n \in N \}"> | CFG| 2 | 221 | 7384 | 149982 |
120121
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} \mid n \in N \}"> | CFG| 5 | 719 | 29510 | 719150 |
121122
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} c^{n} \mid n \in N \}"> | Conjunctive | 14 | 3459 | 179112 | 5619872 |
@@ -125,24 +126,24 @@ Here are the tables with some examples of building group presentations by differ
125126
### Running experiments for the second approach, modification `a`
126127
| Language | Grammar | N | States | Generators | Relations |
127128
|----------|---------|---|------------|-----------| --|
128-
| 1 rule | CFG | 1 | 120 | 1562 | 18590 |
129-
| Dyck language without empty word| CFG | 10 | 1471 | 31934 | 852208 |
130-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} \mid n \in N \}"> | CFG| 2 | 221 | 4191 | 82950 |
131-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} \mid n \in N \}"> | CFG| 5 | 719 | 14348 | 340125 |
132-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} c^{n} \mid n \in N \}"> | Conjunctive | 14 | 3459 | 79021 | 2416992 |
133-
| <img src="https://render.githubusercontent.com/render/math?math=\{ww \mid w \in \{a,b\}*\}">| Boolean| 14 | 2498 | 58358 | 1674930 |
134-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{m} b^{n} c^{n} \mid (m != n), m, n \in N\}"> | Boolean | 14 | 3461 |81374 | 2570073|
129+
| 1 rule | CFG | 1 | 120 | 1564 | 18603 |
130+
| Dyck language without empty word| CFG | 10 | 943 | 19221 | 474552 |
131+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} \mid n \in N \}"> | CFG| 2 | 221 | 4193 | 82971 |
132+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} \mid n \in N \}"> | CFG| 5 | 719 | 14350 | 340150 |
133+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} c^{n} \mid n \in N \}"> | Conjunctive | 14 | 3459 | 79023 | 2417024 |
134+
| <img src="https://render.githubusercontent.com/render/math?math=\{ww \mid w \in \{a,b\}*\}">| Boolean| 14 | 2498 | 58360 | 1674960 |
135+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{m} b^{n} c^{n} \mid (m != n), m, n \in N\}"> | Boolean | 14 | 3461 |81376 | 2570106|
135136

136137
### Running experiments for the second approach, modification `b`
137138
| Language | Grammar | N | States | Generators | Relations |
138139
|----------|---------|---|------------|-----------| --|
139-
| 1 rule | CFG | 1 | 120 | 926 | 8762 |
140-
| Dyck language without empty word | CFG | 10 | 1471 | 12683 | 271992 |
141-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} \mid n \in N \}"> | CFG| 2 | 221 | 1780 | 27678 |
142-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} \mid n \in N \}"> | CFG| 5 | 719 | 6080 | 115450 |
143-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} c^{n} \mid n \in N \}"> | Conjunctive | 14 | 3459 | 29695 | 727872 |
144-
| <img src="https://render.githubusercontent.com/render/math?math=\{ww \mid w \in \{a,b\}*\}">| Boolean| 14 | 2498 | 21649 | 498720 |
145-
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{m} b^{n} c^{n} \mid (m != n), m, n \in N\}"> | Boolean | 14 | 3461 | 29727 | 751509|
140+
| 1 rule | CFG | 1 | 120 | 881 | 8164 |
141+
| Dyck language without empty word | CFG | 10 | 943 | 7506 | 145444 |
142+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} \mid n \in N \}"> | CFG| 2 | 221 | 1683 | 25620 |
143+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} \mid n \in N \}"> | CFG| 5 | 719 | 5701 | 105950 |
144+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{n} b^{n} c^{n} \mid n \in N \}"> | Conjunctive | 14 | 3459 | 27624 | 661568 |
145+
| <img src="https://render.githubusercontent.com/render/math?math=\{ww \mid w \in \{a,b\}*\}">| Boolean| 14 | 2498 | 20200 | 455220 |
146+
| <img src="https://render.githubusercontent.com/render/math?math=\{a^{m} b^{n} c^{n} \mid (m != n), m, n \in N\}"> | Boolean | 14 | 3461 | 27655 | 683100 |
146147

147148

148149
## Execution

app/Object.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ objects =
3030
"Input grammar (context-free, conjunctive or boolean)"
3131
, Object ["turing_machine", "tm"] TuringMachine
3232
"Produced Turing machine (its type depends on used approach)"
33-
, Object ["group_prsentation", "gp"] GroupPresentation
33+
, Object ["group_presentation", "gp"] GroupPresentation
3434
"Produced group presentation"
3535
]
3636

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)