:: by Noriko Asamoto , Yatsuka Nakamura , Piotr Rudnicki and Andrzej Trybulec

::

:: Received July 22, 1996

:: Copyright (c) 1996-2018 Association of Mizar Users

set SA0 = Start-At (0,SCM+FSA);

theorem :: SCMFSA6C:1

for a being Int-Location

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for J being really-closed parahalting Program of SCM+FSA holds (IExec ((I ";" J),P,s)) . a = (IExec (J,P,(IExec (I,P,s)))) . a

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for J being really-closed parahalting Program of SCM+FSA holds (IExec ((I ";" J),P,s)) . a = (IExec (J,P,(IExec (I,P,s)))) . a

proof end;

theorem :: SCMFSA6C:2

for f being FinSeq-Location

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for J being really-closed parahalting Program of SCM+FSA holds (IExec ((I ";" J),P,s)) . f = (IExec (J,P,(IExec (I,P,s)))) . f

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for J being really-closed parahalting Program of SCM+FSA holds (IExec ((I ";" J),P,s)) . f = (IExec (J,P,(IExec (I,P,s)))) . f

proof end;

canceled;

::$CD

definition
end;

:: deftheorem Def1 defines keeping_0 SCMFSA6C:def 1 :

for i being Instruction of SCM+FSA holds

( i is keeping_0 iff Macro i is keeping_0 );

for i being Instruction of SCM+FSA holds

( i is keeping_0 iff Macro i is keeping_0 );

Lm1: Macro (halt SCM+FSA) is keeping_0

proof end;

registration
end;

registration
end;

registration
end;

registration

let a be read-write Int-Location;

let b be Int-Location;

coherence

a := b is keeping_0

AddTo (a,b) is keeping_0

SubFrom (a,b) is keeping_0

MultBy (a,b) is keeping_0

end;
let b be Int-Location;

coherence

a := b is keeping_0

proof end;

coherence AddTo (a,b) is keeping_0

proof end;

coherence SubFrom (a,b) is keeping_0

proof end;

coherence MultBy (a,b) is keeping_0

proof end;

registration

ex b_{1} being Instruction of SCM+FSA st

( b_{1} is keeping_0 & b_{1} is sequential )
end;

cluster sequential V155( Segm 3, SCM+FSA ) V157( Segm 3, SCM+FSA ) keeping_0 for Instruction of SCM+FSA;

existence ex b

