diff --git a/AlgebraicDataflowArchitectureModel/models/StockManagement.model b/AlgebraicDataflowArchitectureModel/models/StockManagement.model index 131b7ef..b133f44 100644 --- a/AlgebraicDataflowArchitectureModel/models/StockManagement.model +++ b/AlgebraicDataflowArchitectureModel/models/StockManagement.model @@ -31,16 +31,20 @@ channel C3 { in deriver(dr, update3(dr2)) == dr2 out stock(st, update3(dr2)) == insert(st, fst(dr2), snd(snd(dr2))) - out shipping(sp:Tuple, update3(dr2)) == tuple(fst(dr2), fst(snd(dr2))) } channel C4 { - in request(rq, update4(rq2, st)) == rq2 - ref stock(st, update4(rq2, st)) - out deriver(dr, update4(rq2, st)) == if(ge(lookup(st, fst(rq2)), snd(rq2)), + in deriver(dr, update4(dr2)) == dr2 + out shipping(sp:Tuple, update4(dr2)) == tuple(fst(dr2), fst(snd(dr2))) +} + +channel C5 { + in request(rq, update5(rq2, st)) == rq2 + ref stock(st, update5(rq2, st)) + out deriver(dr, update5(rq2, st)) == if(ge(lookup(st, fst(rq2)), snd(rq2)), tuple(fst(rq2), snd(rq2), lookup(st, fst(rq2)) - snd(rq2)), tuple(fst(rq2), 0, lookup(st, fst(rq2)))) - out shortage(sh, update4(rq2, st)) == if(ge(lookup(st, fst(rq2)), snd(rq2)), + out shortage(sh, update5(rq2, st)) == if(ge(lookup(st, fst(rq2)), snd(rq2)), sh, insert(sh, fst(rq2), lookup(sh, fst(rq2)) + snd(rq2))) } \ No newline at end of file