MODULE mainproc; FROM myproc IMPORT twoplus; (*--------------------------------------------------------- File name: mainproc.pm Author: AG Date: 5/31/05 Problem: This program attempts to make use of the definition and implementation modules for defining procedures. myproc.pd and myproc.pm must exist and be correct. Example of Execution: ... Cycles: 1 assignment + 1 multiplication + 1 addition *) (*---------------------------------------------------------- CONFIGURATION ----------------------------------------------------------*) CONST MAXCELLS=1024; (* MAXCELLS cells in one line *) CONFIGURATION chain[0..(MAXCELLS - 1)]; CONNECTION left: chain [i] -> chain[(i-1) MOD MAXCELLS]; right: chain[i] -> chain[(i+1) MOD MAXCELLS]; (*---------------------------------------------------------- VARIABLES ----------------------------------------------------------*) VAR K: INTEGER; (*---------------------------------------------------------- MAIN ----------------------------------------------------------*) BEGIN K:=1; twoplus(K); (*printing*) WriteInt(K, 2); END mainproc.