diff --git a/AlgebraicDataflowArchitectureModel/models/Test.model b/AlgebraicDataflowArchitectureModel/models/Test.model index 38c78b5..70a16cd 100644 --- a/AlgebraicDataflowArchitectureModel/models/Test.model +++ b/AlgebraicDataflowArchitectureModel/models/Test.model @@ -1,18 +1,30 @@ -channel Signup { - out accounts(accDB:Map, signup(aid:Str)) = insert(accDB, aid, {"favorites": nil, "books": nil}) - out keeplog(a:Str, signup(account))=account +init { + a := "001" + b := "hello" + c := { + "001": "ok", + "002": "bad" + } } -channel CreateBook(aid:Str) { - out accounts.{aid}.books(bookList:List, createBook(title:Str)) = append(bookList, {"title": title, "favorited": nil}) +channel add{ + out b(cur: Str, add(next: Str)) = next } -channel Slog { - out temp(a:Str,Slog(account))=account +channel addC { + out c(cur: Map, addC(id: Str, name: Str)) = insert(cur, id, name) } -channel Login { - in temp(ac:Str,login(acoount: Str,accDB: Map))=account - ref accounts(accDB:Map, login(account: Str,accDB: Map)) - out keeplog(a:Str,login(account: Str, accDB: Map))=if(contains(accDB, account), account, "") -} \ No newline at end of file +channel changeC(id: Str) { + out c.{id}(cur: Str, changeC(next: Str)) = next +} + +channel changeTarget { + out a(cur: Str, changeTarget(next: Str)) = next +} + +channel send(id: Str) { + in b(cur: Str, send(next, target)) = next + ref a(target, send(next, target)) + out c.{target}(cur: Str, send(next, target)) = next +}