SlideShare une entreprise Scribd logo
1  sur  122
Télécharger pour lire hors ligne
• alloy
•
    – Push
    –
    –
•            alloy
•
•
alloy
大事な3つ

• アトムと関係
• 演算
• 制約
アトム
• これ以上分けられない
• 変化することがない
• それ自体意味をもたない

• 「要素」である
アトムの例
• 「本」
• 「ユーザ」
• 「名前」
• 「時刻」
• 「状態名」
例えば

           sig User {}


と書くと、Userというアトムの集合
があるということを宣言している。
馴染みの言語で言えば、

           class User

と意味は似ているかもしれない
sig User {}


において、
Userというのはアトムの集合を表す。

User = {U0, U1, ...}

という感じで、要素としてアトムを持つ。

class User
が無数のインスタンスを持つようなもの
関係
                          関係「profile」
•   関係はタプルの集合          User Name Addr
•   タプルはアトムの並び         U0    N0   A0
•   関係はRDBの「Table」だと
    思えば良い              U0    N0   A1

                       U1    N1   A2

各行がタプル                 U2    N2   A2
関係「profile」
User Name Addr
 U0   N0   A0     profile = {
                    (U0, N0, A0),
 U0   N0   A1
                    (U0, N0, A1),
                    (U1, N1, A2),
 U1   N1   A2
                    (U2, N2, A2)
                  }      アリティ=3
 U2   N2   A2
                 こんな感じでよく書きます

あとこの列の数をアリティと呼びます
さっき
        sig User {}

は
      User = {U0, U1, ...}

と書きましたが、より正確には
      User = {(U0), (U1), ...}

という、タプルのアリティが1の関係を表します。
※「関係はタプルの集合」です
関係には名前をつけることができます



       sig User {
       name: Name
       }
       sig Name {}
sig User {
             name: Name
             }
             sig Name {}

を、RDB的な表現をすると

  create table User (id primary key);
  create table Name (id primary key);
  create table name(id User, id Name);


というニュアンスだと思ってください。
特に、最後のnameが少し変わってますね。
あと、これ重要




Alloyの全ての値は
      関係
      です

※つまり全ての変数の内容は関係です
また、
アリティが1で要素数が1の関係
を特別にスカラと呼びます

User
 U0    u0={(U0)}   スカラは
                   何か一つのモノを
                   表すのでよく使うので
                   概念名をつけていますが、
                   繰り返しますが、
                   スカラも関係です。
Name
 N2    n2={(N2)}
演算
今回使うものだけ説明します
ドット結合
         user.name


RDBで言えば、JOINです.
関係user と 関係name
をJOINして JOINキー列を除去した関係を表
します
User      .    name
 U0           U0 N0
 U1                     最初はこう
              U2 N2
 U2
               join


       U0 U0 N0       JOINキーが同じタプル
       U2 U2 N2       で新しい関係を作る

              N0
                       JOINキー列は削除
              N2
直感的な結果になる
  User                         name
   U0                          U0 N0
                               U2 N2


u0={(U0)}             name={(U0, N0),
                           (U2, N2)}


            u0.name = {(N0)}
他の例
       関係mail(from, message, to)
               U1 M1 U2
               U1 M2 U3
               U5 M3 U2

左から         u1.mail={(M1, U2), (M2, U3)}

右側から        mail.u2={(U1, M1), (U5, M3)}

両側から        u1.mail.u2={(M1)}

              自由にJOINできる
JOINキーは最左か最右


• SQLみたいに列名でJOINできない
• 関係の列の順番が重要になります
• 実用上それほど困らないらしいです
矢印積
 これが矢印積

 U1 -> N1
集合の直積を表す
Group                       drinkFood
    G0                         D0 F0

    G1                         D1 F1

{(G0), (G1)}             {(D0,F0), (D1,F1)}

          Group -> drinkFood
               G0   D0   F0
               G0   D1   F1
               G1   D0   F0
               G1   D1   F1
    {(G0, D0, F0), (G0, D1, F1),
    (G1, D0,F0), (G1, D1, F1)}
特に双方がスカラの場合によく使う



  User                     Name
   U0                        N0

u0= {(U0)}                n0= {(N0)}


             u0 -> n0
              U0 N0

             {(U0, N0)}
