Start of CONSTRUCTOR for the Grammar G10.grm Sat Apr 03 15:40:18 2004
Terminal alphabet
# 1 = #
# 2 = a
# 3 = b
# 4 = 1
# 5 = c
Nonterminal alphabet
# 6 = `T'
# 7 = `S'
# 8 = `A'
# 9 = `B'
Productions
P 1: `T' -> # `S' #
P 2: `S' -> a `A' a
P 3: `S' -> b `A' b
P 4: `S' -> a `B' b
P 5: `S' -> b `B' a
P 6: `A' -> 1
P 7: `B' -> 1
P 8: `A' -> `B' c
Leftmost-set
Symbol | # | a | b | 1 | c | T | S | A | B |
6.T | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | 0 | * | * | 0 | 0 | 0 | 0 | 0 | 0 |
8.A | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | * |
9.B | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 |
Rightmost-set
Symbol | # | a | b | 1 | c | T | S | A | B |
6.T | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | 0 | * | * | 0 | 0 | 0 | 0 | 0 | 0 |
8.A | 0 | 0 | 0 | * | * | 0 | 0 | 0 | 0 |
9.B | 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: a , b
`A' leftmost set: `1' , `B'
`A' rightmost set: 1 , c
`B' leftmost set: `1'
`B' rightmost set: 1
Precedence matrix
Symbol | # | a | b | 1 | c | T | S | A | B |
1.# | 0 | < | < | 0 | 0 | 0 | = | 0 | 0 |
2.a | > | 0 | 0 | < | 0 | 0 | 0 | = | 3 |
3.b | > | 0 | 0 | < | 0 | 0 | 0 | = | 3 |
4.1 | 0 | > | > | 0 | > | 0 | 0 | 0 | 0 |
5.c | 0 | > | > | 0 | 0 | 0 | 0 | 0 | 0 |
6.T | 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 |
9.B | 0 | = | = | 0 | = | 0 | 0 | 0 | 0 |
The relationships of symbol #1 #:
The relationships of symbol #2 a:
> # | < 1 | = `A' | <= `B' |
The relationships of symbol #3 b:
> # | < 1 | = `A' | <= `B' |
The relationships of symbol #4 1:
The relationships of symbol #5 c:
The relationships of symbol #6 `T':
The relationships of symbol #7 `S':
The relationships of symbol #8 `A':
The relationships of symbol #9 `B':
Precedence varies
P2-conflict: a <= `B'
The source is the production P 4: `S' -> a `B' b
I'll add a new NT P 9: `S1' -> `B' b
I'll change the production P 4: `S' -> a `S1'
P2-conflict: b <= `B'
The source is the production P 5: `S' -> b `B' a
I'll add a new NT P10: `S2' -> `B' a
I'll change the production P 5: `S' -> b `S2'
Leftmost-set
Symbol | # | a | b | 1 | c | T | S | A | B | S1 | S2 |
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 | 0 |
10.S1 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | * | 0 | 0 |
11.S2 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | * | 0 | 0 |
New grammar
P 1: `T' -> # `S' #
P 2: `S' -> a `A' a
P 3: `S' -> b `A' b
P 4: `S' -> a `S1'
P 5: `S' -> b `S2'
P 6: `A' -> 1
P 7: `B' -> 1
P 8: `A' -> `B' c
P 9: `S1' -> `B' b
P10: `S2' -> `B' a
Leftmost-set
Symbol | # | a | b | 1 | c | T | S | A | B | S1 | S2 |
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 | 0 |
10.S1 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | * | 0 | 0 |
11.S2 | 0 | 0 | 0 | * | 0 | 0 | 0 | 0 | * | 0 | 0 |
Rightmost-set
Symbol | # | a | b | 1 | c | T | S | A | B | S1 | S2 |
6.T | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7.S | 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 | 0 |
10.S1 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11.S2 | 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: a , b , S1 , S2
`A' leftmost set: `1' , `B'
`A' rightmost set: 1 , c
`B' leftmost set: `1'
`B' rightmost set: 1
`S1' leftmost set: `1' , `B'
`S1' rightmost set: b
`S2' leftmost set: `1' , `B'
`S2' rightmost set: a
Precedence matrix
Symbol | # | a | b | 1 | c | T | S | A | B | S1 | S2 |
1.# | 0 | < | < | 0 | 0 | 0 | = | 0 | 0 | 0 | 0 |
2.a | > | 0 | 0 | < | 0 | 0 | 0 | = | < | = | 0 |
3.b | > | 0 | 0 | < | 0 | 0 | 0 | = | < | 0 | = |
4.1 | 0 | > | > | 0 | > | 0 | 0 | 0 | 0 | 0 | 0 |
5.c | 0 | > | > | 0 | 0 | 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 |
10.S1 | > | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11.S2 | > | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The relationships of symbol #1 #:
The relationships of symbol #2 a:
> # | < 1 | = `A' | < `B' | = `S1' |
The relationships of symbol #3 b:
> # | < 1 | = `A' | < `B' | = `S2' |
The relationships of symbol #4 1:
The relationships of symbol #5 c:
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 `S1':
The relationships of symbol #11 `S2':
Grammar G10.grm is a precedence grammar
Grammar G10.grm is not invertible
Left Context
Symbol | # | a | b | 1 | c | T | S | A | B | S1 | S2 |
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.S1 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11.S2 | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Right Context
Symbol | # | a | b | 1 | c |
6.T | 0 | 0 | 0 | 0 | 0 |
7.S | * | 0 | 0 | 0 | 0 |
8.A | 0 | * | * | 0 | 0 |
9.B | 0 | * | * | 0 | * |
10.S1 | * | 0 | 0 | 0 | 0 |
11.S2 | * | 0 | 0 | 0 | 0 |
Independent context
`T' left context:
`T' right context:
`S' left context: #
`S' right context: #
`A' left context: a , b
`A' right context: a , b
`B' left context: a , b
`B' right context: a , b , c
`S1' left context: a
`S1' right context: #
`S2' left context: b
`S2' right context: #
Equivalent definitions:
`A' > 1 & `B' > 1
`A' left context: a , b
`A' right context: a , b
`B' left context: a , b
`B' right context: a , b , c
The independent context of `A' and `B' is not different
independent context didn't help us. I'll try to use the dependent one.
I'll find the subsets of dependent context of `A'
gamma1: the source is the production
P=2 `S' -> a `A' a
{a , a}
gamma1: the source is the production
P=3 `S' -> b `A' b
{b , b}
The set of dependent context of `A':
{a , a} {b , b}
I'll find the subsets of dependent context of `B'
gamma3: the source is the production
P=9 `S1' -> `B' b
{a , b}
gamma3: the source is the production
P=10 `S2' -> `B' a
{b , a}
gamma3: the source is the production
P=8 `A' -> `B' c
{a , c} {b , c}
The set of dependent context of `B':
{a , b} {a , c} {b , a} {b , c}
test_dep_con A and B
dependent context of `A' and `B' is different
Grammar G10.grm is BRC(1,1)-reducible
Dependent context
dependent context of `A':
{a , a} {b , b}
dependent context of `B':
{a , b} {a , c} {b , a} {b , c}
Semantics
Semantics file is G10.sem
#=1
a=2
b=3
1=4
c=5
P1=6 $P 1: `T' -> # `S' #
P2=7 $P 2: `S' -> a `A' a
P3=8 $P 3: `S' -> b `A' b
P4=9 $P 4: `S' -> a `S1'
P5=10 $P 5: `S' -> b `S2'
P6=11 $P 6: `A' -> 1
P7=12 $P 7: `B' -> 1
P8=13 $P 8: `A' -> `B' c
P9=14 $P 9: `S1' -> `B' b
P10=15 $P10: `S2' -> `B' a
Result tables
File | Size |
G10.prm | 28 |
G10.pm | 144 |
G10.t | 240 |
G10.tt | 120 |
G10.ht | 1428 |
G10.sm | 68 |
G10.v | 636 |
G10.lc | 144 |
G10.rc | 144 |
G10.dc | 168 |
Look at result tablesFinish of CONSTRUCTOR Sat Apr 03 15:40:18 2004