:: DTCONSTR semantic presentation :: Showing IDV graph ... (Click the Palm Trees again to close it)
deffunc H1( set ) -> Element of NAT = 0;
deffunc H2( set , set , set ) -> Element of NAT = 0;
theorem Th1: :: DTCONSTR:1 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th2: :: DTCONSTR:2 :: Showing IDV graph ... (Click the Palm Tree again to close it)
Lm1: dom (roots {} ) =
dom {}
by TREES_3:23, TREES_3:def 18
.=
{}
by FINSEQ_1:26
;
theorem Th3: :: DTCONSTR:3 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th4: :: DTCONSTR:4 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th5: :: DTCONSTR:5 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: DTCONSTR:6 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th7: :: DTCONSTR:7 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: DTCONSTR:8 :: Showing IDV graph ... (Click the Palm Tree again to close it)
scheme :: DTCONSTR:sch 3
DTCMin{
F1()
-> Function,
F2()
-> non
empty DTConstrStr ,
F3()
-> non
empty set ,
F4(
set )
-> Element of
F3(),
F5(
set ,
set ,
set )
-> Element of
F3() } :
ex
X being
Subset of
(FinTrees [:the carrier of F2(),F3():]) st
(
X = Union F1() & ( for
d being
Symbol of
F2() st
d in Terminals F2() holds
root-tree [d,F4(d)] in X ) & ( for
o being
Symbol of
F2()
for
p being
FinSequence of
X st
o ==> pr1 (roots p) holds
[o,F5(o,(pr1 (roots p)),(pr2 (roots p)))] -tree p in X ) & ( for
F being
Subset of
(FinTrees [:the carrier of F2(),F3():]) st ( for
d being
Symbol of
F2() st
d in Terminals F2() holds
root-tree [d,F4(d)] in F ) & ( for
o being
Symbol of
F2()
for
p being
FinSequence of
F st
o ==> pr1 (roots p) holds
[o,F5(o,(pr1 (roots p)),(pr2 (roots p)))] -tree p in F ) holds
X c= F ) )
provided
:: deftheorem DTCONSTR:def 1 :
canceled;
:: deftheorem DTCONSTR:def 2 :
canceled;
:: deftheorem DTCONSTR:def 3 :
canceled;
:: deftheorem Def4 defines TS DTCONSTR:def 4 :
defpred S1[ set , set ] means ( $1 = 1 & ( $2 = <*0*> or $2 = <*1*> ) );
:: deftheorem Def5 defines PeanoNat DTCONSTR:def 5 :
set PN = PeanoNat ;
Lm2:
the carrier of PeanoNat = {0,1}
by Def5;
then reconsider O = 0, S = 1 as Symbol of PeanoNat by TARSKI:def 2;
Lm3:
( S ==> <*O*> & S ==> <*S*> )
by Def5;
Lm4:
S ==> <*O*>
by Def5;
Lm5:
S ==> <*S*>
by Def5;
Lm6:
Terminals PeanoNat = { x where x is Symbol of PeanoNat : for tnt being FinSequence holds not x ==> tnt }
by LANG1:def 2;
then Lm8:
O in Terminals PeanoNat
by Lm6;
Lm9:
Terminals PeanoNat c= {O}
Lm10:
NonTerminals PeanoNat = { x where x is Symbol of PeanoNat : ex tnt being FinSequence st x ==> tnt }
by LANG1:def 3;
then Lm11:
S in NonTerminals PeanoNat
by Lm4;
then Lm12:
{S} c= NonTerminals PeanoNat
by ZFMISC_1:37;
Lm13:
NonTerminals PeanoNat c= {S}
then Lm14:
NonTerminals PeanoNat = {S}
by Lm12, XBOOLE_0:def 10;
reconsider TSPN = TS PeanoNat as non empty Subset of (FinTrees the carrier of PeanoNat ) by Def4, Lm8;
:: 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 :
Lm15:
( PeanoNat is with_terminals & PeanoNat is with_nonterminals & PeanoNat is with_useful_nonterminals )
:: deftheorem Def9 defines SubtreeSeq DTCONSTR:def 9 :
theorem Th9: :: DTCONSTR:9 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th10: :: DTCONSTR:10 :: Showing IDV graph ... (Click the Palm Tree again to close it)
set PN = PeanoNat ;
reconsider O = O as Terminal of PeanoNat by Lm8;
reconsider S = S as NonTerminal of PeanoNat by Lm11;
:: deftheorem Def10 defines plus-one DTCONSTR:def 10 :
deffunc H3( set , set , FinSequence of NAT ) -> Nat = plus-one $3;
:: deftheorem Def11 defines PN-to-NAT DTCONSTR:def 11 :
:: deftheorem defines PNsucc DTCONSTR:def 12 :
deffunc H4( set , Element of TS PeanoNat ) -> Element of TS PeanoNat = PNsucc $2;
:: deftheorem Def13 defines NAT-to-PN DTCONSTR:def 13 :
theorem :: DTCONSTR:11 :: Showing IDV graph ... (Click the Palm Tree again to close it)
Lm16: 0 =
PN-to-NAT . (root-tree O)
by Def11
.=
PN-to-NAT . (NAT-to-PN . 0)
by Def13
;
theorem :: DTCONSTR:12 :: Showing IDV graph ... (Click the Palm Tree again to close it)
:: deftheorem Def14 defines FlattenSeq DTCONSTR:def 14 :
theorem Th13: :: DTCONSTR:13 :: Showing IDV graph ... (Click the Palm Tree again to close it)
definition
let G be non
empty DTConstrStr ;
let tsg be
DecoratedTree of the
carrier of
G;
assume A1:
tsg in TS G
;
defpred S2[
set ]
means $1
in Terminals G;
deffunc H5(
set )
-> set =
<*$1*>;
deffunc H6(
set )
-> set =
{} ;
consider s2t being
Function of the
carrier of
G,
(Terminals G) * such that A4:
for
s being
set st
s in the
carrier of
G holds
( (
S2[
s] implies
s2t . s = H5(
s) ) & ( not
S2[
s] implies
s2t . s = H6(
s) ) )
from FUNCT_2:sch 9(
the carrier of nt
(Terminals nt) *
, A2);
deffunc H7(
Symbol of
G)
-> Element of
(Terminals G) * =
s2t . $1;
deffunc H8(
set ,
set ,
FinSequence of
(Terminals G) * )
-> Element of
(Terminals G) * =
FlattenSeq $3;
deffunc H9(
set )
-> set =
<*$1*>;
func TerminalString tsg -> FinSequence of
Terminals G means :
Def15:
:: DTCONSTR:def 15
ex
f being
Function of
TS G,
(Terminals G) * st
(
it = f . tsg & ( for
t being
Symbol of
G st
t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for
nt being
Symbol of
G for
ts being
FinSequence of
TS G st
nt ==> roots ts holds
f . (nt -tree ts) = FlattenSeq (f * ts) ) );
existence
ex b1 being FinSequence of Terminals G ex f being Function of TS G,(Terminals G) * st
( b1 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G st nt ==> roots ts holds
f . (nt -tree ts) = FlattenSeq (f * ts) ) )
uniqueness
for b1, b2 being FinSequence of Terminals G st ex f being Function of TS G,(Terminals G) * st
( b1 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G st nt ==> roots ts holds
f . (nt -tree ts) = FlattenSeq (f * ts) ) ) & ex f being Function of TS G,(Terminals G) * st
( b2 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G st nt ==> roots ts holds
f . (nt -tree ts) = FlattenSeq (f * ts) ) ) holds
b1 = b2
consider s2s being
Function of the
carrier of
G,the
carrier of
G * such that A14:
for
s being
set st
s in the
carrier of
G holds
s2s . s = H9(
s)
from FUNCT_2:sch 2(
the carrier of nt
the carrier of nt *
, A13);
deffunc H10(
Symbol of
G)
-> Element of the
carrier of
G * =
s2s . $1;
deffunc H11(
Symbol of
G,
set ,
FinSequence of the
carrier of
G * )
-> Element of the
carrier of
G * =
(s2s . $1) ^ (FlattenSeq $3);
func PreTraversal tsg -> FinSequence of the
carrier of
G means :
Def16:
:: DTCONSTR:def 16
ex
f being
Function of
TS G,the
carrier of
G * st
(
it = f . tsg & ( for
t being
Symbol of
G st
t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for
nt being
Symbol of
G for
ts being
FinSequence of
TS G for
rts being
FinSequence st
rts = roots ts &
nt ==> rts holds
for
x being
FinSequence of the
carrier of
G * st
x = f * ts holds
f . (nt -tree ts) = <*nt*> ^ (FlattenSeq x) ) );
existence
ex b1 being FinSequence of the carrier of G ex f being Function of TS G,the carrier of G * st
( b1 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G
for rts being FinSequence st rts = roots ts & nt ==> rts holds
for x being FinSequence of the carrier of G * st x = f * ts holds
f . (nt -tree ts) = <*nt*> ^ (FlattenSeq x) ) )
uniqueness
for b1, b2 being FinSequence of the carrier of G st ex f being Function of TS G,the carrier of G * st
( b1 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G
for rts being FinSequence st rts = roots ts & nt ==> rts holds
for x being FinSequence of the carrier of G * st x = f * ts holds
f . (nt -tree ts) = <*nt*> ^ (FlattenSeq x) ) ) & ex f being Function of TS G,the carrier of G * st
( b2 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G
for rts being FinSequence st rts = roots ts & nt ==> rts holds
for x being FinSequence of the carrier of G * st x = f * ts holds
f . (nt -tree ts) = <*nt*> ^ (FlattenSeq x) ) ) holds
b1 = b2
deffunc H12(
Symbol of
G)
-> Element of the
carrier of
G * =
s2s . $1;
deffunc H13(
Symbol of
G,
set ,
FinSequence of the
carrier of
G * )
-> Element of the
carrier of
G * =
(FlattenSeq $3) ^ (s2s . $1);
func PostTraversal tsg -> FinSequence of the
carrier of
G means :
Def17:
:: DTCONSTR:def 17
ex
f being
Function of
TS G,the
carrier of
G * st
(
it = f . tsg & ( for
t being
Symbol of
G st
t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for
nt being
Symbol of
G for
ts being
FinSequence of
TS G for
rts being
FinSequence st
rts = roots ts &
nt ==> rts holds
for
x being
FinSequence of the
carrier of
G * st
x = f * ts holds
f . (nt -tree ts) = (FlattenSeq x) ^ <*nt*> ) );
existence
ex b1 being FinSequence of the carrier of G ex f being Function of TS G,the carrier of G * st
( b1 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G
for rts being FinSequence st rts = roots ts & nt ==> rts holds
for x being FinSequence of the carrier of G * st x = f * ts holds
f . (nt -tree ts) = (FlattenSeq x) ^ <*nt*> ) )
uniqueness
for b1, b2 being FinSequence of the carrier of G st ex f being Function of TS G,the carrier of G * st
( b1 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G
for rts being FinSequence st rts = roots ts & nt ==> rts holds
for x being FinSequence of the carrier of G * st x = f * ts holds
f . (nt -tree ts) = (FlattenSeq x) ^ <*nt*> ) ) & ex f being Function of TS G,the carrier of G * st
( b2 = f . tsg & ( for t being Symbol of G st t in Terminals G holds
f . (root-tree t) = <*t*> ) & ( for nt being Symbol of G
for ts being FinSequence of TS G
for rts being FinSequence st rts = roots ts & nt ==> rts holds
for x being FinSequence of the carrier of G * st x = f * ts holds
f . (nt -tree ts) = (FlattenSeq x) ^ <*nt*> ) ) holds
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 defines TerminalLanguage DTCONSTR:def 18 :
:: deftheorem defines PreTraversalLanguage DTCONSTR:def 19 :
:: deftheorem defines PostTraversalLanguage DTCONSTR:def 20 :
theorem Th14: :: DTCONSTR:14 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: DTCONSTR:15 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th16: :: DTCONSTR:16 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: DTCONSTR:17 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th18: :: DTCONSTR:18 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: DTCONSTR:19 :: Showing IDV graph ... (Click the Palm Tree again to close it)