Start of CONSTRUCTOR for the Grammar G41.grm Sat Apr 03 15:54:14 2004
Terminal alphabet
# 1 = #
# 2 = a
# 3 = b
# 4 = 1
# 5 = 0
Nonterminal alphabet
# 6 = `T'
# 7 = `S'
# 8 = `A'
# 9 = `B'
#10 = `C'
#11 = `D'
Productions
P 1: `T' -> # `S' #
P 2: `S' -> a `A'
P 3: `S' -> b `B'
P 4: `A' -> `C' `A' 1
P 5: `A' -> 0 1
P 6: `B' -> `D' `B' 1 1
P 7: `B' -> 0 1 1
P 8: `C' -> 0
P 9: `D' -> 0
Leftmost-set
Symbol | # | a | b | 1 | 0 | T | S | A | B | C | D |
6.T | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | 0 | * | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8.A | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | * | 0 |
9.B | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | * |
10.C | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 |
11.D | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 |
Rightmost-set
Symbol | # | a | b | 1 | 0 | T | S | A | B | C | D |
6.T | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | 0 | 0 | 0 | * | 0 | 0 | 0 | * | * | 0 | 0 |
8.A | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9.B | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10.C | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 |
11.D | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 |
Leftmost & rightmost sets
`T' leftmost set: `#'
`T' rightmost set: #
`S' leftmost set: `a' , `b'
`S' rightmost set: 1 , A , B
`A' leftmost set: `0' , `C'
`A' rightmost set: 1
`B' leftmost set: `0' , `D'
`B' rightmost set: 1
`C' leftmost set: `0'
`C' rightmost set: 0
`D' leftmost set: `0'
`D' rightmost set: 0
Precedence matrix
Symbol | # | a | b | 1 | 0 | T | S | A | B | C | D |
1.# | 0 | < | < | 0 | 0 | 0 | = | 0 | 0 | 0 | 0 |
2.a | 0 | 0 | 0 | 0 | < | 0 | 0 | = | 0 | < | 0 |
3.b | 0 | 0 | 0 | 0 | < | 0 | 0 | 0 | = | 0 | < |
4.1 | > | 0 | 0 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5.0 | 0 | 0 | 0 | = | > | 0 | 0 | > | > | > | > |
6.T | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8.A | > | 0 | 0 | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9.B | > | 0 | 0 | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10.C | 0 | 0 | 0 | 0 | < | 0 | 0 | = | 0 | < | 0 |
11.D | 0 | 0 | 0 | 0 | < | 0 | 0 | 0 | = | 0 | < |
The relationships of symbol #1 #:
The relationships of symbol #2 a:
The relationships of symbol #3 b:
The relationships of symbol #4 1:
The relationships of symbol #5 0:
= 1 | > 0 | > `A' | > `B' | > `C' | > `D' |
The relationships of symbol #6 `T':
The relationships of symbol #7 `S':
The relationships of symbol #8 `A':
The relationships of symbol #9 `B':
The relationships of symbol #10 `C':
The relationships of symbol #11 `D':
Precedence varies
P1-conflict: 1 => 1
The source is the production P 7: `B' -> 0 1 1
I'll add a new NT P10: `B1' -> 0 1
I'll change the production P 7: `B' -> `B1' 1
The source is the production P 6: `B' -> `D' `B' 1 1
I'll add a new NT P11: `B2' -> `D' `B' 1
I'll change the production P 6: `B' -> `B2' 1
New grammar
P 1: `T' -> # `S' #
P 2: `S' -> a `A'
P 3: `S' -> b `B'
P 4: `A' -> `C' `A' 1
P 5: `A' -> 0 1
P 6: `B' -> `B2' 1
P 7: `B' -> `B1' 1
P 8: `C' -> 0
P 9: `D' -> 0
P10: `B1' -> 0 1
P11: `B2' -> `D' `B' 1
Leftmost-set
Symbol | # | a | b | 1 | 0 | T | S | A | B | C | D | B1 | B2 |
6.T | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | 0 | * | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8.A | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 |
9.B | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | * | * | * |
10.C | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11.D | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
12.B1 | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13.B2 | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | * | 0 | 0 |
Rightmost-set
Symbol | # | a | b | 1 | 0 | T | S | A | B | C | D | B1 | B2 |
6.T | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | 0 | 0 | 0 | * | 0 | 0 | 0 | * | * | 0 | 0 | 0 | 0 |
8.A | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9.B | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10.C | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11.D | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
12.B1 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13.B2 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Leftmost & rightmost sets
`T' leftmost set: `#'
`T' rightmost set: #
`S' leftmost set: `a' , `b'
`S' rightmost set: 1 , A , B
`A' leftmost set: `0' , `C'
`A' rightmost set: 1
`B' leftmost set: `0' , `D' , `B1' , `B2'
`B' rightmost set: 1
`C' leftmost set: `0'
`C' rightmost set: 0
`D' leftmost set: `0'
`D' rightmost set: 0
`B1' leftmost set: `0'
`B1' rightmost set: 1
`B2' leftmost set: `0' , `D'
`B2' rightmost set: 1
Precedence matrix
Symbol | # | a | b | 1 | 0 | T | S | A | B | C | D | B1 | B2 |
1.# | 0 | < | < | 0 | 0 | 0 | = | 0 | 0 | 0 | 0 | 0 | 0 |
2.a | 0 | 0 | 0 | 0 | < | 0 | 0 | = | 0 | < | 0 | 0 | 0 |
3.b | 0 | 0 | 0 | 0 | < | 0 | 0 | 0 | = | 0 | < | < | < |
4.1 | > | 0 | 0 | > | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5.0 | 0 | 0 | 0 | = | > | 0 | 0 | > | > | > | > | > | > |
6.T | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8.A | > | 0 | 0 | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9.B | > | 0 | 0 | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10.C | 0 | 0 | 0 | 0 | < | 0 | 0 | = | 0 | < | 0 | 0 | 0 |
11.D | 0 | 0 | 0 | 0 | < | 0 | 0 | 0 | = | 0 | < | < | < |
12.B1 | 0 | 0 | 0 | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13.B2 | 0 | 0 | 0 | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The relationships of symbol #1 #:
The relationships of symbol #2 a:
The relationships of symbol #3 b:
< 0 | = `B' | < `D' | < `B1' | < `B2' |
The relationships of symbol #4 1:
The relationships of symbol #5 0:
= 1 | > 0 | > `A' | > `B' | > `C' | > `D' | > `B1' | > `B2' |
The relationships of symbol #6 `T':
The relationships of symbol #7 `S':
The relationships of symbol #8 `A':
The relationships of symbol #9 `B':
The relationships of symbol #10 `C':
The relationships of symbol #11 `D':
< 0 | = `B' | < `D' | < `B1' | < `B2' |
The relationships of symbol #12 `B1':
The relationships of symbol #13 `B2':
Grammar G41.grm is a precedence grammar
Grammar G41.grm is not invertible
Left Context
Symbol | # | a | b | 1 | 0 | T | S | A | B | C | D | B1 | B2 |
6.T | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8.A | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 |
9.B | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | * | 0 | 0 |
10.C | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | * | 0 | 0 | 0 |
11.D | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | * | 0 | 0 |
12.B1 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | * | 0 | 0 |
13.B2 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | * | 0 | 0 |
Right Context
Symbol | # | a | b | 1 | 0 |
6.T | 0 | 0 | 0 | 0 | 0 |
7.S | * | 0 | 0 | 0 | 0 |
8.A | * | 0 | 0 | * | 0 |
9.B | * | 0 | 0 | * | 0 |
10.C | 0 | 0 | 0 | 0 | * |
11.D | 0 | 0 | 0 | 0 | * |
12.B1 | 0 | 0 | 0 | * | 0 |
13.B2 | 0 | 0 | 0 | * | 0 |
Independent context
`T' left context:
`T' right context:
`S' left context: #
`S' right context: #
`A' left context: a , `C'
`A' right context: # , 1
`B' left context: b , `D'
`B' right context: # , 1
`C' left context: a , `C'
`C' right context: 0
`D' left context: b , `D'
`D' right context: 0
`B1' left context: b , `D'
`B1' right context: 1
`B2' left context: b , `D'
`B2' right context: 1
Equivalent definitions:
`A' > 0 1 & `B1' > 0 1
`A' left context: a , `C'
`A' right context: # , 1
`B1' left context: b , `D'
`B1' right context: 1
The left context of `A' and `B1' is different
Equivalent definitions:
`C' > 0 & `D' > 0
`C' left context: a , `C'
`C' right context: 0
`D' left context: b , `D'
`D' right context: 0
The left context of `C' and `D' is different
Grammar G41.grm is BRC(1|1)-reducible
Semantics
Semantics file is G41.sem
#=1
a=2
b=3
1=4
0=5
P1=6 $P 1: `T' -> # `S' #
P2=7 $P 2: `S' -> a `A'
P3=8 $P 3: `S' -> b `B'
P4=9 $P 4: `A' -> `C' `A' 1
P5=10 $P 5: `A' -> 0 1
P6=11 $P 6: `B' -> `B2' 1
P7=12 $P 7: `B' -> `B1' 1
P8=13 $P 8: `C' -> 0
P9=14 $P 9: `D' -> 0
P10=15 $P10: `B1' -> 0 1
P11=16 $P11: `B2' -> `D' `B' 1
Result tables
File | Size |
G41.prm | 28 |
G41.pm | 196 |
G41.t | 280 |
G41.tt | 120 |
G41.ht | 1468 |
G41.sm | 72 |
G41.v | 728 |
G41.lc | 196 |
G41.rc | 196 |
Look at result tablesFinish of CONSTRUCTOR Sat Apr 03 15:54:14 2004