Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Jul 29, 2023
1 parent 079ca49 commit 05cbd52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

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

# bug

why no active edge in `Nat.inet.four.initial`

# render

`NetRenderer` -- format to simple text representation of graph
Expand Down
28 changes: 14 additions & 14 deletions docs/notes/design-of-new-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ Use `defnode` to define a node.

`--` separates input ports from output ports in the definition.

Use `!` as prefix to mark the principle port.
Use `!` as postfix to mark the principle port.

```inet
defnode zero -- !return: Nat end
defnode zero -- return: Nat! end
defnode add1 prev: Nat -- !return: Nat end
defnode add1 prev: Nat -- return: Nat! end
defnode add !x: Nat y: Nat -- return: Nat end
defnode add x: Nat! y: Nat -- return: Nat end
```

If there is only one output port,
the `return` is the default name,
thus can be omitted.

```inet
defnode zero -- !Nat end
defnode zero -- Nat! end
defnode add1 prev: Nat -- !Nat end
defnode add1 prev: Nat -- Nat! end
defnode add !x: Nat y: Nat -- Nat end
defnode add x: Nat! y: Nat -- Nat end
```

Use `defrule` to define a rule,
Expand Down Expand Up @@ -74,18 +74,18 @@ end
We use a simple type system like Haskell (for now).

```inet
defnode sole -- !Trivial end
defnode sole -- Trivial! end
defnode null -- !List('a) end
defnode null -- List('a)! end
defnode cons
head: List('a)
tail: List('a)
-- !List('a)
-- List('a)!
end
defnode append
left: !List('a)
left: List('a)!
right: List('a)
-- List('a)
end
Expand Down Expand Up @@ -122,17 +122,17 @@ end
defnode diff
left: List('a)
right: List('a)
-- !DiffList('a)
-- DiffList('a)!
end
defnode diff_append
!left: DiffList('a)
left: DiffList('a)!
right: DiffList('a)
-- DiffList('a)
end
defnode diff_open
!DiffList('a)
DiffList('a)!
list: List('a)
-- List('a)
end
Expand Down

0 comments on commit 05cbd52

Please sign in to comment.