Skip to content

Parametric process invocation #13

Description

@lou1306

Right now, the possibility of reusing process definitions is quite limited. A minimal working example follows:

agent Foo {
    interface = x:0

   Behavior = x <- x + 1; Behavior
}

agent Bar {
    interface = y:0

   Behavior = y <- y + 1; Behavior
}

The behavior of Foo is clearly identical to that of Bar, except that it involves a different attribute.

Proposal

Introduce a new syntax for process definitions with formal parameters. Example:

system {
    Incr(attr) = attr <- attr + 1
}
agent Foo {
    interface = x:0

   Behavior = Incr(x); Behavior
}

agent Bar {
    interface = y:0

   Behavior = Incr(y); Behavior
}

Notes

Invocations should involve a check on the variable type (e.g. you cannot pass a stigmergy variable to a process that requires an attribute).

This could be done simply by rewriting, but it would be better to implement actual data structures for parameters/parametric processes. This could also help in reducing the overall size of the encoding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions