This is the Transportation Example in the CHAIMS language as it could be...
PROGRAM Transport (IMPORT ...)
// The Transportation Program in the CHAIMS language.
// In order to solve the problem: Find the best route for a packet, using ground and air transportation could be solved in the CHAIMS language in the following way:
// setup of all Megamodules
setup ("ioMegamodule");
setup ("RouteinfoMM");
setup ("AirMM");
setup ("GroundMM");
setup ("BestrouteMM");
// call to the Input Megamodule
io= ioMegamodule.invoke (GetCityies,CityPair);
while (io.examine !=DONE) {}
// call to the Routeinfo Megamodule to get the routes
routeinfo= RouteinfoMM.invoke (GetRoutes,CityPair,Routes);
while (routeinfo.examine !=DONE) {};
// call to the Routeindo Megamodule to get all city pairs of a specific lust of routes
routeinfo= RouteinfoMM.invoke (GetCityPairs,Routes,CityPairs);
while (routeinfo.examine !=DONE) {};
// the two Megamodules Air and Ground can work in parallel
// call to the Air Megamodule
air= AirMM.invoke (GetCost,Routes,AirCosts);
ground= GroundMM.invoke (GetCost,Routes,GroundCosts);
while (air.examine !=DONE) {};
while (ground.examine !=DONE) {};
// call to the Bestroute Megamodule
bestroute= BestrouteMM.invoke (GetBestRoute,Routes,AirCosts,GroundCosts,Bestroute);
while (bestroute.examine !=DONE) {};
// call to the Output Megamodule
io= ioMegamodule.invoke (PutBestroute,Bestroute);
while (io.examine !=DONE) {}