Rapide Tutorial Syntax Summary

RAPIDE LOGO 

  • Architecture

    architecture_declaration ::=
      architecture identifier `(' [ parameter_list ] `)'
          [ return interface_expression ]
          is
          [ module_constituent_list ]
          [ connect { connection } ]
        end [ architecture ] [ identifier ] `;'

    connection ::=
        pattern connector pattern `;'
      | other kinds of pattern connections ...

    connector ::= `to' | `=>' | `||>'

    Interface

    The interface type of a component consists of the set of constituents by which the component communicates with other components. An
    interface type has seven kinds of declarative regions --

        a provides part,
        a requires part,
        an action part,
        a private part,
        a service part,
        a constraint part and
        a behavior part.

    Declarations may be names of types, names of modules or names of functions, and they associate a type with the identifier, but do not give
    an implementation.

    Interface types are declared using the following syntax:

    type_declaration ::=
      type identifier is interface_expression `;'

    interface_type_expression ::=
      interface { interface_constituent }
        [ behavior behavior_declaration ]
      end [ interface ] [ identifier ]

    interface_constituent ::=
        provides { interface_declarative_item }
      | requires { interface_declarative_item }
      | action { action_name_declaration }
      | private { interface_declarative_item }
      | service { service_declarative_item }
      | constraint { pattern_constraint_list}
     

    Actions and Functions

    action_name_declaration ::= 
      action mode identifier
        `(' [ formal_parameter_list ] `)' `;'

    mode ::= in | out

    function_name_declaration ::=
      function identifier
        `(' [ formal_parameter_list ] `)'
        [ return type_expression ] `;'

    For example,

    action in Write(value : Data);
    function Read() return Data;
     

    Services

    service_declaration_item ::=
      basic_name_list `:' [ dual ] interface_type_expression `;'

    Consider,

    type Resource is
      interface service DO : Data_Object_TC(Integer);
    end interface Resource;

    The DO service in the Resource interface denotes all of the actions, functions and nested services (if any) constructed from applying
    Integer to the Data_Object_TC type constructor. To name them, the name ``DO'' is appended with the usual ``.'' notation before
    the name of the constituent. If the service were dual, the same constituents would be denoted except that the modes of the service's
    constituents are reversed; provides (requires) functions become requires (provides) functions, and in (out) actions become out (in)
    actions.

    Procedural Statements

    Reactive statements

    The await statement

    await_stmt :=
        await
            pattern [ '=>' stmt_list
                [ pattern_choices ]
                [ else_part ]
            end [ await ] [  identifier ] ]';'

    pattern_choices :=
        pattern_choice [ or pattern_choice ]

    pattern_choice :=
        pattern '=>' stmt_list

    else_part :=
        else stmt_list

    The when statement

    when_stmt :=
        [ declare declaration_list ]
        when pattern [ declare declaration_list ]
        do
           stmt_list
           [ handler handler_list ]
        end when ';'
     

    General Reactive Rule Form

    rule := [ placeholder_declaration_list ] pattern op body';'

    op := '=>' | '||>'
     

    Module Generator

    module generator :=
        module identifier '(' [ parameter_list ] ')'
                                    [ return  interface_expression ] is
            [ module_declaration_list ]
            [ constraint module_pattern_constraint_list ]
            [ connect module_connection_list ]
            [ initial module_statement_list ]
            [ ( parallel | serial ) process '||' process ]
            [ final module_statement_list ]
         end module ][ identifier ]';'
     

    Constraints

    pattern_constraint := [ label ] ( match | never ) pattern ';'
     

    Maps

    map_generator :=
        map identifier '(' [ formal_parameter_list ] ')'
                                from domain_list to range  is
            {  declaration }
        [ constraint { constraint } ]
        rule { agent_state_transition_rule }
        end [ map ] [ name ] ';'

    agent_state_transition_rule := pattern '||>' { state_assignment } [ poset_generator ] ';'