制約

• 論理and, or, not とか 集合のinとか馴染
 みの言語でよく使うものは当然ある
• Alloyに制約の書き方は本当にたくさんあ
 りますが、今回は2つだけ説明します
implies (含意)

     A ならば B である
   というのを
      A implies B
   と記述することができます。


※Alloyでは implies を => とも書きます
でも矢印積(->)となんか紛らわしい・・・
A implies B
      というのは
      (A and B) or (not A)
      と同じ意味です。



「君が金メダリスト ならば 私は総理大臣だ」
が真になる(嘘ではない)のは、
「君が金メダリスト かつ 私が総理大臣」
もしくは
「君が金メダリストではない」
ときですよね。
限量     そろそろ馴染みが薄い領域・・・




all x: e | F    eを満たす全てのxにおいてFが成立する

some x: e | F   eを満たすあるxにおいてFが成立する

no x: e | F     eを満たす全てのxにおいてFが成立しない

lone x: e | F   eを満たす高々1つのxにおいてFが成立する

one x: e | F    eを満たすちょうど1つのxにおいてFが成立
Push
• Push
  –

  – DeviceToken
          ID
Push
                             GCM




1.
2. DeviceToken
3.             DeviceToken
4. Push
5. Push
DeviceToken
• DeviceToken
    –            DeviceToken        Push
                        DeviceToken

    –                 DeviceToken

•

    – Push
GCM




API




      DB
DT


                                            GCM
                           Push
                                                  DT



                                     Push




GCM Google Cloud Messaging for Android
           API
 DeviceToken
               Push
     android   Push
  iPhone
                            DB
DT


                                        GCM
                         Push
                                              DT
Push


                                 Push
             DT



       API
                  Push


                  GCM    DT         API            DB
                          DB

                          Push
DT

                          API
                                                   GCM
                                     DT                  DB

Push                                 Push                 DB

                                            Push
                DT



       API
                     DT




             Push


                                DB
Push                        Push
GCM      DT                        DB    DT                  GCM

DT                                              DB                      DT
       Push


                                                     Push
                       DT



              API                        Push
                            DT
                                                DT


                    Push                                           DT

                                        DB                  DT
DT


                                                     GCM
                          Push
                                                                DT
Push


                                             Push
                DT



       API                       Push
                     DT
                                        DT


             Push                                          DT

                           DB                       DT
DT


                                                     GCM
                          Push
                                                                DT
Push


                                             Push
                DT
         DB
       API                       Push
                     DT
                                        DT


             Push                                          DT

                           DB                       DT
• DeviceToken
•                     Push

•
    –
    – Push      GCM

    – Push            GCM
•
• DB                         Push   GCM
•     DeviceToken
•   DeviceToken
• alloy

•
    –
    –
•
    –      DeviceToken Push
•
    –       GCM DB
•
    – DeviceToken       Push
•
•
• open
   – Time DeviceToken
• abstract
   – PushAvailability
      extends
•                             2
    –
        •
    – Push
        • PushAvailability Time
        •                 one     PushAvailability   1
•            AppState
•
    – fact
GCM




• GCM DeviceToken
   – 2,3     lone                     DeviceToken   1

• current previous                        3
   –         current           previous
   –         current previous
   –                 current,previous
GCM




• GCMState                         2
  – previous             current       previous
    DeviceToken
  – current       previous
DB


•                      DeviceToken PushAvailability

• DeviceToken1              PushAvailability           1

    – lone        (DT0, Available) (DT0,Unavailable)

    – lone       one            DeviceToken
•
    – alloy
    –
•
    –2

    –         pred
•   t t'
•            3
    –
    – Push
    – Push
GCM
• GCM            2
 – DeviceToken
 –
GCM
GCM
DB
DB
DB
Push
• Push
  – Push
  –
  –               DB
  –
     • 1   Push        GCM
     • 2   Push              DB
Push
Push
•
    – AppState
    – GCMState             DB Push


    – DBState

      • previous current
Push   AppState


• AppState
Push              GCMState




    – DB Push
    –
•
    – current          GCMState      previous
•
    – GCM
Push                  DBState




