diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2024-03-05 18:19:27 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2024-03-05 18:19:27 +0900 |
| commit | 49960d8950d001a372a0abde670a66ee60026957 (patch) | |
| tree | adad1d5fe428bf0bea151f71ed114223fc246bca /sample/process_networks/processnet_fib.in | |
| parent | 0cf73da9ad035089c66d21021a656e4606796c47 (diff) | |
| download | inpla-49960d8950d001a372a0abde670a66ee60026957.tar.gz inpla-49960d8950d001a372a0abde670a66ee60026957.zip | |
v0.12.0
Diffstat (limited to 'sample/process_networks/processnet_fib.in')
| -rw-r--r-- | sample/process_networks/processnet_fib.in | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sample/process_networks/processnet_fib.in b/sample/process_networks/processnet_fib.in new file mode 100644 index 0000000..ab19eec --- /dev/null +++ b/sample/process_networks/processnet_fib.in @@ -0,0 +1,30 @@ +// Rules +dup(a1,a2) >< (int i):xs => a1~(i:xs1), a2~(i:xs2), dup(xs1,xs2)~xs; +dup(a1,a2) >< [] => a1~[], a2~[]; + +add(r, ys) >< (int i):xs => addn(r, xs, i)~ys; +addn(r, xs, int i) >< (int j):ys => r~(i+j):w, add(w,ys)~xs; + + +// Nets +dup(r, r1)~(1:xs), r1~add(sum, w), dup(xs, w)~(1:sum); + +// r,r1 << dup(1:xs), +// xs,w << dup(1:sum), +// sum << add(r1,w); + +// +-----+ +---+ +// r ----| | | | xs +-----+ +---+ +// | dup |---><---| 1 |-----| | | | +// +---| | | | | dup |---><---| 1 |----+ +// | +-----+ +---+ +--| | | | | +// | | +-----+ +---+ | sum +// | | | +// | | +-----+ +// | | | add | +// | | +-----+ +// | | w | | +// | +------------------------+ v +// | r1 | +// +------------------------------------------------------+ +// |
