Overall Structure of Programs

A program in CAOPLE comprises a set of caste declarations and a set of definition packages.

Program ::= { DefinitionPackage | CasteDeclaration }

Each caste declaration defines a type of agents that can execute and interact with other agents. All agents are equal in the sense that there is no "main" caste/agent in the program.

To enable complicated data passed between agents, data types and constant values can be declared in definition packages and used in the declaration of castes and other definition packages.

Caste declarations and definition packages are compilation units. The object code of a caste declaration can be deployed independent of any caste that it uses and definition packages it imports to a machine that runs a communication engine (CE) of the CAVM virtual machine. Instances of the caste can be created on any machine in the network that runs a logic execution engine (LEE) of the CAVM virtual machine.

There is no need to "build" a "program" because the connections between agents can be established dynamically. Castes can be deployed to a system that is already running and instances of the caste can be added to the system and start to interaction with agents already running in the system.