• p   c   dt=c → dt' dt''              DB
• p   c   dt≠c → dt'      dt''=dt           DeviceToken
Push                      DBState




• p   c   dt=p → dt'=dt''=p p.next=c      DB p         c
• p   c   dt=c → dt' dt''                  DB
• p   c   dt≠p,c → dt'      dt''=dt              DeviceToken
Push          DBState




• p   c   → dt'   dt''=dt      DeviceToken
•
    –      DeviceToken Push
•
    –       GCM DB
•
    – DeviceToken       Push
•
•
• alloy
    –     t
• first & DeviceToken
    –     first      next   ordering
                                     first         next
    –                     Time   DeviceToken        first   2
    –             DeviceToken                  &
•

•


• alloy   1
Traces
Traces



• alloy
   –
Traces



• alloy
   –
   – last   t
Traces



• alloy
   –
   – last   t   t       t'
Traces



• alloy
   –
   – last   t   t       t'
Traces



• alloy
   –
   – last   t   t       t'
•
    –      DeviceToken Push
•
    –       GCM DB
•
    – DeviceToken       Push
•
•
•     DeviceToken
•   DeviceToken
DeviceToken



•
    –                 DB
DeviceToken




•
    –            Push   2
•   counterexample
•
    EventState
•
DT




•
DT




• Next        Projection:none
 Time
DT




•
DT
•   Theme


            …
DT




•
DT




•           GCMUpdate
    DeviceToken0→DeviceToken1
DT




• GCMExpire        DeviceToken0
•             DB         GCM
  DeviceToken
DT




•   Push   DB
DT




•
DT




•   Push
DT




• API   Push   DB
DT




•
DT




• Push
DT




•    Push
• DB             PushUnavailable
•            DeviceToken
    –
                           DT
•       DeviceToken
    – Push
dry run
•       Push                  GCM Push

•           DeviceToken
             DeviceToken
•                          Push

• dry run
dry run
•
    –
•
    –
• DB
    –    →
    –            →   DeviceToken
    –        →
dryrun
dryrun




• GCM
dryrun




• Push
     dryrun
•   Dryrun    Traces 2
•            Dryrun
DT
DT




• Traces                    assert
• implies    Traces1
  Traces2          Dryrun
DT
DT              1




•
    –        Push   2
DT                         2




•                 Push   dryrun   2
    DeviceToken
• DoNotLoseUser2
DT   2




•
DT   2




• Push
DT   2




• DB
DT   2




•
DT       2




• Push       Dryrun
   EventState
DT         2




• Push        Dryrun2
•             DeviceToken
    –
                       DT
    –                dryrun             DT        GCM
               DT
•        DeviceToken
    – Push

    – dryrun                                 GCM DT

    –                         dryrun
        GCM    DT                  DB
• DT           Push       dryrun

•                 alloy
•

       alloy

Contenu connexe

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

