ä½�ä¸�_2 - ZÈÜÞ·ª] . F -i {= 1L L △LogsysL...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ZÈÜÞ·ª] . F -i {= 1L L △LogsysL Lª ·2L È ]ÞÜ i_ à p L = · Þ iÜ=à q3˜ª] _L øa w· Þ a øi Y]ªL 4= ;á w· Þ a øi Y]ªL 5= ;á w· Þ a øi Y]ª;á 6= ]ª · Þ Ü È Record time: Time //L uml: UML //È ]ª · Þ Ü ID * ª · Þ //Ü È id: Seq Char //L PWD // e pwd: Seq Char // L #pwd>6 ∧ #pwd<16 [Record, ID, PWD] State::= ‘Online’| ‘Offline’ //L L L L L DB users: P ID password: ID ↔ PWD state: ID ↔ State record: ID ↔ Record dom password ⊆ users dom state ⊆ users dom record ⊆ users MEMBER client, admin: P ID /ªÞ /È·] Ü admin∩client = Φ Logsys sum: N //L online_sum: Nª ·/Þ/Ü Ø ] MEMBER DB dom state ⊆ client // dom record ⊆ client // Init_Logsys * ª /·/Þ ØÜ Logsys' sum' = 0 online_sum' = 0 client' = Φ admin' = Φ * ª · //Þ ÈÜ ) LogsysL Init Logsys; Logsys, È ª·ÞÜ ) Ï Ö ÿ` users' = Φ password' = Φ state' = Φ record' = Φ △Logsys Logsys' Logsys Ξ Logsys △Logsys sum' = sum online_sum' = online_sum client' = client admin' = admin users' = users password' = password state' = state record' = record Admin_loginª · ð // ˆ * ‘ △Logsys id? : ID pwd? : PWD id? ↔ pwd? ∈ password id? ∈ admin sum' = sum online_sum' = online_sum client' =client admin' = admin users' = users password' = password state' = state record' = record Admin_delete // ( Admin_login id? : ID id? ∈ client sum' = sum-1 online_sum' = online_sum-1 where state(id?)= ‘Online’ client' = client \{id?} admin' = admin users' = users\{id?} password' ={id?} password state' ={id?} state record' ={id?} record Admin_register Admin_login id? : ID pwd? : PWD // Ç• id? ∉ client pwd? ≠ id?]ª //ð b ·’ ID sum' = sum+1 online_sum' = online_sum client' = client ∪{id?} admin' = admin users' = users∪{id?} password' = password∪{id? ↔ pwd?} state' = state record' = record Client_login * ª · Þ // ˜ ß △Logsys id? : ID pwd? : PWD time?: Time uml?: UML id? ↔ pwd? ∈ password id? ∈ client sum' = sum online_sum' = online_sum+1 client' = client admin' = admin users' = users password' = password state' =state ⊕ {id? ↔ ‘Online’} record' =record∪{id? ↔ (time?,uml?)} · // ˜ ]ª Þ ß Client_change Client_login id? : ID pwd? : PWD pwd*? :PWD time?: Time uml?: UML id? ∈ client id? ↔ pwd? ∈ password id? ≠ pwd*? sum' = sum online_sum' = online_sum client' =client admin' = admin users' = users * ª · Þ // ˜ ß password' = password ⊕ {id? ↔ pwd*?} state' = state record' =record∪{id? ↔ (time?,uml?)} ]//ð b ª· ’ Client_logout Client_login id? : ID time?: Time * ª · ð // H ’ state' = state ⊕ {id? ↔ ‘Offline’} record' ={id?} recordª · //Ý ¸ ]Þ Admin_check * ª · uÞÞø W à // ˜ Þ _ +• q Admin_login id? : ID state!: State record!: P Record id? ∈ client state(id) = ‘Online’ state! = state(id?) record! = {id?} record sum' = sum online_sum' = online_sum client' = client admin' = admin users' = users password' = password state' = state record' = record uml?: UML id? ∈ client sum' = sum online_sum' = online_sum-1 client' =client admin' = admin users' = users password' = password L 1. L MooreL M· ealy¸ ]ª Þ Ý ] ª · L Ý1¸ Þ 0,1,2@ = iF { ] ª · L 2¸ ÞÝ 0L 1 / L MealyL L ]ª · Þ ¸ Ý Σ={0,1,2}L ] ª · L 5¸ ÞÝ j 5L L Mª oore) ]·ÞÜ / δ ñÉ è 0,1,2,3,4, ¸ ¸¸¸¸¸¸ ª 111¸ ·ÞÝ ª · Þ A¸ Ý ª · Þ 5¸ Ý ] ª 100¸ ·ÞÝ MooreL ] ª · Þ B¸ Ý CL △ ={0,1,2,3,4}L M=({ 5L q0 , q1 , q 2 , q3 , q 4 j q0 , q1 , q 2 , q3 , q 4 },{0,1,2},{0,1,2,3,4},δ,λ, q0 ) λ( qj )=j, j=0,1,2,3,4. ð·ª] ) • ]ª · ð • ) Σ={0,1 }L Q={(000),(001),(010),(011),(100),(101),(110),(111)}.L q0 , q1 , q 2 , q3 , q 4 , q5 , q 6],ª qð7 8• · 8888888 L L △ ={A,B,C}L Mª ealy) ]·ð• M=({ 0 , q1 , q 2 , M· ealyx ]ª ð • q q3 , q 4 , q5 , q 6 , q 7 },{0,1},{ A,B,C},δ,λ, q0 ) 1. L FSML TCP) ð • ·ª] WebÀ Web [˜ ...
View Full Document

Ask a homework question - tutors are online