diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2021-10-29 01:35:54 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2021-10-29 01:35:54 +0900 |
| commit | d28e80274828540a3278ef20c3250afb576773d4 (patch) | |
| tree | 329944a21b8dc12653e2b3105fb8264df1fb3fad /sample/processnet_fib.in | |
| parent | 8b6cf5aa982859035c015c95f31e989add9af238 (diff) | |
| download | inpla-d28e80274828540a3278ef20c3250afb576773d4.tar.gz inpla-d28e80274828540a3278ef20c3250afb576773d4.zip | |
v0.5.0
Diffstat (limited to 'sample/processnet_fib.in')
| -rw-r--r-- | sample/processnet_fib.in | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sample/processnet_fib.in b/sample/processnet_fib.in new file mode 100644 index 0000000..ab19eec --- /dev/null +++ b/sample/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 | +// +------------------------------------------------------+ +// |
