diff --git a/AlgebraicDataflowArchitectureModel/models/DataStore.model b/AlgebraicDataflowArchitectureModel/models/DataStore.model index 3ae99d1..b051f9e 100644 --- a/AlgebraicDataflowArchitectureModel/models/DataStore.model +++ b/AlgebraicDataflowArchitectureModel/models/DataStore.model @@ -1,37 +1,16 @@ -channel addAccounts { - out accounts(accounts: Map, addAccounts(id: Str, name: Str, age: Int)) = insert(accounts, id, {"name": name,"age": age}) +channel AddAccount{ + out accounts(accounts: Map, addAccounts(aid: Str, name: Str)) = insert(accounts, aid, {"name": name}) } -channel changeNameOfAccounts(id: Str) { - out accounts.{id}.name(name: Str, changeNameOfAccounts(newName: Str)) = newName +channel ChangeName(aid: Str) { + out accounts.{aid}.name(curName: Str, changeName(nextName: Str)) = nextName } -channel changeAgeOfAccounts(id: Str) { - out accounts.{id}.age(age: Int, changeAgeOfAccounts(newAge: Int)) = newAge +channel DeleteAccount { + out accounts(accounts: Map, deleteAccount(aid: Str)) = delete(accounts, aid) } -channel addTweets { - out tweets(tweets: Map, addTweets(tweetId: Int, contents: Str, idOfAccounts: Str)) = insert(tweets, tweetId, {"contents": contents,"idOfAccounts": idOfAccounts}) -} - -channel changeContentsOfTweets(tweetId: Int) { - out tweets.{tweetId}.contents(contents: Str, changeContentsOfTweets(newContents: Str)) = newContents -} - -channel changeIdOfAccountsOfTweets(tweetId: Int) { - out tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, changeIdOfAccountsOfTweets(newIdOfAccounts: Str)) = newIdOfAccounts -} - -channel nameOfAccountsOfTweets(tweetId: Int){ - in tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, nameOfAccountsOfTweets(newIdOfAccounts: Str, newNameOfAccounts: Str)) = newIdOfAccounts - in accounts.{newIdOfAccounts}.name(name: Str, nameOfAccountsOfTweets(newIdOfAccounts, newNameOfAccounts)) = newNameOfAccounts - out tweets.{tweetId}.nameOfAccounts(nameOfAccounts, nameOfAccountsOfTweets(newIdOfAccounts, newNameOfAccounts)) = newNameOfAccounts -} - -channel ageOfAccountsOfTweets(tweetId: Int){ - in tweets.{tweetId}.idOfAccounts(idOfAccounts: Str, ageOfAccountsOfTweets(newIdOfAccounts: Str, newAgeOfAccounts: Int)) = newIdOfAccounts - in accounts.{newIdOfAccounts}.age(age: Int, ageOfAccountsOfTweets(newIdOfAccounts, newAgeOfAccounts)) = newAgeOfAccounts - out tweets.{tweetId}.ageOfAccounts(ageOfAccounts, ageOfAccountsOfTweets(newIdOfAccounts, newAgeOfAccounts)) = newAgeOfAccounts -} - - +channel Test1 { + in accounts(accounts: Map, test1(next)) = next + out accounts2(accounts2: Map, test1(next)) = next +} \ No newline at end of file