:: AMI_3 semantic presentation
definition
func SCM -> strict AMI-Struct of
{INT } equals :: AMI_3:def 1
AMI-Struct(#
NAT ,0,
SCM-Instr-Loc ,
(Segm 9),
SCM-Instr ,
SCM-OK ,
SCM-Exec #);
coherence
AMI-Struct(# NAT ,0,SCM-Instr-Loc ,(Segm 9),SCM-Instr ,SCM-OK ,SCM-Exec #) is strict AMI-Struct of {INT }
;
end;
:: deftheorem defines SCM AMI_3:def 1 :
theorem E1: :: AMI_3:1
theorem E2: :: AMI_3:2
:: deftheorem E3 defines Data-Location AMI_3:def 2 :
definition
let c
1, c
2 be
Data-Location ;
func c
1 := c
2 -> Instruction of
SCM equals :: AMI_3:def 3
[1,<*a1,a2*>];
correctness
coherence
[1,<*c1,c2*>] is Instruction of SCM ;
func AddTo c
1,c
2 -> Instruction of
SCM equals :: AMI_3:def 4
[2,<*a1,a2*>];
correctness
coherence
[2,<*c1,c2*>] is Instruction of SCM ;
func SubFrom c
1,c
2 -> Instruction of
SCM equals :: AMI_3:def 5
[3,<*a1,a2*>];
correctness
coherence
[3,<*c1,c2*>] is Instruction of SCM ;
func MultBy c
1,c
2 -> Instruction of
SCM equals :: AMI_3:def 6
[4,<*a1,a2*>];
correctness
coherence
[4,<*c1,c2*>] is Instruction of SCM ;
func Divide c
1,c
2 -> Instruction of
SCM equals :: AMI_3:def 7
[5,<*a1,a2*>];
correctness
coherence
[5,<*c1,c2*>] is Instruction of SCM ;
end;
:: deftheorem defines := AMI_3:def 3 :
:: deftheorem defines AddTo AMI_3:def 4 :
:: deftheorem defines SubFrom AMI_3:def 5 :
:: deftheorem defines MultBy AMI_3:def 6 :
:: deftheorem defines Divide AMI_3:def 7 :
definition
let c
1 be
Instruction-Location of
SCM ;
func goto c
1 -> Instruction of
SCM equals :: AMI_3:def 8
[6,<*a1*>];
correctness
coherence
[6,<*c1*>] is Instruction of SCM ;
by AMI_2:3;
let c
2 be
Data-Location ;
func c
2 =0_goto c
1 -> Instruction of
SCM equals :: AMI_3:def 9
[7,<*a1,a2*>];
correctness
coherence
[7,<*c1,c2*>] is Instruction of SCM ;
func c
2 >0_goto c
1 -> Instruction of
SCM equals :: AMI_3:def 10
[8,<*a1,a2*>];
correctness
coherence
[8,<*c1,c2*>] is Instruction of SCM ;
end;
:: deftheorem defines goto AMI_3:def 8 :
:: deftheorem defines =0_goto AMI_3:def 9 :
:: deftheorem defines >0_goto AMI_3:def 10 :
theorem :: AMI_3:3
canceled;
theorem :: AMI_3:4
theorem E4: :: AMI_3:5
:: deftheorem E5 defines Next AMI_3:def 11 :
theorem E6: :: AMI_3:6
theorem E7: :: AMI_3:7
theorem E8: :: AMI_3:8
proof
let c
1, c
2 be
Data-Location ;
let c
3 be
State of
SCM ;
reconsider c
4 = c
1, c
5 = c
2 as
Element of
SCM-Data-Loc by E3;
reconsider c
6 = c
1 := c
2 as
Element of
SCM-Instr ;
reconsider c
7 = c
3 as
SCM-State ;
set c
8 =
SCM-Chg c
7,
(c6 address_1 ),
(c7 . (c6 address_2 ));
reconsider c
9 = 1 as
Element of
Segm 9
by GR_CY_1:10;
E9:
c
6 = [c9,<*c4,c5*>]
;
E10:
IC c
3 = IC c
7
by E4;
E11:
Exec (c1 := c2),c
3 =
SCM-Exec-Res c
6,c
7
by E7
.=
SCM-Chg (SCM-Chg c7,(c6 address_1 ),(c7 . (c6 address_2 ))),
(Next (IC c7))
by E9, AMI_2:def 16
;
E12:
( c
6 address_1 = c
4 & c
6 address_2 = c
5 )
by E9, AMI_2:23;
thus (Exec (c1 := c2),c3) . (IC SCM ) =
Next (IC c7)
by E11, AMI_2:16
.=
Next (IC c3)
by E10, E6
;
thus (Exec (c1 := c2),c3) . c
1 =
(SCM-Chg c7,(c6 address_1 ),(c7 . (c6 address_2 ))) . c
4
by E11, AMI_2:17
.=
c
3 . c
2
by E12, AMI_2:20
;
let c
10 be
Data-Location ;
reconsider c
11 = c
10 as
Element of
SCM-Data-Loc by E3;
assume E13:
c
10 <> c
1
;
thus (Exec (c1 := c2),c3) . c
10 =
(SCM-Chg c7,(c6 address_1 ),(c7 . (c6 address_2 ))) . c
11
by E11, AMI_2:17
.=
c
3 . c
10
by E12, E13, AMI_2:21
;
end;
theorem E9: :: AMI_3:9
proof
let c
1, c
2 be
Data-Location ;
let c
3 be
State of
SCM ;
reconsider c
4 = c
1, c
5 = c
2 as
Element of
SCM-Data-Loc by E3;
reconsider c
6 =
AddTo c
1,c
2 as
Element of
SCM-Instr ;
reconsider c
7 = c
3 as
SCM-State ;
set c
8 =
SCM-Chg c
7,
(c6 address_1 ),
((c7 . (c6 address_1 )) + (c7 . (c6 address_2 )));
reconsider c
9 = 2 as
Element of
Segm 9
by GR_CY_1:10;
E10:
c
6 = [c9,<*c4,c5*>]
;
E11:
IC c
3 = IC c
7
by E4;
E12:
Exec (AddTo c1,c2),c
3 =
SCM-Exec-Res c
6,c
7
by E7
.=
SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) + (c7 . (c6 address_2 )))),
(Next (IC c7))
by E10, AMI_2:def 16
;
E13:
( c
6 address_1 = c
4 & c
6 address_2 = c
5 )
by E10, AMI_2:23;
thus (Exec (AddTo c1,c2),c3) . (IC SCM ) =
Next (IC c7)
by E12, AMI_2:16
.=
Next (IC c3)
by E11, E6
;
thus (Exec (AddTo c1,c2),c3) . c
1 =
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) + (c7 . (c6 address_2 )))) . c
4
by E12, AMI_2:17
.=
(c3 . c1) + (c3 . c2)
by E13, AMI_2:20
;
let c
10 be
Data-Location ;
reconsider c
11 = c
10 as
Element of
SCM-Data-Loc by E3;
assume E14:
c
10 <> c
1
;
thus (Exec (AddTo c1,c2),c3) . c
10 =
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) + (c7 . (c6 address_2 )))) . c
11
by E12, AMI_2:17
.=
c
3 . c
10
by E13, E14, AMI_2:21
;
end;
theorem E10: :: AMI_3:10
proof
let c
1, c
2 be
Data-Location ;
let c
3 be
State of
SCM ;
reconsider c
4 = c
1, c
5 = c
2 as
Element of
SCM-Data-Loc by E3;
reconsider c
6 =
SubFrom c
1,c
2 as
Element of
SCM-Instr ;
reconsider c
7 = c
3 as
SCM-State ;
set c
8 =
SCM-Chg c
7,
(c6 address_1 ),
((c7 . (c6 address_1 )) - (c7 . (c6 address_2 )));
reconsider c
9 = 3 as
Element of
Segm 9
by GR_CY_1:10;
E11:
c
6 = [c9,<*c4,c5*>]
;
E12:
IC c
3 = IC c
7
by E4;
E13:
Exec (SubFrom c1,c2),c
3 =
SCM-Exec-Res c
6,c
7
by E7
.=
SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) - (c7 . (c6 address_2 )))),
(Next (IC c7))
by E11, AMI_2:def 16
;
E14:
( c
6 address_1 = c
4 & c
6 address_2 = c
5 )
by E11, AMI_2:23;
thus (Exec (SubFrom c1,c2),c3) . (IC SCM ) =
Next (IC c7)
by E13, AMI_2:16
.=
Next (IC c3)
by E12, E6
;
thus (Exec (SubFrom c1,c2),c3) . c
1 =
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) - (c7 . (c6 address_2 )))) . c
4
by E13, AMI_2:17
.=
(c3 . c1) - (c3 . c2)
by E14, AMI_2:20
;
let c
10 be
Data-Location ;
reconsider c
11 = c
10 as
Element of
SCM-Data-Loc by E3;
assume E15:
c
10 <> c
1
;
thus (Exec (SubFrom c1,c2),c3) . c
10 =
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) - (c7 . (c6 address_2 )))) . c
11
by E13, AMI_2:17
.=
c
3 . c
10
by E14, E15, AMI_2:21
;
end;
theorem E11: :: AMI_3:11
proof
let c
1, c
2 be
Data-Location ;
let c
3 be
State of
SCM ;
reconsider c
4 = c
1, c
5 = c
2 as
Element of
SCM-Data-Loc by E3;
reconsider c
6 =
MultBy c
1,c
2 as
Element of
SCM-Instr ;
reconsider c
7 = c
3 as
SCM-State ;
set c
8 =
SCM-Chg c
7,
(c6 address_1 ),
((c7 . (c6 address_1 )) * (c7 . (c6 address_2 )));
reconsider c
9 = 4 as
Element of
Segm 9
by GR_CY_1:10;
E12:
c
6 = [c9,<*c4,c5*>]
;
E13:
IC c
3 = IC c
7
by E4;
E14:
Exec (MultBy c1,c2),c
3 =
SCM-Exec-Res c
6,c
7
by E7
.=
SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) * (c7 . (c6 address_2 )))),
(Next (IC c7))
by E12, AMI_2:def 16
;
E15:
( c
6 address_1 = c
4 & c
6 address_2 = c
5 )
by E12, AMI_2:23;
thus (Exec (MultBy c1,c2),c3) . (IC SCM ) =
Next (IC c7)
by E14, AMI_2:16
.=
Next (IC c3)
by E13, E6
;
thus (Exec (MultBy c1,c2),c3) . c
1 =
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) * (c7 . (c6 address_2 )))) . c
4
by E14, AMI_2:17
.=
(c3 . c1) * (c3 . c2)
by E15, AMI_2:20
;
let c
10 be
Data-Location ;
reconsider c
11 = c
10 as
Element of
SCM-Data-Loc by E3;
assume E16:
c
10 <> c
1
;
thus (Exec (MultBy c1,c2),c3) . c
10 =
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) * (c7 . (c6 address_2 )))) . c
11
by E14, AMI_2:17
.=
c
3 . c
10
by E15, E16, AMI_2:21
;
end;
theorem E12: :: AMI_3:12
proof
let c
1, c
2 be
Data-Location ;
let c
3 be
State of
SCM ;
reconsider c
4 = c
1, c
5 = c
2 as
Element of
SCM-Data-Loc by E3;
reconsider c
6 =
Divide c
1,c
2 as
Element of
SCM-Instr ;
reconsider c
7 = c
3 as
SCM-State ;
set c
8 =
SCM-Chg c
7,
(c6 address_1 ),
((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )));
set c
9 =
SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )))),
(c6 address_2 ),
((c7 . (c6 address_1 )) mod (c7 . (c6 address_2 )));
reconsider c
10 = 5 as
Element of
Segm 9
by GR_CY_1:10;
E13:
c
6 = [c10,<*c4,c5*>]
;
E14:
IC c
3 = IC c
7
by E4;
E15:
Exec (Divide c1,c2),c
3 =
SCM-Exec-Res c
6,c
7
by E7
.=
SCM-Chg (SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )))),(c6 address_2 ),((c7 . (c6 address_1 )) mod (c7 . (c6 address_2 )))),
(Next (IC c7))
by E13, AMI_2:def 16
;
E16:
( c
6 address_1 = c
4 & c
6 address_2 = c
5 )
by E13, AMI_2:23;
thus (Exec (Divide c1,c2),c3) . (IC SCM ) =
Next (IC c7)
by E15, AMI_2:16
.=
Next (IC c3)
by E14, E6
;
hereby
assume E17:
c
1 <> c
2
;
thus (Exec (Divide c1,c2),c3) . c
1 =
(SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )))),(c6 address_2 ),((c7 . (c6 address_1 )) mod (c7 . (c6 address_2 )))) . c
4
by E15, AMI_2:17
.=
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )))) . c
4
by E16, E17, AMI_2:21
.=
(c3 . c1) div (c3 . c2)
by E16, AMI_2:20
;
end;
thus (Exec (Divide c1,c2),c3) . c
2 =
(SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )))),(c6 address_2 ),((c7 . (c6 address_1 )) mod (c7 . (c6 address_2 )))) . c
5
by E15, AMI_2:17
.=
(c3 . c1) mod (c3 . c2)
by E16, AMI_2:20
;
let c
11 be
Data-Location ;
reconsider c
12 = c
11 as
Element of
SCM-Data-Loc by E3;
assume E17:
( c
11 <> c
1 & c
11 <> c
2 )
;
thus (Exec (Divide c1,c2),c3) . c
11 =
(SCM-Chg (SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )))),(c6 address_2 ),((c7 . (c6 address_1 )) mod (c7 . (c6 address_2 )))) . c
12
by E15, AMI_2:17
.=
(SCM-Chg c7,(c6 address_1 ),((c7 . (c6 address_1 )) div (c7 . (c6 address_2 )))) . c
12
by E16, E17, AMI_2:21
.=
c
3 . c
11
by E16, E17, AMI_2:21
;
end;
theorem :: AMI_3:13
theorem E13: :: AMI_3:14
proof
let c
1, c
2 be
Data-Location ;
let c
3 be
Instruction-Location of
SCM ;
let c
4 be
State of
SCM ;
reconsider c
5 = c
3 as
Element of
SCM-Instr-Loc ;
reconsider c
6 = c
1 as
Element of
SCM-Data-Loc by E3;
reconsider c
7 = c
1 =0_goto c
3 as
Element of
SCM-Instr ;
reconsider c
8 = c
4 as
SCM-State ;
reconsider c
9 = 7 as
Element of
Segm 9
by GR_CY_1:10;
E14:
c
7 = [c9,<*c5,c6*>]
;
E15:
IC c
4 = IC c
8
by E4;
E16:
Exec (c1 =0_goto c3),c
4 =
SCM-Exec-Res c
7,c
8
by E7
.=
SCM-Chg c
8,
(IFEQ (c8 . (c7 cond_address )),0,(c7 cjump_address ),(Next (IC c8)))
by E14, AMI_2:def 16
;
thus
( c
4 . c
1 = 0 implies
(Exec (c1 =0_goto c3),c4) . (IC SCM ) = c
3 )
thus
( c
4 . c
1 <> 0 implies
(Exec (c1 =0_goto c3),c4) . (IC SCM ) = Next (IC c4) )
reconsider c
10 = c
2 as
Element of
SCM-Data-Loc by E3;
thus (Exec (c1 =0_goto c3),c4) . c
2 =
c
8 . c
10
by E16, AMI_2:17
.=
c
4 . c
2
;
end;
theorem E14: :: AMI_3:15
proof
let c
1, c
2 be
Data-Location ;
let c
3 be
Instruction-Location of
SCM ;
let c
4 be
State of
SCM ;
reconsider c
5 = c
3 as
Element of
SCM-Instr-Loc ;
reconsider c
6 = c
1 as
Element of
SCM-Data-Loc by E3;
reconsider c
7 = c
1 >0_goto c
3 as
Element of
SCM-Instr ;
reconsider c
8 = c
4 as
SCM-State ;
reconsider c
9 = 8 as
Element of
Segm 9
by GR_CY_1:10;
E15:
c
7 = [c9,<*c5,c6*>]
;
E16:
IC c
4 = IC c
8
by E4;
E17:
Exec (c1 >0_goto c3),c
4 =
SCM-Exec-Res c
7,c
8
by E7
.=
SCM-Chg c
8,
(IFGT (c8 . (c7 cond_address )),0,(c7 cjump_address ),(Next (IC c8)))
by E15, AMI_2:def 16
;
thus
( c
4 . c
1 > 0 implies
(Exec (c1 >0_goto c3),c4) . (IC SCM ) = c
3 )
thus
( c
4 . c
1 <= 0 implies
(Exec (c1 >0_goto c3),c4) . (IC SCM ) = Next (IC c4) )
reconsider c
10 = c
2 as
Element of
SCM-Data-Loc by E3;
thus (Exec (c1 >0_goto c3),c4) . c
2 =
c
8 . c
10
by E17, AMI_2:17
.=
c
4 . c
2
;
end;
E15:
for b1 being Instruction of SCM holds
not ( ex b2 being State of SCM st (Exec b1,b2) . (IC SCM ) = Next (IC b2) & b1 is halting )