diff --git a/AlgebraicDataflowArchitectureModel/models/Twitter.model b/AlgebraicDataflowArchitectureModel/models/Twitter.model index 98d391b..f02f134 100644 --- a/AlgebraicDataflowArchitectureModel/models/Twitter.model +++ b/AlgebraicDataflowArchitectureModel/models/Twitter.model @@ -1,53 +1,53 @@ channel a_Tweet { - out a_user_timeline(l:List, a_tweet(t:Str)) == cons(t, l) - out a_user_timeline(l, e) == l + out a_tweets(l:List, a_tweet(t:Str, time:Long)) == cons(tuple(time, t), l) + out a_tweets(l, e) == l } channel a_Follow { - out a_follows(f:List, a_follow(u:Int)) == cons(u, f) - out a_follows(f, e) == f + out a_following(f:List, a_follow(u:Int)) == cons(u, f) + out a_following(f, e) == f } channel a_Home { - in a_user_timeline(la1, update_a(f2, la2, lb2, lc2)) == la2 - in b_user_timeline(lb1, update_a(f2, la2, lb2, lc2)) == lb2 - in c_user_timeline(lc1, update_a(f2, la2, lb2, lc2)) == lc2 - in a_follows(f, update_a(f2, la2, lb2, lc2)) == f2 - out a_home_timeline(t:List, update_a(f2, la2, lb2, lc2)) == merge(la2, if(contains(f2,2), merge(lb2, if(contains(f2,3), lc2, nil)), if(contains(f2,3), lc2, nil))) + in a_tweets(la1, update_a(f2, la2, lb2, lc2)) == la2 + in b_tweets(lb1, update_a(f2, la2, lb2, lc2)) == lb2 + in c_tweets(lc1, update_a(f2, la2, lb2, lc2)) == lc2 + in a_following(f, update_a(f2, la2, lb2, lc2)) == f2 + out a_timeline(t:List, update_a(f2, la2, lb2, lc2)) == merge(la2, if(contains(f2,2), merge(lb2, if(contains(f2,3), lc2, nil)), if(contains(f2,3), lc2, nil))) } channel b_Tweet { - out b_user_timeline(l:List, b_tweet(t:Str)) == cons(t, l) - out b_user_timeline(l, e) == l + out b_tweets(l:List, b_tweet(t:Str, time:Long)) == cons(tuple(time, t), l) + out b_tweets(l, e) == l } channel b_Follow { - out b_follows(f:List, b_follow(u:Int)) == cons(u, f) - out b_follows(f, e) == f + out b_following(f:List, b_follow(u:Int)) == cons(u, f) + out b_following(f, e) == f } channel b_Home { - in a_user_timeline(la1, update_b(f2, la2, lb2, lc2)) == la2 - in b_user_timeline(lb1, update_b(f2, la2, lb2, lc2)) == lb2 - in c_user_timeline(lc1, update_b(f2, la2, lb2, lc2)) == lc2 - in b_follows(f, update_b(f2, la2, lb2, lc2)) == f2 - out b_home_timeline(t:List, update_b(f2, la2, lb2, lc2)) == merge(lb2, if(contains(f2,1), merge(la2, if(contains(f2,3), lc2, nil)), if(contains(f2,3), lc2, nil))) + in a_tweets(la1, update_b(f2, la2, lb2, lc2)) == la2 + in b_tweets(lb1, update_b(f2, la2, lb2, lc2)) == lb2 + in c_tweets(lc1, update_b(f2, la2, lb2, lc2)) == lc2 + in b_following(f, update_b(f2, la2, lb2, lc2)) == f2 + out b_timeline(t:List, update_b(f2, la2, lb2, lc2)) == merge(lb2, if(contains(f2,1), merge(la2, if(contains(f2,3), lc2, nil)), if(contains(f2,3), lc2, nil))) } channel c_Tweet { - out c_user_timeline(l:List, c_tweet(t:Str)) == cons(t, l) - out c_user_timeline(l, e) == l + out c_tweets(l:List, c_tweet(t:Str, time:Long)) == cons(tuple(time, t), l) + out c_tweets(l, e) == l } channel c_Follow { - out c_follows(f:List, c_follow(u:Int)) == cons(u, f) - out c_follows(f, e) == f + out c_following(f:List, c_follow(u:Int)) == cons(u, f) + out c_following(f, e) == f } channel c_Home { - in a_user_timeline(la1, update_c(f2, la2, lb2, lc2)) == la2 - in b_user_timeline(lb1, update_c(f2, la2, lb2, lc2)) == lb2 - in c_user_timeline(lc1, update_c(f2, la2, lb2, lc2)) == lc2 - in c_follows(f, update_c(f2, la2, lb2, lc2)) == f2 - out c_home_timeline(t:List, update_c(f2, la2, lb2, lc2)) == merge(lc2, if(contains(f2,1), merge(la2, if(contains(f2,2), lb2, nil)), if(contains(f2,2), lb2, nil))) + in a_tweets(la1, update_c(f2, la2, lb2, lc2)) == la2 + in b_tweets(lb1, update_c(f2, la2, lb2, lc2)) == lb2 + in c_tweets(lc1, update_c(f2, la2, lb2, lc2)) == lc2 + in c_following(f, update_c(f2, la2, lb2, lc2)) == f2 + out c_timeline(t:List, update_c(f2, la2, lb2, lc2)) == merge(lc2, if(contains(f2,1), merge(la2, if(contains(f2,2), lb2, nil)), if(contains(f2,2), lb2, nil))) }