( b

proof end;

registration
end;

registration
end;

registration

let a be Int-Location;

let f be FinSeq-Location ;

let b be read-write Int-Location;

coherence

b := (f,a) is keeping_0

end;
let f be FinSeq-Location ;

let b be read-write Int-Location;

coherence

b := (f,a) is keeping_0

proof end;

registration

let f be FinSeq-Location ;

let b be read-write Int-Location;

coherence

b :=len f is keeping_0

end;
let b be read-write Int-Location;

coherence

b :=len f is keeping_0

proof end;

registration
end;

:: registration

:: let i be keeping_0 Instruction of SCM+FSA;

:: cluster Macro i -> really-closed;

:: coherence;

:: end;

:: let i be keeping_0 Instruction of SCM+FSA;

:: cluster Macro i -> really-closed;

:: coherence;

:: end;

registration

let i be sequential Instruction of SCM+FSA;

let J be really-closed parahalting Program of SCM+FSA;

coherence

( i ";" J is parahalting & i ";" J is really-closed ) ;

end;
let J be really-closed parahalting Program of SCM+FSA;

coherence

( i ";" J is parahalting & i ";" J is really-closed ) ;

registration

let I be really-closed parahalting Program of SCM+FSA;

let j be sequential Instruction of SCM+FSA;

coherence

( I ";" j is parahalting & I ";" j is really-closed ) ;

end;
let j be sequential Instruction of SCM+FSA;

coherence

( I ";" j is parahalting & I ";" j is really-closed ) ;

registration

let i, j be sequential Instruction of SCM+FSA;

coherence

( i ";" j is parahalting & i ";" j is really-closed ) ;

end;
coherence

( i ";" j is parahalting & i ";" j is really-closed ) ;

registration

let i be sequential keeping_0 Instruction of SCM+FSA;

let J be keeping_0 really-closed Program of SCM+FSA;

coherence

i ";" J is keeping_0 ;

end;
let J be keeping_0 really-closed Program of SCM+FSA;

coherence

i ";" J is keeping_0 ;

registration

let I be keeping_0 really-closed Program of SCM+FSA;

let j be sequential keeping_0 Instruction of SCM+FSA;

coherence

I ";" j is keeping_0 ;

end;
let j be sequential keeping_0 Instruction of SCM+FSA;

coherence

I ";" j is keeping_0 ;

registration
end;

::$CT

theorem Th3: :: SCMFSA6C:4

for i being Instruction of SCM+FSA

for s1, s2 being State of SCM+FSA st DataPart s1 = DataPart s2 holds

DataPart (Exec (i,s1)) = DataPart (Exec (i,s2))

for s1, s2 being State of SCM+FSA st DataPart s1 = DataPart s2 holds

DataPart (Exec (i,s1)) = DataPart (Exec (i,s2))

proof end;

Lm2: now :: thesis: for I being keeping_0 parahalting Program of SCM+FSA

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA holds DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA holds DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

set IF = Data-Locations ;

let I be keeping_0 parahalting Program of SCM+FSA; :: thesis: for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA holds DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

let s be State of SCM+FSA; :: thesis: for P being Instruction-Sequence of SCM+FSA holds DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

let P be Instruction-Sequence of SCM+FSA; :: thesis: DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

set IE = IExec (I,P,s);

end;
let I be keeping_0 parahalting Program of SCM+FSA; :: thesis: for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA holds DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

let s be State of SCM+FSA; :: thesis: for P being Instruction-Sequence of SCM+FSA holds DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

let P be Instruction-Sequence of SCM+FSA; :: thesis: DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))

set IE = IExec (I,P,s);

now :: thesis: ( dom (DataPart (Initialized (IExec (I,P,s)))) = (dom (IExec (I,P,s))) /\ (Data-Locations ) & ( for x being object st x in dom (DataPart (Initialized (IExec (I,P,s)))) holds

(DataPart (Initialized (IExec (I,P,s)))) . x = (IExec (I,P,s)) . x ) )

hence
DataPart (Initialized (IExec (I,P,s))) = DataPart (IExec (I,P,s))
by FUNCT_1:46; :: thesis: verum(DataPart (Initialized (IExec (I,P,s)))) . x = (IExec (I,P,s)) . x ) )

A1:
dom (Initialized (IExec (I,P,s))) = the carrier of SCM+FSA
by PARTFUN1:def 2;

A2: the carrier of SCM+FSA = {(IC )} \/ (Data-Locations ) by STRUCT_0:4;

A3: dom (IExec (I,P,s)) = the carrier of SCM+FSA by PARTFUN1:def 2;

hence dom (DataPart (Initialized (IExec (I,P,s)))) = (dom (IExec (I,P,s))) /\ (Data-Locations ) by A1, RELAT_1:61; :: thesis: for x being object st x in dom (DataPart (Initialized (IExec (I,P,s)))) holds

(DataPart (Initialized (IExec (I,P,s)))) . b_{2} = (IExec (I,P,s)) . b_{2}

then A4: dom (DataPart (Initialized (IExec (I,P,s)))) = Data-Locations by A3, A2, XBOOLE_1:21;

let x be object ; :: thesis: ( x in dom (DataPart (Initialized (IExec (I,P,s)))) implies (DataPart (Initialized (IExec (I,P,s)))) . b_{1} = (IExec (I,P,s)) . b_{1} )

assume A5: x in dom (DataPart (Initialized (IExec (I,P,s)))) ; :: thesis: (DataPart (Initialized (IExec (I,P,s)))) . b_{1} = (IExec (I,P,s)) . b_{1}

