https://github.com/nickng/asyncpi
An implementation of asynchronous π-calculus in Go
https://github.com/nickng/asyncpi
pi-calculus research
Last synced: 2 months ago
JSON representation
An implementation of asynchronous π-calculus in Go
- Host: GitHub
- URL: https://github.com/nickng/asyncpi
- Owner: nickng
- License: apache-2.0
- Created: 2016-09-16T13:33:23.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-09-15T23:40:04.000Z (almost 4 years ago)
- Last Synced: 2025-03-21T06:51:24.409Z (3 months ago)
- Topics: pi-calculus, research
- Language: Go
- Size: 804 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asyncpi  [](https://pkg.go.dev/go.nickng.io/asyncpi)
## An implementation of asynchronous π-calculus in Go.
The basic syntax accept is given below, for details (including syntactic sugar),
see [docs](http://pkg.go.dev/github.com/nickng/asyncpi).P,Q ::= 0 nil process
| P|Q parallel composition of P and Q
| (new a)P generation of a with scope P
| !P replication of P, i.e. infinite parallel composition P|P|P...
| u output of v on channel u
| u(x).P input of distinct variables x on u, with continuation P## Install
go get -u go.nickng.io/asyncpi
## Play
`cmd/asyncpi` is a simple REPL front end for the package, with very
basic support for *parsing*,
*free name calculation*, *process reduction* and *code fragment generation*.### Build and install
go install go.nickng.io/asyncpi/cmd/asyncpi
### Run
$ asyncpi
async-π> parse
.......> a | a(x,y,z).x().0 | b<> | c(z).0 | (new c)c
((((a | a(x,y,z).x().0) | b<>) | c(z).0) | (new c)c)
async-π> reduce
Reducing: ((((a | a(x,y,z).x().0) | b<>) | c(z).0) | (new c)c)
(((b().0 | b<>) | c(z).0) | (new c)c)
async-π> reduce
Reducing: (((b().0 | b<>) | c(z).0) | (new c)c)
(c(z).0 | (new c)c)
async-π> reduce
Reducing: (c(z).0 | (new c)c)
(c(z).0 | (new c)c)
async-π> codegen
/* start generated code */go func() { z := <-c /* end */ }()
c := make(chan interface{})
c <- d/* end generated code */
async-π> exit## License
asyncpi is licensed under the [Apache License](http://www.apache.org/licenses/LICENSE-2.0)