:: DTCONSTR semantic presentation
deffunc H1( set ) -> Element of NAT = 0;
deffunc H2( set , set , set ) -> Element of NAT = 0;
theorem Th1: :: DTCONSTR:1
theorem Th2: :: DTCONSTR:2
E3: dom (roots {} ) =
dom {}
by TREES_3:23, TREES_3:def 18
.=
{}
by FINSEQ_1:26
;
theorem Th3: :: DTCONSTR:3
theorem Th4: :: DTCONSTR:4
theorem Th5: :: DTCONSTR:5
theorem Th6: :: DTCONSTR:6
theorem Th7: :: DTCONSTR:7
theorem Th8: :: DTCONSTR:8
scheme :: DTCONSTR:sch 3
s3{ F
1()
-> Function, F
2()
-> non
empty DTConstrStr , F
3()
-> non
empty set , F
4(
set )
-> Element of F
3(), F
5(
set ,
set ,
set )
-> Element of F
3() } :
ex b
1 being
Subset of
(FinTrees [:the carrier of F2(),F3():]) st
( b
1 = Union F
1() & ( for b
2 being
Symbol of F
2() holds
( b
2 in Terminals F
2() implies
root-tree [b2,F4(b2)] in b
1 ) ) & ( for b
2 being
Symbol of F
2()
for b
3 being
FinSequence of b
1 holds
( b
2 ==> pr1 (roots b3) implies
[b2,F5(b2,(pr1 (roots b3)),(pr2 (roots b3)))] -tree b
3 in b
1 ) ) & ( for b
2 being
Subset of
(FinTrees [:the carrier of F2(),F3():]) holds
( ( for b
3 being
Symbol of F
2() holds
( b
3 in Terminals F
2() implies
root-tree [b3,F4(b3)] in b
2 ) ) & ( for b
3 being
Symbol of F
2()
for b
4 being
FinSequence of b
2 holds
( b
3 ==> pr1 (roots b4) implies
[b3,F5(b3,(pr1 (roots b4)),(pr2 (roots b4)))] -tree b
4 in b
2 ) ) implies b
1 c= b
2 ) ) )
provided
:: deftheorem Def1 DTCONSTR:def 1 :
canceled;
:: deftheorem Def2 DTCONSTR:def 2 :
canceled;
:: deftheorem Def3 DTCONSTR:def 3 :
canceled;
:: deftheorem Def4 defines TS DTCONSTR:def 4 :
defpred S1[ set , set ] means ( a1 = 1 & ( a2 = <*0*> or a2 = <*1*> ) );
:: deftheorem Def5 defines PeanoNat DTCONSTR:def 5 :
set c1 = PeanoNat ;
Lemma10:
the carrier of PeanoNat = {0,1}
by Def5;
then reconsider c2 = 0, c3 = 1 as Symbol of PeanoNat by TARSKI:def 2;
Lemma11:
( c3 ==> <*c2*> & c3 ==> <*c3*> )
by Def5;
Lemma12:
c3 ==> <*c2*>
by Def5;
Lemma13:
c3 ==> <*c3*>
by Def5;
Lemma14:
Terminals PeanoNat = { b1 where B is Symbol of PeanoNat : for b1 being FinSequence holds
not b1 ==> b2 }
by LANG1:def 2;
then Lemma16:
c2 in Terminals PeanoNat
by Lemma14;
Lemma17:
Terminals PeanoNat c= {c2}
Lemma18:
NonTerminals PeanoNat = { b1 where B is Symbol of PeanoNat : ex b1 being FinSequence st b1 ==> b2 }
by LANG1:def 3;
then Lemma19:
c3 in NonTerminals PeanoNat
by Lemma12;
then Lemma20:
{c3} c= NonTerminals PeanoNat
by ZFMISC_1:37;
Lemma21:
NonTerminals PeanoNat c= {c3}
then Lemma22:
NonTerminals PeanoNat = {c3}
by Lemma20, XBOOLE_0:def 10;
reconsider c4 = TS PeanoNat as non empty Subset of (FinTrees the carrier of PeanoNat ) by Def4, Lemma16;
:: deftheorem Def6 defines with_terminals DTCONSTR:def 6 :
:: deftheorem Def7 defines with_nonterminals DTCONSTR:def 7 :
:: deftheorem Def8 defines with_useful_nonterminals DTCONSTR:def 8 :
Lemma26:
( PeanoNat is with_terminals & PeanoNat is with_nonterminals & PeanoNat is with_useful_nonterminals )
:: deftheorem Def9 defines SubtreeSeq DTCONSTR:def 9 :
theorem Th9: :: DTCONSTR:9
theorem Th10: :: DTCONSTR:10
set c5 = PeanoNat ;
reconsider c6 = c2 as Terminal of PeanoNat by Lemma16;
reconsider c7 = c3 as NonTerminal of PeanoNat by Lemma19;
:: deftheorem Def10 defines plus-one DTCONSTR:def 10 :
deffunc H3( set , set , FinSequence of NAT ) -> Nat = plus-one a3;
:: deftheorem Def11 defines PN-to-NAT DTCONSTR:def 11 :
:: deftheorem Def12 defines PNsucc DTCONSTR:def 12 :
deffunc H4( set , Element of TS PeanoNat ) -> Element of TS PeanoNat = PNsucc a2;
:: deftheorem Def13 defines NAT-to-PN DTCONSTR:def 13 :
theorem Th11: :: DTCONSTR:11
E33: 0 =
PN-to-NAT . (root-tree c6)
by Def11
.=
PN-to-NAT . (NAT-to-PN . 0)
by Def13
;
theorem Th12: :: DTCONSTR:12
:: deftheorem Def14 defines FlattenSeq DTCONSTR:def 14 :
theorem Th13: :: DTCONSTR:13
definition
let c
8 be non
empty DTConstrStr ;
let c
9 be
DecoratedTree of the
carrier of c
8;
assume E37:
c
9 in TS c
8
;
defpred S
2[
set ] means a
1 in Terminals c
8;
deffunc H
5(
set )
-> set =
<*a1*>;
deffunc H
6(
set )
-> set =
{} ;
consider c
10 being
Function of the
carrier of c
8,
(Terminals c8) * such that E39:
for b
1 being
set holds
( b
1 in the
carrier of c
8 implies ( ( S
2[b
1] implies c
10 . b
1 = H
5(b
1) ) & ( not S
2[b
1] implies c
10 . b
1 = H
6(b
1) ) ) )
from FUNCT_2:sch 5(E38);
deffunc H
7(
Symbol of c
8)
-> Element of
(Terminals c8) * = c
10 . a
1;
deffunc H
8(
set ,
set ,
FinSequence of
(Terminals c8) * )
-> Element of
(Terminals c8) * =
FlattenSeq a
3;
deffunc H
9(
set )
-> set =
<*a1*>;
func TerminalString c
2 -> FinSequence of
Terminals a
1 means :
Def15:
:: DTCONSTR:def 15
ex b
1 being
Function of
TS a
1,
(Terminals a1) * st
( a
3 = b
1 . a
2 & ( for b
2 being
Symbol of a
1 holds
( b
2 in Terminals a
1 implies b
1 . (root-tree b2) = <*b2*> ) ) & ( for b
2 being
Symbol of a
1for b
3 being
FinSequence of
TS a
1 holds
( b
2 ==> roots b
3 implies b
1 . (b2 -tree b3) = FlattenSeq (b1 * b3) ) ) );
existence
ex b1 being FinSequence of Terminals c8ex b2 being Function of TS c8,(Terminals c8) * st
( b1 = b2 . c9 & ( for b3 being Symbol of c8 holds
( b3 in Terminals c8 implies b2 . (root-tree b3) = <*b3*> ) ) & ( for b3 being Symbol of c8
for b4 being FinSequence of TS c8 holds
( b3 ==> roots b4 implies b2 . (b3 -tree b4) = FlattenSeq (b2 * b4) ) ) )
uniqueness
for b1, b2 being FinSequence of Terminals c8 holds
( ex b3 being Function of TS c8,(Terminals c8) * st
( b1 = b3 . c9 & ( for b4 being Symbol of c8 holds
( b4 in Terminals c8 implies b3 . (root-tree b4) = <*b4*> ) ) & ( for b4 being Symbol of c8
for b5 being FinSequence of TS c8 holds
( b4 ==> roots b5 implies b3 . (b4 -tree b5) = FlattenSeq (b3 * b5) ) ) ) & ex b3 being Function of TS c8,(Terminals c8) * st
( b2 = b3 . c9 & ( for b4 being Symbol of c8 holds
( b4 in Terminals c8 implies b3 . (root-tree b4) = <*b4*> ) ) & ( for b4 being Symbol of c8
for b5 being FinSequence of TS c8 holds
( b4 ==> roots b5 implies b3 . (b4 -tree b5) = FlattenSeq (b3 * b5) ) ) ) implies b1 = b2 )
consider c
11 being
Function of the
carrier of c
8,the
carrier of c
8 * such that E41:
for b
1 being
set holds
( b
1 in the
carrier of c
8 implies c
11 . b
1 = H
9(b
1) )
from FUNCT_2:sch 2(E40);
deffunc H
10(
Symbol of c
8)
-> Element of the
carrier of c
8 * = c
11 . a
1;
deffunc H
11(
Symbol of c
8,
set ,
FinSequence of the
carrier of c
8 * )
-> Element of the
carrier of c
8 * =
(c11 . a1) ^ (FlattenSeq a3);
func PreTraversal c
2 -> FinSequence of the
carrier of a
1 means :
Def16:
:: DTCONSTR:def 16
ex b
1 being
Function of
TS a
1,the
carrier of a
1 * st
( a
3 = b
1 . a
2 & ( for b
2 being
Symbol of a
1 holds
( b
2 in Terminals a
1 implies b
1 . (root-tree b2) = <*b2*> ) ) & ( for b
2 being
Symbol of a
1for b
3 being
FinSequence of
TS a
1for b
4 being
FinSequence holds
( b
4 = roots b
3 & b
2 ==> b
4 implies for b
5 being
FinSequence of the
carrier of a
1 * holds
( b
5 = b
1 * b
3 implies b
1 . (b2 -tree b3) = <*b2*> ^ (FlattenSeq b5) ) ) ) );
existence
ex b1 being FinSequence of the carrier of c8ex b2 being Function of TS c8,the carrier of c8 * st
( b1 = b2 . c9 & ( for b3 being Symbol of c8 holds
( b3 in Terminals c8 implies b2 . (root-tree b3) = <*b3*> ) ) & ( for b3 being Symbol of c8
for b4 being FinSequence of TS c8
for b5 being FinSequence holds
( b5 = roots b4 & b3 ==> b5 implies for b6 being FinSequence of the carrier of c8 * holds
( b6 = b2 * b4 implies b2 . (b3 -tree b4) = <*b3*> ^ (FlattenSeq b6) ) ) ) )
uniqueness
for b1, b2 being FinSequence of the carrier of c8 holds
( ex b3 being Function of TS c8,the carrier of c8 * st
( b1 = b3 . c9 & ( for b4 being Symbol of c8 holds
( b4 in Terminals c8 implies b3 . (root-tree b4) = <*b4*> ) ) & ( for b4 being Symbol of c8
for b5 being FinSequence of TS c8
for b6 being FinSequence holds
( b6 = roots b5 & b4 ==> b6 implies for b7 being FinSequence of the carrier of c8 * holds
( b7 = b3 * b5 implies b3 . (b4 -tree b5) = <*b4*> ^ (FlattenSeq b7) ) ) ) ) & ex b3 being Function of TS c8,the carrier of c8 * st
( b2 = b3 . c9 & ( for b4 being Symbol of c8 holds
( b4 in Terminals c8 implies b3 . (root-tree b4) = <*b4*> ) ) & ( for b4 being Symbol of c8
for b5 being FinSequence of TS c8
for b6 being FinSequence holds
( b6 = roots b5 & b4 ==> b6 implies for b7 being FinSequence of the carrier of c8 * holds
( b7 = b3 * b5 implies b3 . (b4 -tree b5) = <*b4*> ^ (FlattenSeq b7) ) ) ) ) implies b1 = b2 )
deffunc H
12(
Symbol of c
8)
-> Element of the
carrier of c
8 * = c
11 . a
1;
deffunc H
13(
Symbol of c
8,
set ,
FinSequence of the
carrier of c
8 * )
-> Element of the
carrier of c
8 * =
(FlattenSeq a3) ^ (c11 . a1);
func PostTraversal c
2 -> FinSequence of the
carrier of a
1 means :
Def17:
:: DTCONSTR:def 17
ex b
1 being
Function of
TS a
1,the
carrier of a
1 * st
( a
3 = b
1 . a
2 & ( for b
2 being
Symbol of a
1 holds
( b
2 in Terminals a
1 implies b
1 . (root-tree b2) = <*b2*> ) ) & ( for b
2 being
Symbol of a
1for b
3 being
FinSequence of
TS a
1for b
4 being
FinSequence holds
( b
4 = roots b
3 & b
2 ==> b
4 implies for b
5 being
FinSequence of the
carrier of a
1 * holds
( b
5 = b
1 * b
3 implies b
1 . (b2 -tree b3) = (FlattenSeq b5) ^ <*b2*> ) ) ) );
existence
ex b1 being FinSequence of the carrier of c8ex b2 being Function of TS c8,the carrier of c8 * st
( b1 = b2 . c9 & ( for b3 being Symbol of c8 holds
( b3 in Terminals c8 implies b2 . (root-tree b3) = <*b3*> ) ) & ( for b3 being Symbol of c8
for b4 being FinSequence of TS c8
for b5 being FinSequence holds
( b5 = roots b4 & b3 ==> b5 implies for b6 being FinSequence of the carrier of c8 * holds
( b6 = b2 * b4 implies b2 . (b3 -tree b4) = (FlattenSeq b6) ^ <*b3*> ) ) ) )
uniqueness
for b1, b2 being FinSequence of the carrier of c8 holds
( ex b3 being Function of TS c8,the carrier of c8 * st
( b1 = b3 . c9 & ( for b4 being Symbol of c8 holds
( b4 in Terminals c8 implies b3 . (root-tree b4) = <*b4*> ) ) & ( for b4 being Symbol of c8
for b5 being FinSequence of TS c8
for b6 being FinSequence holds
( b6 = roots b5 & b4 ==> b6 implies for b7 being FinSequence of the carrier of c8 * holds
( b7 = b3 * b5 implies b3 . (b4 -tree b5) = (FlattenSeq b7) ^ <*b4*> ) ) ) ) & ex b3 being Function of TS c8,the carrier of c8 * st
( b2 = b3 . c9 & ( for b4 being Symbol of c8 holds
( b4 in Terminals c8 implies b3 . (root-tree b4) = <*b4*> ) ) & ( for b4 being Symbol of c8
for b5 being FinSequence of TS c8
for b6 being FinSequence holds
( b6 = roots b5 & b4 ==> b6 implies for b7 being FinSequence of the carrier of c8 * holds
( b7 = b3 * b5 implies b3 . (b4 -tree b5) = (FlattenSeq b7) ^ <*b4*> ) ) ) ) implies b1 = b2 )
end;
:: deftheorem Def15 defines TerminalString DTCONSTR:def 15 :
:: deftheorem Def16 defines PreTraversal DTCONSTR:def 16 :
:: deftheorem Def17 defines PostTraversal DTCONSTR:def 17 :
:: deftheorem Def18 defines TerminalLanguage DTCONSTR:def 18 :
:: deftheorem Def19 defines PreTraversalLanguage DTCONSTR:def 19 :
:: deftheorem Def20 defines PostTraversalLanguage DTCONSTR:def 20 :
theorem Th14: :: DTCONSTR:14
theorem Th15: :: DTCONSTR:15
theorem Th16: :: DTCONSTR:16
theorem Th17: :: DTCONSTR:17
theorem Th18: :: DTCONSTR:18
theorem Th19: :: DTCONSTR:19
theorem Th20: :: DTCONSTR:20
theorem Th21: :: DTCONSTR:21
theorem Th22: :: DTCONSTR:22
theorem Th23: :: DTCONSTR:23