end;
A2: the carrier of SCM+FSA = {(IC )} \/ (Data-Locations ) by STRUCT_0:4;

A3: dom (IExec (I,P,s)) = the carrier of SCM+FSA by PARTFUN1:def 2;

hence dom (DataPart (Initialized (IExec (I,P,s)))) = (dom (IExec (I,P,s))) /\ (Data-Locations ) by A1, RELAT_1:61; :: thesis: for x being object st x in dom (DataPart (Initialized (IExec (I,P,s)))) holds

(DataPart (Initialized (IExec (I,P,s)))) . b

then A4: dom (DataPart (Initialized (IExec (I,P,s)))) = Data-Locations by A3, A2, XBOOLE_1:21;

let x be object ; :: thesis: ( x in dom (DataPart (Initialized (IExec (I,P,s)))) implies (DataPart (Initialized (IExec (I,P,s)))) . b

assume A5: x in dom (DataPart (Initialized (IExec (I,P,s)))) ; :: thesis: (DataPart (Initialized (IExec (I,P,s)))) . b

per cases
( x in Int-Locations or x in FinSeq-Locations )
by A5, A4, SCMFSA_2:100, XBOOLE_0:def 3;

end;

suppose
x in Int-Locations
; :: thesis: (DataPart (Initialized (IExec (I,P,s)))) . b_{1} = (IExec (I,P,s)) . b_{1}

then reconsider x9 = x as Int-Location by AMI_2:def 16;

end;
per cases
( x9 is read-write or x9 is read-only )
;

end;

suppose A6:
x9 is read-write
; :: thesis: (DataPart (Initialized (IExec (I,P,s)))) . b_{1} = (IExec (I,P,s)) . b_{1}

thus (DataPart (Initialized (IExec (I,P,s)))) . x =
(Initialized (IExec (I,P,s))) . x
by A5, A4, FUNCT_1:49

.= (IExec (I,P,s)) . x by A6, SCMFSA_M:37 ; :: thesis: verum

end;
.= (IExec (I,P,s)) . x by A6, SCMFSA_M:37 ; :: thesis: verum

suppose
x9 is read-only
; :: thesis: (DataPart (Initialized (IExec (I,P,s)))) . b_{1} = (IExec (I,P,s)) . b_{1}

then A7:
x9 = intloc 0
;

thus (DataPart (Initialized (IExec (I,P,s)))) . x = (Initialized (IExec (I,P,s))) . x9 by A5, A4, FUNCT_1:49

.= 1 by A7, SCMFSA_M:9

.= (IExec (I,P,s)) . x by A7, SCMFSA6B:11 ; :: thesis: verum

end;
thus (DataPart (Initialized (IExec (I,P,s)))) . x = (Initialized (IExec (I,P,s))) . x9 by A5, A4, FUNCT_1:49

.= 1 by A7, SCMFSA_M:9

.= (IExec (I,P,s)) . x by A7, SCMFSA6B:11 ; :: thesis: verum

suppose
x in FinSeq-Locations
; :: thesis: (DataPart (Initialized (IExec (I,P,s)))) . b_{1} = (IExec (I,P,s)) . b_{1}

then reconsider x9 = x as FinSeq-Location by SCMFSA_2:def 5;

thus (DataPart (Initialized (IExec (I,P,s)))) . x = (Initialized (IExec (I,P,s))) . x9 by A5, A4, FUNCT_1:49

.= (IExec (I,P,s)) . x by SCMFSA_M:37 ; :: thesis: verum

end;
thus (DataPart (Initialized (IExec (I,P,s)))) . x = (Initialized (IExec (I,P,s))) . x9 by A5, A4, FUNCT_1:49

.= (IExec (I,P,s)) . x by SCMFSA_M:37 ; :: thesis: verum

theorem Th4: :: SCMFSA6C:5

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for i being sequential Instruction of SCM+FSA holds Exec (i,(Initialized s)) = IExec ((Macro i),P,s)

for P being Instruction-Sequence of SCM+FSA

for i being sequential Instruction of SCM+FSA holds Exec (i,(Initialized s)) = IExec ((Macro i),P,s)

proof end;

theorem Th5: :: SCMFSA6C:6

for a being Int-Location

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((I ";" j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((I ";" j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a

proof end;

theorem Th6: :: SCMFSA6C:7

for f being FinSeq-Location

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((I ";" j),P,s)) . f = (Exec (j,(IExec (I,P,s)))) . f

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for I being keeping_0 really-closed parahalting Program of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((I ";" j),P,s)) . f = (Exec (j,(IExec (I,P,s)))) . f

proof end;

theorem Th7: :: SCMFSA6C:8

for a being Int-Location

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for i being sequential keeping_0 Instruction of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((i ";" j),P,s)) . a = (Exec (j,(Exec (i,(Initialized s))))) . a

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for i being sequential keeping_0 Instruction of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((i ";" j),P,s)) . a = (Exec (j,(Exec (i,(Initialized s))))) . a

proof end;

theorem :: SCMFSA6C:9

for f being FinSeq-Location

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for i being sequential keeping_0 Instruction of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((i ";" j),P,s)) . f = (Exec (j,(Exec (i,(Initialized s))))) . f

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for i being sequential keeping_0 Instruction of SCM+FSA

