Skip to content

Commit

Permalink
NetRenderer -- only print edges
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Jul 29, 2023
1 parent e604564 commit 8e71a65
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 212 deletions.
14 changes: 12 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# named port

`Node` with optionally named port
[syntax] named port

`Node` with named port

`defnode` instead of `defcons` and `defelim`

`PortPush` -- new word

`PortConnect` -- new word

no `defru` just `defrule` -- add feature when very very needed

# render

`NetRenderer` -- format to simple text representation of graph
Expand All @@ -18,14 +26,16 @@ change the `render` command to simple `run` command

the stack can take other types of values -- not only port

`"head" put` instead of `(let head)`
`"head" set` instead of `(let head)`

explicit `"name" get` for local variable

# simple types

linear logic as type system of inet

`Node` port name can be optional

`deftype` -- `TermType` -- use `'a` for name of pattern like in haskell

`defnode` -- type check
Expand Down
4 changes: 2 additions & 2 deletions docs/notes/using-string-for-local-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ to get pure postfix syntax.

```inet
defn cons append
"head" put append
"head" set append
"head" get cons
end
```

How about keywords like `put`, but need a code block?
How about keywords like `set`, but need a code block?

TODO
18 changes: 1 addition & 17 deletions docs/tests/DiffList.inet.one_two_soles.finial.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
cons#2 -- sole#1 [label="0-0"]
sole#1
cons#2
cons#6 -- sole#5 [label="0-0"]
sole#5
cons#6
cons#8 -- sole#7 [label="0-0"]
sole#7
cons#8
cons#8 -- cons#6 [label="1-2"]
cons#6
cons#8
diff#13 -- cons#6 [label="0-1"]
cons#6
diff#13
cons#8 -- cons#2 [label="2-2"]
cons#2
cons#8
diff#13 -- cons#2 [label="1-1"]
cons#2
diff#13
diff#13(2) -- diff#13
diff#13
diff#13(2)
diff#13(2) -- diff#13
24 changes: 1 addition & 23 deletions docs/tests/DiffList.inet.one_two_soles.initial.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
cons#2 -- sole#1 [label="0-0"]
sole#1
cons#2
diff#3 -- cons#2 [label="0-2"]
cons#2
diff#3
cons#6 -- sole#5 [label="0-0"]
sole#5
cons#6
cons#8 -- sole#7 [label="0-0"]
sole#7
cons#8
cons#8 -- cons#6 [label="1-2"]
cons#6
cons#8
diff#9 -- cons#8 [label="0-2"]
cons#8
diff#9
diff_append#10 -- diff#3 [label="1-2"]
diff#3
diff_append#10
cons#2 -- diff#3 [label="1-1"]
diff#3
cons#2
cons#6 -- diff#9 [label="1-1"]
diff#9
cons#6
diff_append#10 -- diff#9 [label="0-2" color=red]
diff#9
diff_append#10
diff_append#10(2) -- diff_append#10
diff_append#10
diff_append#10(2)
diff_append#10(2) -- diff_append#10
22 changes: 1 addition & 21 deletions docs/tests/DiffList.inet.two_two_soles.finial.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
cons#16 -- sole#15 [label="0-0"]
sole#15
cons#16
cons#18 -- sole#17 [label="0-0"]
sole#17
cons#18
cons#18 -- cons#16 [label="1-2"]
cons#16
cons#18
cons#22 -- sole#21 [label="0-0"]
sole#21
cons#22
cons#24 -- sole#23 [label="0-0"]
sole#23
cons#24
cons#24 -- cons#22 [label="1-2"]
cons#22
cons#24
diff#29 -- cons#22 [label="0-1"]
cons#22
diff#29
cons#24 -- cons#18 [label="2-2"]
cons#18
cons#24
diff#29 -- cons#16 [label="1-1"]
cons#16
diff#29
diff#29(2) -- diff#29
diff#29
diff#29(2)
diff#29(2) -- diff#29
28 changes: 1 addition & 27 deletions docs/tests/DiffList.inet.two_two_soles.initial.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
cons#16 -- sole#15 [label="0-0"]
sole#15
cons#16
cons#18 -- sole#17 [label="0-0"]
sole#17
cons#18
cons#18 -- cons#16 [label="1-2"]
cons#16
cons#18
diff#19 -- cons#18 [label="0-2"]
cons#18
diff#19
cons#22 -- sole#21 [label="0-0"]
sole#21
cons#22
cons#24 -- sole#23 [label="0-0"]
sole#23
cons#24
cons#24 -- cons#22 [label="1-2"]
cons#22
cons#24
diff#25 -- cons#24 [label="0-2"]
cons#24
diff#25
diff_append#26 -- diff#19 [label="1-2"]
diff#19
diff_append#26
cons#16 -- diff#19 [label="1-1"]
diff#19
cons#16
cons#22 -- diff#25 [label="1-1"]
diff#25
cons#22
diff_append#26 -- diff#25 [label="0-2" color=red]
diff#25
diff_append#26
diff_append#26(2) -- diff_append#26
diff_append#26
diff_append#26(2)
diff_append#26(2) -- diff_append#26
32 changes: 1 addition & 31 deletions docs/tests/List.inet.six_soles.finial.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,15 @@
cons#2 -- sole#1 [label="0-0"]
sole#1
cons#2
cons#2 -- null#0 [label="1-0"]
null#0
cons#2
cons#4 -- sole#3 [label="0-0"]
sole#3
cons#4
cons#4 -- cons#2 [label="1-2"]
cons#2
cons#4
cons#6 -- sole#5 [label="0-0"]
sole#5
cons#6
cons#6 -- cons#4 [label="1-2"]
cons#4
cons#6
cons#9 -- sole#8 [label="0-0"]
sole#8
cons#9
cons#9 -- null#7 [label="1-0"]
null#7
cons#9
cons#11 -- sole#10 [label="0-0"]
sole#10
cons#11
cons#11 -- cons#9 [label="1-2"]
cons#9
cons#11
append#16 -- sole#12 [label="0-0"]
sole#12
append#16
append#16 -- cons#6 [label="1-2"]
cons#6
append#16
cons#17 -- cons#11 [label="0-2"]
cons#11
cons#17
cons#17 -- append#16 [label="1-2"]
append#16
cons#17
cons#17(2) -- cons#17
cons#17
cons#17(2)
cons#17(2) -- cons#17
32 changes: 1 addition & 31 deletions docs/tests/List.inet.six_soles.initial.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,15 @@
cons#2 -- sole#1 [label="0-0"]
sole#1
cons#2
cons#2 -- null#0 [label="1-0"]
null#0
cons#2
cons#4 -- sole#3 [label="0-0"]
sole#3
cons#4
cons#4 -- cons#2 [label="1-2"]
cons#2
cons#4
cons#6 -- sole#5 [label="0-0"]
sole#5
cons#6
cons#6 -- cons#4 [label="1-2"]
cons#4
cons#6
cons#9 -- sole#8 [label="0-0"]
sole#8
cons#9
cons#9 -- null#7 [label="1-0"]
null#7
cons#9
cons#11 -- sole#10 [label="0-0"]
sole#10
cons#11
cons#11 -- cons#9 [label="1-2"]
cons#9
cons#11
cons#13 -- sole#12 [label="0-0"]
sole#12
cons#13
cons#13 -- cons#11 [label="1-2"]
cons#11
cons#13
append#14 -- cons#6 [label="1-2"]
cons#6
append#14
append#14 -- cons#13 [label="0-2" color=red]
cons#13
append#14
append#14(2) -- append#14
append#14
append#14(2)
append#14(2) -- append#14
12 changes: 1 addition & 11 deletions docs/tests/Nat.inet.four.finial.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
add1#9 -- zero#8 [label="0-0"]
zero#8
add1#9
add1#23 -- add1#25 [label="0-1"]
add1#25
add1#23
add1#25 -- add1#27 [label="0-1"]
add1#27
add1#25
add1#27 -- add1#9 [label="0-1"]
add1#9
add1#27
add1#23(1) -- add1#23
add1#23
add1#23(1)
add1#23(1) -- add1#23
24 changes: 1 addition & 23 deletions docs/tests/Nat.inet.four.initial.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
add1#9 -- zero#8 [label="0-0"]
zero#8
add1#9
add1#11 -- zero#10 [label="0-0"]
zero#10
add1#11
add#12 -- add1#9 [label="1-1"]
add1#9
add#12
add1#14 -- zero#13 [label="0-0"]
zero#13
add1#14
add1#16 -- zero#15 [label="0-0"]
zero#15
add1#16
add#17 -- add1#14 [label="1-1"]
add1#14
add#17
add#18 -- add#17 [label="0-2"]
add#17
add#18
add#18 -- add#12 [label="1-2"]
add#12
add#18
add#12 -- add1#11 [label="0-1" color=red]
add1#11
add#12
add#17 -- add1#16 [label="0-1" color=red]
add1#16
add#17
add#18(2) -- add#18
add#18
add#18(2)
add#18(2) -- add#18
8 changes: 1 addition & 7 deletions docs/tests/Nat.inet.two.finial.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
add1#1 -- zero#0 [label="0-0"]
zero#0
add1#1
add1#7 -- add1#1 [label="0-1"]
add1#1
add1#7
add1#7(1) -- add1#7
add1#7
add1#7(1)
add1#7(1) -- add1#7
12 changes: 1 addition & 11 deletions docs/tests/Nat.inet.two.initial.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
add1#1 -- zero#0 [label="0-0"]
zero#0
add1#1
add1#3 -- zero#2 [label="0-0"]
zero#2
add1#3
add#4 -- add1#1 [label="1-1"]
add1#1
add#4
add#4 -- add1#3 [label="0-1" color=red]
add1#3
add#4
add#4(2) -- add#4
add#4
add#4(2)
add#4(2) -- add#4
Loading

0 comments on commit 8e71a65

Please sign in to comment.