Module course.cycles - Demonstration cycles

Demonstration cycles.

This is part of the course library. To use this library:

#INCLUDE "course.module"



demo_cycles.occ:33Process id

PROC id (CHAN INT in?, out!)

Copy input to output.

demo_cycles.occ:44Process succ

PROC succ (CHAN INT in?, out!)

Add one to input numbers.

demo_cycles.occ:55Process plus

PROC plus (CHAN INT in.1?, in.2?, out!)

Add two streams of numbers together.

demo_cycles.occ:68Process delta

PROC delta (CHAN INT in?, out.1!, out.2!)

Duplicate a stream of numbers.

demo_cycles.occ:81Process prefix

PROC prefix (VAL INT n, CHAN INT in?, out!)

Output a fixed number, then copy input to output.

demo_cycles.occ:90Process tail

PROC tail (CHAN INT in?, out!)

Drop the first input number, then copy input to output.