---------------------------------------------------------- ---------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . P N . N U T I L S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2006-2007, GET-Telecom Paris. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. Ocarina is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Ocarina; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth -- -- Floor, Boston, MA 02111-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Ocarina is maintained by the Ocarina team -- -- (ocarina-users@listes.enst.fr) -- -- -- ------------------------------------------------------------------------------ with Types; with Ocarina.PN.Nodes; package Ocarina.PN.Nutils is package OPN renames Ocarina.PN.Nodes; function New_Node (Kind : OPN.Node_Kind) return Types.Node_Id; -- Create a new node function New_List (Kind : OPN.Node_Kind) return Types.List_Id; -- Create a new list function Is_Empty (L : Types.List_Id) return Boolean; -- Return true if the list is empty, else return false procedure Append_Node_To_List (E : Types.Node_Id; L : Types.List_Id); -- Append the node to the list function Make_Container return Types.Node_Id; -- Create a new container -- function Make_Fonctionnal_Entity -- return Node_Id; -- -- Create a new fonctionnal entity function Make_Identifier (Pn_Entity : Types.Node_Id; Ident_Name : Types.Name_Id) return Types.Node_Id; -- Create a new identifier -- function Map_Scoped_Name -- (Gaia_Scoped, Corresponding : Node_Id) -- return Node_Id; -- -- Copy the Gaia Tree Scoped Name into the PN Tree -- function Make_Colored_Token -- (Color : Node_Id; Number : Value_Id := Ocarina.AADL_Values.V_One) -- return Node_Id; -- -- Create a colored token value for Arcs. Parameters are the color -- -- and the number of tookens needed. -- procedure Add_Domain_To_Node -- (D, N : Node_Id; Number : Value_Id := Ocarina.AADL_Values.V_One); -- -- Add a domain in Node's domain list if it's not already present. -- -- Can be used with either Connection_Statement and others --petriscript -- -- objects. -- procedure Add_Token_Value_To_Arc -- (A : Node_Id; V : Value_Id; C : Node_Id); -- -- Set a Token value in Node's domain list. function Make_Color_Variable (Name : Types.Value_Id) return Types.Node_Id; -- Create a color declaration function Make_Marking (Token : Types.Node_Id; Is_Tuple : Boolean := True) return Types.Node_Id; procedure Add_Token_To_Marking (Marking, Token : Types.Node_Id); -- function Make_Transition_Declaration -- (Suffix : Name_Id; Parent : Node_Id) -- return Node_Id; -- -- Create a transition -- -- Useful when building transitions that are not bijective -- -- with a Gaia node -- function Translate_Position (P : Node_Id) return Node_Location; -- -- Translate a transtion into a Node_Location. -- procedure Make_Position (N : in out Node_Id; P : Node_Location); -- -- Associate a PN Node with a position -- function Make_Embedded_Node (N : Node_Id) return Node_Id; -- -- Return a node which contains the N node -- procedure Append_Node_To_Fifo (N, F : Node_Id); -- -- Add the N node to Fifo node list, using an embedded node. -- procedure Make_Port_Location (P : Node_Id; L : Node_Location); -- -- Set L location for the port in the fifo -- procedure Add_Token_To_Place (P : Node_Id; V : Value_Id; C : --Node_Id); -- -- Create a token with Value V of color C and append it -- -- to P's Tokens list function Make_Unequal_Guard (Var, Cst : Types.Value_Id) return Types.Node_Id; -- Create a guard that tests if Var <> Cst function Make_Equal_Guard (Var, Cst : Types.Value_Id) return Types.Node_Id; -- Create a guard that tests if Var = Cst function Make_Place_Declaration (Place_Name : Types.Name_Id; Color_Class : Types.Node_Id; Initial_Marking : Types.Node_Id := Types.No_Node) return Types.Node_Id; -- Create a place declaration function Make_Transition_Declaration (Transition_Name : Types.Name_Id) return Types.Node_Id; -- Create a transition declaration function Make_Connection (Srce, Dest : Types.Node_Id; Marking : Types.Node_Id) return Types.Node_Id; -- Create a connection between the source and destination -- ports/parameters, passed as pn nodes. function Make_PN_Connection (PN_Root, Virtual_Connection : Types.Node_Id) return Types.Node_Id; -- Create a subnet corresponding to a virtual connection from the -- AADL instance tree function Aggregate_Virtual_Connection (PN_Root, Virtual_Connection, PN_Connection : Types.Node_Id) return Boolean; -- Add Virtual_Connection into PN_connection -- function Make_Place_Fusion -- (Node_1, Node_2, New_Name : Node_Id) -- return Node_Id; -- -- Create a new place fusion declaration between node_1 and node_2, -- -- namming it "new_name" (a scoped name) -- function Make_Symbolic_Value (N : Value_Id) return Node_Id; -- -- Create a new special value -- function Make_Include_Call -- (Gaia_Instance, Gaia_Subprogram_Call : Node_Id) return Node_Id; -- -- create a new include call -- function Make_Include_Call -- (Prefix : String; Gaia_Call : Node_Id) return Node_Id; -- -- create a new include call with constant namespace "UD" end Ocarina.PN.Nutils;