for j being sequential Instruction of SCM+FSA holds (IExec ((i ";" j),P,s)) . f = (Exec (j,(Exec (i,(Initialized s))))) . f

proof end;

definition

let a, b be Int-Location;

coherence

(((FirstNotUsed (Macro (a := b))) := a) ";" (a := b)) ";" (b := (FirstNotUsed (Macro (a := b)))) is Program of SCM+FSA;

;

end;
func swap (a,b) -> Program of SCM+FSA equals :: SCMFSA6C:def 2

(((FirstNotUsed (Macro (a := b))) := a) ";" (a := b)) ";" (b := (FirstNotUsed (Macro (a := b))));

correctness (((FirstNotUsed (Macro (a := b))) := a) ";" (a := b)) ";" (b := (FirstNotUsed (Macro (a := b))));

coherence

(((FirstNotUsed (Macro (a := b))) := a) ";" (a := b)) ";" (b := (FirstNotUsed (Macro (a := b)))) is Program of SCM+FSA;

;

:: deftheorem defines swap SCMFSA6C:def 2 :

for a, b being Int-Location holds swap (a,b) = (((FirstNotUsed (Macro (a := b))) := a) ";" (a := b)) ";" (b := (FirstNotUsed (Macro (a := b))));

for a, b being Int-Location holds swap (a,b) = (((FirstNotUsed (Macro (a := b))) := a) ";" (a := b)) ";" (b := (FirstNotUsed (Macro (a := b))));

registration
end;

theorem :: SCMFSA6C:10

for s being State of SCM+FSA

for P being Instruction-Sequence of SCM+FSA

for a, b being read-write Int-Location holds

( (IExec ((swap (a,b)),P,s)) . a = s . b & (IExec ((swap (a,b)),P,s)) . b = s . a )

for P being Instruction-Sequence of SCM+FSA

for a, b being read-write Int-Location holds

( (IExec ((swap (a,b)),P,s)) . a = s . b & (IExec ((swap (a,b)),P,s)) . b = s . a )

proof end;

registration
end;

registration

let I be really-closed MacroInstruction of SCM+FSA ;

let j be sequential Instruction of SCM+FSA;

coherence

I ';' j is really-closed ;

end;
let j be sequential Instruction of SCM+FSA;

coherence

I ';' j is really-closed ;

registration

let i be sequential Instruction of SCM+FSA;

let J be really-closed MacroInstruction of SCM+FSA ;

coherence

i ';' J is really-closed ;

end;
let J be really-closed MacroInstruction of SCM+FSA ;

coherence

i ';' J is really-closed ;