形式手法勉強会第3回 device tokenの仕様について

  • 1.
  • 2. • alloy • – Push – – • alloy • •
  • 5. アトム • これ以上分けられない • 変化することがない • それ自体意味をもたない • 「要素」である
  • 6. アトムの例 • 「本」 • 「ユーザ」 • 「名前」 • 「時刻」 • 「状態名」
  • 7. 例えば sig User {} と書くと、Userというアトムの集合 があるということを宣言している。 馴染みの言語で言えば、 class User と意味は似ているかもしれない
  • 8. sig User {} において、 Userというのはアトムの集合を表す。 User = {U0, U1, ...} という感じで、要素としてアトムを持つ。 class User が無数のインスタンスを持つようなもの
  • 9. 関係 関係「profile」 • 関係はタプルの集合 User Name Addr • タプルはアトムの並び U0 N0 A0 • 関係はRDBの「Table」だと 思えば良い U0 N0 A1 U1 N1 A2 各行がタプル U2 N2 A2
  • 10. 関係「profile」 User Name Addr U0 N0 A0 profile = { (U0, N0, A0), U0 N0 A1 (U0, N0, A1), (U1, N1, A2), U1 N1 A2 (U2, N2, A2) } アリティ=3 U2 N2 A2 こんな感じでよく書きます あとこの列の数をアリティと呼びます
  • 11. さっき sig User {} は User = {U0, U1, ...} と書きましたが、より正確には User = {(U0), (U1), ...} という、タプルのアリティが1の関係を表します。 ※「関係はタプルの集合」です
  • 12. 関係には名前をつけることができます sig User { name: Name } sig Name {}
  • 13. sig User { name: Name } sig Name {} を、RDB的な表現をすると create table User (id primary key); create table Name (id primary key); create table name(id User, id Name); というニュアンスだと思ってください。 特に、最後のnameが少し変わってますね。
  • 14. あと、これ重要 Alloyの全ての値は 関係 です ※つまり全ての変数の内容は関係です
  • 15. また、 アリティが1で要素数が1の関係 を特別にスカラと呼びます User U0 u0={(U0)} スカラは 何か一つのモノを 表すのでよく使うので 概念名をつけていますが、 繰り返しますが、 スカラも関係です。 Name N2 n2={(N2)}
  • 17. ドット結合 user.name RDBで言えば、JOINです. 関係user と 関係name をJOINして JOINキー列を除去した関係を表 します
  • 18. User . name U0 U0 N0 U1 最初はこう U2 N2 U2 join U0 U0 N0 JOINキーが同じタプル U2 U2 N2 で新しい関係を作る N0 JOINキー列は削除 N2
  • 19. 直感的な結果になる User name U0 U0 N0 U2 N2 u0={(U0)} name={(U0, N0), (U2, N2)} u0.name = {(N0)}
  • 20. 他の例 関係mail(from, message, to) U1 M1 U2 U1 M2 U3 U5 M3 U2 左から u1.mail={(M1, U2), (M2, U3)} 右側から mail.u2={(U1, M1), (U5, M3)} 両側から u1.mail.u2={(M1)} 自由にJOINできる
  • 22. 矢印積 これが矢印積 U1 -> N1 集合の直積を表す
  • 23. Group drinkFood G0 D0 F0 G1 D1 F1 {(G0), (G1)} {(D0,F0), (D1,F1)} Group -> drinkFood G0 D0 F0 G0 D1 F1 G1 D0 F0 G1 D1 F1 {(G0, D0, F0), (G0, D1, F1), (G1, D0,F0), (G1, D1, F1)}
  • 24. 特に双方がスカラの場合によく使う User Name U0 N0 u0= {(U0)} n0= {(N0)} u0 -> n0 U0 N0 {(U0, N0)}
  • 25. 制約 • 論理and, or, not とか 集合のinとか馴染 みの言語でよく使うものは当然ある • Alloyに制約の書き方は本当にたくさんあ りますが、今回は2つだけ説明します
  • 26. implies (含意) A ならば B である というのを A implies B と記述することができます。 ※Alloyでは implies を => とも書きます でも矢印積(->)となんか紛らわしい・・・
  • 27. A implies B というのは (A and B) or (not A) と同じ意味です。 「君が金メダリスト ならば 私は総理大臣だ」 が真になる(嘘ではない)のは、 「君が金メダリスト かつ 私が総理大臣」 もしくは 「君が金メダリストではない」 ときですよね。
  • 28. 限量 そろそろ馴染みが薄い領域・・・ all x: e | F eを満たす全てのxにおいてFが成立する some x: e | F eを満たすあるxにおいてFが成立する no x: e | F eを満たす全てのxにおいてFが成立しない lone x: e | F eを満たす高々1つのxにおいてFが成立する one x: e | F eを満たすちょうど1つのxにおいてFが成立
  • 29.
  • 30. Push • Push – – DeviceToken ID
  • 31. Push GCM 1. 2. DeviceToken 3. DeviceToken 4. Push 5. Push
  • 32. DeviceToken • DeviceToken – DeviceToken Push DeviceToken – DeviceToken • – Push
  • 33. GCM API DB
  • 34. DT GCM Push DT Push GCM Google Cloud Messaging for Android API DeviceToken Push android Push iPhone DB
  • 35. DT GCM Push DT Push Push DT API Push GCM DT API DB DB Push
  • 36. DT API GCM DT DB Push Push DB Push DT API DT Push DB
  • 37. Push Push GCM DT DB DT GCM DT DB DT Push Push DT API Push DT DT Push DT DB DT
  • 38. DT GCM Push DT Push Push DT API Push DT DT Push DT DB DT
  • 39. DT GCM Push DT Push Push DT DB API Push DT DT Push DT DB DT
  • 40. • DeviceToken • Push • – – Push GCM – Push GCM • • DB Push GCM
  • 41. DeviceToken • DeviceToken
  • 42.
  • 43. • alloy • – –
  • 44. – DeviceToken Push • – GCM DB • – DeviceToken Push • •
  • 45. • open – Time DeviceToken • abstract – PushAvailability extends
  • 46. 2 – • – Push • PushAvailability Time • one PushAvailability 1
  • 47. AppState • – fact
  • 48. GCM • GCM DeviceToken – 2,3 lone DeviceToken 1 • current previous 3 – current previous – current previous – current,previous
  • 49. GCM • GCMState 2 – previous current previous DeviceToken – current previous
  • 50. DB • DeviceToken PushAvailability • DeviceToken1 PushAvailability 1 – lone (DT0, Available) (DT0,Unavailable) – lone one DeviceToken
  • 51. – alloy – • –2 – pred
  • 52. t t'
  • 53. 3 – – Push – Push
  • 54.
  • 55. GCM • GCM 2 – DeviceToken –
  • 56. GCM
  • 57. GCM
  • 58. DB
  • 59. DB
  • 60. DB
  • 61. Push • Push – Push – – DB – • 1 Push GCM • 2 Push DB
  • 62. Push
  • 63. Push • – AppState – GCMState DB Push – DBState • previous current
  • 64. Push AppState • AppState
  • 65. Push GCMState – DB Push – • – current GCMState previous • – GCM
  • 66. Push DBState • p c dt=c → dt' dt'' DB • p c dt≠c → dt' dt''=dt DeviceToken
  • 67. Push DBState • p c dt=p → dt'=dt''=p p.next=c DB p c • p c dt=c → dt' dt'' DB • p c dt≠p,c → dt' dt''=dt DeviceToken
  • 68. Push DBState • p c → dt' dt''=dt DeviceToken
  • 69. – DeviceToken Push • – GCM DB • – DeviceToken Push • •
  • 70. • alloy – t • first & DeviceToken – first next ordering first next – Time DeviceToken first 2 – DeviceToken &
  • 74. Traces • alloy – – last t
  • 75. Traces • alloy – – last t t t'
  • 76. Traces • alloy – – last t t t'
  • 77. Traces • alloy – – last t t t'
  • 78. – DeviceToken Push • – GCM DB • – DeviceToken Push • •
  • 79. DeviceToken • DeviceToken
  • 80. DeviceToken • – DB
  • 81. DeviceToken • – Push 2
  • 82. counterexample
  • 83. EventState
  • 84.
  • 86. DT • Next Projection:none Time
  • 88. DT • Theme …
  • 90. DT • GCMUpdate DeviceToken0→DeviceToken1
  • 91. DT • GCMExpire DeviceToken0 • DB GCM DeviceToken
  • 92. DT • Push DB
  • 94. DT • Push
  • 95. DT • API Push DB
  • 98. DT • Push • DB PushUnavailable
  • 99. DeviceToken – DT • DeviceToken – Push
  • 100.
  • 101. dry run • Push GCM Push • DeviceToken DeviceToken • Push • dry run
  • 102. dry run • – • – • DB – → – → DeviceToken – →
  • 103. dryrun
  • 105. dryrun • Push dryrun
  • 106.
  • 107. Dryrun Traces 2 • Dryrun
  • 108. DT
  • 109. DT • Traces assert • implies Traces1 Traces2 Dryrun
  • 110. DT
  • 111. DT 1 • – Push 2
  • 112. DT 2 • Push dryrun 2 DeviceToken
  • 114. DT 2 •
  • 115. DT 2 • Push
  • 116. DT 2 • DB
  • 117. DT 2 •
  • 118. DT 2 • Push Dryrun EventState
  • 119. DT 2 • Push Dryrun2
  • 120. DeviceToken – DT – dryrun DT GCM DT • DeviceToken – Push – dryrun GCM DT – dryrun GCM DT DB
  • 121.
  • 122. • DT Push dryrun • alloy • alloy