:: FIB_FUSC semantic presentation  Show TPTP formulae Show IDV graph for whole article:: Showing IDV graph ... (Click the Palm Trees again to close it)

Lm1: 6 + 1 = (6 * ([\(log 2,1)/] + 1)) + 1
proof end;

Lm2: for nn' being Nat st nn' > 0 holds
( [\(log 2,nn')/] is Nat & (6 * ([\(log 2,nn')/] + 1)) + 1 > 0 )
proof end;

Lm3: for nn, nn' being Nat st nn = (2 * nn') + 1 & nn' > 0 holds
6 + ((6 * ([\(log 2,nn')/] + 1)) + 1) = (6 * ([\(log 2,nn)/] + 1)) + 1
proof end;

Lm4: for n being Nat st n > 0 holds
( log 2,(2 * n) = 1 + (log 2,n) & log 2,(2 * n) = (log 2,n) + 1 )
proof end;

Lm5: for nn, nn' being Nat st nn = 2 * nn' & nn' > 0 holds
6 + ((6 * ([\(log 2,nn')/] + 1)) + 1) = (6 * ([\(log 2,nn)/] + 1)) + 1
proof end;

Lm6: for N being Nat st N <> 0 holds
(6 * N) - 4 > 0
proof end;

Lm7: ( dl. 0 <> dl. 1 & dl. 0 <> dl. 2 & dl. 0 <> dl. 3 & dl. 1 <> dl. 2 & dl. 1 <> dl. 3 & dl. 2 <> dl. 3 )
by AMI_3:52;

Lm8: ( dl. 0 <> dl. 4 & dl. 1 <> dl. 4 & dl. 2 <> dl. 4 & dl. 3 <> dl. 4 )
by AMI_3:52;

definition
func Fib_Program -> FinSequence of the Instructions of SCM equals :: FIB_FUSC:def 1
(((((((<*((dl. 1) >0_goto (il. 2))*> ^ <*(halt SCM )*>) ^ <*((dl. 3) := (dl. 0))*>) ^ <*(SubFrom (dl. 1),(dl. 0))*>) ^ <*((dl. 1) =0_goto (il. 1))*>) ^ <*((dl. 4) := (dl. 2))*>) ^ <*((dl. 2) := (dl. 3))*>) ^ <*(AddTo (dl. 3),(dl. 4))*>) ^ <*(goto (il. 3))*>;
coherence
(((((((<*((dl. 1) >0_goto (il. 2))*> ^ <*(halt SCM )*>) ^ <*((dl. 3) := (dl. 0))*>) ^ <*(SubFrom (dl. 1),(dl. 0))*>) ^ <*((dl. 1) =0_goto (il. 1))*>) ^ <*((dl. 4) := (dl. 2))*>) ^ <*((dl. 2) := (dl. 3))*>) ^ <*(AddTo (dl. 3),(dl. 4))*>) ^ <*(goto (il. 3))*> is FinSequence of the Instructions of SCM
;
end;

:: deftheorem defines Fib_Program FIB_FUSC:def 1 :
Fib_Program = (((((((<*((dl. 1) >0_goto (il. 2))*> ^ <*(halt SCM )*>) ^ <*((dl. 3) := (dl. 0))*>) ^ <*(SubFrom (dl. 1),(dl. 0))*>) ^ <*((dl. 1) =0_goto (il. 1))*>) ^ <*((dl. 4) := (dl. 2))*>) ^ <*((dl. 2) := (dl. 3))*>) ^ <*(AddTo (dl. 3),(dl. 4))*>) ^ <*(goto (il. 3))*>;

theorem :: FIB_FUSC:1  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for N being Nat
for s being State-consisting of 0,0,0, Fib_Program ,((<*1*> ^ <*N*>) ^ <*0*>) ^ <*0*> holds
( s is halting & ( N = 0 implies Complexity s = 1 ) & ( N > 0 implies Complexity s = (6 * N) - 2 ) & (Result s) . (dl. 3) = Fib N )
proof end;

definition
let i be Integer;
func Fusc' i -> Nat means :Def2: :: FIB_FUSC:def 2
( ex n being Nat st
( i = n & it = Fusc n ) or ( i is not Nat & it = 0 ) );
existence
ex b1 being Nat st
( ex n being Nat st
( i = n & b1 = Fusc n ) or ( i is not Nat & b1 = 0 ) )
proof end;
uniqueness
for b1, b2 being Nat st ( ex n being Nat st
( i = n & b1 = Fusc n ) or ( i is not Nat & b1 = 0 ) ) & ( ex n being Nat st
( i = n & b2 = Fusc n ) or ( i is not Nat & b2 = 0 ) ) holds
b1 = b2
;
end;

:: deftheorem Def2 defines Fusc' FIB_FUSC:def 2 :
for i being Integer
for b2 being Nat holds
( b2 = Fusc' i iff ( ex n being Nat st
( i = n & b2 = Fusc n ) or ( i is not Nat & b2 = 0 ) ) );

definition
func Fusc_Program -> FinSequence of the Instructions of SCM equals :: FIB_FUSC:def 3
(((((((<*((dl. 1) =0_goto (il. 8))*> ^ <*((dl. 4) := (dl. 0))*>) ^ <*(Divide (dl. 1),(dl. 4))*>) ^ <*((dl. 4) =0_goto (il. 6))*>) ^ <*(AddTo (dl. 3),(dl. 2))*>) ^ <*(goto (il. 0))*>) ^ <*(AddTo (dl. 2),(dl. 3))*>) ^ <*(goto (il. 0))*>) ^ <*(halt SCM )*>;
coherence
(((((((<*((dl. 1) =0_goto (il. 8))*> ^ <*((dl. 4) := (dl. 0))*>) ^ <*(Divide (dl. 1),(dl. 4))*>) ^ <*((dl. 4) =0_goto (il. 6))*>) ^ <*(AddTo (dl. 3),(dl. 2))*>) ^ <*(goto (il. 0))*>) ^ <*(AddTo (dl. 2),(dl. 3))*>) ^ <*(goto (il. 0))*>) ^ <*(halt SCM )*> is FinSequence of the Instructions of SCM
;
end;

:: deftheorem defines Fusc_Program FIB_FUSC:def 3 :
Fusc_Program = (((((((<*((dl. 1) =0_goto (il. 8))*> ^ <*((dl. 4) := (dl. 0))*>) ^ <*(Divide (dl. 1),(dl. 4))*>) ^ <*((dl. 4) =0_goto (il. 6))*>) ^ <*(AddTo (dl. 3),(dl. 2))*>) ^ <*(goto (il. 0))*>) ^ <*(AddTo (dl. 2),(dl. 3))*>) ^ <*(goto (il. 0))*>) ^ <*(halt SCM )*>;

theorem :: FIB_FUSC:2  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for N being Nat st N > 0 holds
for s being State-consisting of 0,0,0, Fusc_Program ,((<*2*> ^ <*N*>) ^ <*1*>) ^ <*0*> holds
( s is halting & (Result s) . (dl. 3) = Fusc N & Complexity s = (6 * ([\(log 2,N)/] + 1)) + 1 )
proof end;

theorem :: FIB_FUSC:3  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for N, k, Fk, Fk1 being Nat
for s being State-consisting of 3,0,0, Fib_Program ,((<*1*> ^ <*N*>) ^ <*Fk*>) ^ <*Fk1*> st N > 0 & Fk = Fib k & Fk1 = Fib (k + 1) holds
( s is halting & Complexity s = (6 * N) - 4 & ex m being Nat st
( m = (k + N) - 1 & (Result s) . (dl. 2) = Fib m & (Result s) . (dl. 3) = Fib (m + 1) ) )
proof end;

theorem :: FIB_FUSC:4  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
canceled;

theorem Th5: :: FIB_FUSC:5  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for n, N, A, B being Nat
for s being State-consisting of 0,0,0, Fusc_Program ,((<*2*> ^ <*n*>) ^ <*A*>) ^ <*B*> st N > 0 & Fusc N = (A * (Fusc n)) + (B * (Fusc (n + 1))) holds
( s is halting & (Result s) . (dl. 3) = Fusc N & ( n = 0 implies Complexity s = 1 ) & ( n > 0 implies Complexity s = (6 * ([\(log 2,n)/] + 1)) + 1 ) )
proof end;

theorem :: FIB_FUSC:6  Show TPTP formulae Show IDV graph:: Showing IDV graph ... (Click the Palm Tree again to close it) Show TPTP problem
for N being Nat st N > 0 holds
for s being State-consisting of 0,0,0, Fusc_Program ,((<*2*> ^ <*N*>) ^ <*1*>) ^ <*0*> holds
( s is halting & (Result s) . (dl. 3) = Fusc N & ( N = 0 implies Complexity s = 1 ) & ( N > 0 implies Complexity s = (6 * ([\(log 2,N)/] + 1)) + 1 ) )
proof end;