RRPDG: A Graph Model to Enable AI-Based Production Reconfiguration and Optimization

This article introduces the regionalized resource process dependence graphs (RRPDGs): a manufacturing processes representation inspired by the regionalized value state dependence graphs traditionally used in software compilers. An RRPDG is an ordered sequence of nodes, each characterized by stereotyped input and output parameters, encapsulating a transformation of the process state (e.g., a manufacturing operation). RRPDG allow defining complex transformations by composing a set of nodes (i.e., regions), hiding the internal details. Then, RRPDGs are used to automatically reasoning over dynamic reconfiguration and process optimization: an instance of the A-star search algorithm is used to search for possible transformations while pursuing an optimization function. The rules defined in this article over RRPDG models enforce the transformations' correctness. We use RRPDGs to model a real production system while the transformation rules are applied to optimize the system's processes. The proposed representation reduced the search complexity in each experiment, allowing to reach an optimal solution also in the case for which classical approaches were unable to complete before reaching the timeout. In all the experiments, the cost of the solution produced by using the regionalized representation is minor than the the solution produced by using the classical representation.

Abstract-This article introduces the regionalized resource process dependence graphs (RRPDGs): a manufacturing processes representation inspired by the regionalized value state dependence graphs traditionally used in software compilers.An RRPDG is an ordered sequence of nodes, each characterized by stereotyped input and output parameters, encapsulating a transformation of the process state (e.g., a manufacturing operation).RRPDG allow defining complex transformations by composing a set of nodes (i.e., regions), hiding the internal details.Then, RRPDGs are used to automatically reasoning over dynamic reconfiguration and process optimization: an instance of the Astar search algorithm is used to search for possible transformations while pursuing an optimization function.The rules defined in this article over RRPDG models enforce the transformations' correctness.We use RRPDGs to model a real production system while the transformation rules are applied to optimize the system's processes.The proposed representation reduced the search complexity in each experiment, allowing to reach an optimal solution also in the case for which classical approaches were unable to complete before reaching the timeout.In all the experiments, the cost of the solution produced by using the regionalized representation is minor than the the solution produced by using the classical representation.Index Terms-Modeling, smart manufacturing, process control in manufacturing automation.
Color versions of one or more figures in this article are available at https://doi.org/10.1109/TII.2024.3352645.
Digital Object Identifier 10.1109/TII.2024.3352645 systems stand out to make production processes more flexible and efficient: functionalities are organized in "services" [1], [2] and distributed through manufacturing components and agents.A manufacturing service is a minimal manufacturing operation executed from a specific piece of equipment (e.g., the pick and place operation carried out by a robotic arm).Each service is exposed to other pieces of software (e.g., supervisory control) through a communication infrastructure and a compatible software architecture [3].To specify the production process, a recipe can be represented as an ordered composition of manufacturing services [4].To meet the flexibility of modern market trends, the complexity of the functionality implemented by services is constantly increasing [5], [6].Therefore, a lot of research effort has been spent in the past two decades on developing modeling [7] and system verification [8] approaches.
To support the reconfiguration of modern manufacturing systems, the first condition to meet is a production process modeling strategy: it should provide the ability to represent process dependencies and the input/output constraints.Furthermore, a set of models' manipulation rules is needed to guide the process optimizations (e.g., makespan reduction) while guaranteeing that the same functionality is preserved.
To cope with such requirements, this article proposes regionalized resource process dependence graphs (RRPDGs): a region-based production processes representation inspired by regionalized value state dependence graphs (RVSDGs).The representation exploits the concept of "region," which is the implementation of a sequence of production services (i.e., nodes).Furthermore, regions may be composed of other subregions, to hierarchically structure a complex service.
We define a set of formal rules over RRPDGs to structurally manipulate models of production processes.The defined rules guarantee that a modified production process carries equivalent functionality with respect to the original model.Then, the set of transformation rules and the region-based process representation can be exploited to guide reconfiguration.Fig. 1 summarizes the entire contribution with an example: a production system made of four machines, i.e., M a , M b , M c , and M d , and each machine implements a set of services, i.e., a set of base manufacturing operations.For instance, M a implements the services S 1 and S 2 .The system carries on the production according to the production recipe depicted above, and represented by a RRPDG.Let us suppose M b fails, triggering the reconfiguration of the production as the service S 3 becomes unavailable and thus making the red region in the figure unfeasible.The optimization Fig. 1.Overview of contribution: RRPDGs, along with the proposed transformation rules, support AI-based reconfiguration and optimization of production processes.A manufacturing system composed of four machines M i , each one exposing a set of services S j , must implement the depicted production recipe.Suppose a failure of machine M b : the red region can no longer be executed due to the unavailability of S 3 .The optimization engine exploits the composition rules defined for RRPDGs to generate a set of candidate regions.The A* algorithm is used to search the optimal solution.In this example, the algorithm identifies the green region as the best candidate to replace the red region in the production recipe, thus guiding reconfiguration.engine can exploit the rules defined over the proposed formalism to build new regions functionally equivalent to the red region.Then, the engine relies on the A-star (A*) algorithm to find the best-suited region to replace the original one.In Fig. 1, the green region is chosen to replace the red region triggering the system reconfiguration.
The main contribution of this article is the definition of the RRPDG formalism, and the definition of the formal transformation over the proposed models.We advocate that the proposed formalism is well-suited to support different process reconfiguration and optimization techniques based on a set of wellknown artificial intelligence (AI) techniques, such as informed search and automated reasoning over the composition rules.Furthermore, it is worth noticing that the hierarchical structure of RRPDGs allows to efficiently decompose the reconfiguration problem and reduce the time required to explore the state-space.
We evaluate the proposed representation effectiveness by modeling a case study based on a real manufacturing process.We assess the efficiency of the region-based representation in a search context carried out by an informed search algorithm: we compare the results produced by the search procedure using RRPDGs with a state-of-the-art process modeling approach.The proposed graph model is more efficient in providing nearoptimal reconfiguration solutions.
The rest of this article is organized as follows.Section II introduces the main concepts used in this work.Then, Section III defines the proposed formalism, i.e., the RRPDG, and the main Fig. 2. Production recipes in the context of SOM.The agents composing the system expose a set of manufacturing services (bottom).A recipe, typically specified as a partially ordered set of production tasks (on the left) is interpreted as a partially ordered set of services (on the right) provided by the agents available in the production system.For instance, Task T 2 is implemented by executing the service S 1 provided by the agent M a , and the service S 7 provided by the agent M c ; the Task T 2 is implemented by agent M b executing service S 3 after agent M a has executed the service S 2 .
relations and operations defined over the formalism.Section IV describes a process optimization technique using the RRPDG formalism.Section V presents the case study, as well as the results achieved in our experimental setting.Finally, Section VI concludes this article.

II. PRELIMINARIES
The proposed specification formalism can be used to specify production recipes in any production process.Still, it is specifically tailored for industrial scenarios implementing the service-oriented manufacturing (SOM) paradigm [1], [2].The main idea of SOM is summarized in Fig. 2. The production process is intended as a set of services carried out by the agents operating in the production system.Each agent exposes the set of services that the agent can provide.Borrowing computer engineering concepts, we may say that in SOM the production system is seen as an application programming interface exposing all the functions performed by the agents in the system.An agent providing services may be either a piece of machinery physically executing a manufacturing operation, a piece of the computational infrastructure gathering or providing data, as well as a human-machine interaction device interacting with a human operator who concretely performs the actions necessary to implement the service.Thus, a SOM system may comprehend manufacturing and computation equipment, as well as human operators.

A. Regionalized Value State Dependence Graphs
An RVSDG [9] is an acyclic hierarchical multigraph consisting of nodes.A node represents a computational block that applies a transformation function from its inputs to its outputs.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
There are two main categories of nodes: simple (i.e., representing primitive operations), and structural (i.e., containing internal RVSDGs, called regions).An RVSDG is a structural node itself.Edges model data flow between two nodes, connecting a node's output to another node's input.
A structural node N R is a quadruple (I, O, N, E), where the following relationships hold.
1) I is the set of typed inputs of the region.
2) O is the set of typed outputs of the region.
3) N is the set of internal nodes composing the region.Internal nodes may be either simple or structural.4) E is the set of edges connecting the nodes in N .Each edge e ∈ E is defined as the tuple e = (g, u), where g is the origin node and u is the user node.A simple node can be defined as a structural node whose set of internal nodes is empty.Structural nodes represent complex constructs (e.g., root region, tail-controlled loops, conditional statements, functions, recursive functions, and global variables).RVSDGs define the following structural nodes.It contains a single λ-node within its internal region.6) ω-node is the top-level of an RVSDG.It contains a single region without inputs and outputs.RVSDGs allows creating acyclic hierarchical structures, thus allowing to partition of the analysis into smaller regions that are easier to analyze.

B. State-of-the-Art
An unexpected event stopping a production causes a cascading effect on the other processes, then directly impacting the overall plant efficiency.As such, production processes' optimization, and reconfiguration are increasingly gaining interest in the research community and among manufacturing companies, and so it is the representation of the information necessary to support such features [10].The problem of modeling manufacturing processes while supporting process optimization and reconfiguration has been addressed following two main approaches.The first approach relies on graph-based models, such as resource task networks (RTNs) [11] and state task networks (STNs) [12].RTNs and STNs formalize production recipes as direct graphs specifying the process's parameters and constraints.A STN expresses the sequence of material states associated with tasks, an RTN explicitly specifies the allocation of tasks and resources to physical machines.However, both RTNs and STNs do not support either compositional or hierarchical modeling.Therefore, while they enable reasoning when assuming the expected behavior for the complete production system, they lack support for task-level or finer reasoning [13].
A second kind of approach formalizes the machine's functionalities, often relying on ontologies [14], [15], [16].Most models formalize the machine's atomic functionalities (i.e., services) through a set of capabilities and constraints [17] describing their effects on the environment.Production recipes are defined as the ordered composition of atomic functionalities [10].However, the structure of the recipes is usually fixed, and the reconfiguration is done simply by selecting the machine and tools best suited for a given operation.These approaches do not allow modifying the set or the order of operations to complete the production process.Thus, limiting the set of available optimizations when reconfiguring the system.While these methodologies perform well in their low-level vision of the production processes, they are not suitable for addressing higher-level process optimization due to their fixed structure.This limitation is mitigated in [15] by considering a production process as a multiagent system.However, the proposed approach is limited to "plug and produce" production plants, which are still not the state of the practice in manufacturing.Meanwhile, our contribution aims at also applying to production processes carried out by legacy production systems.

III. MANUFACTURING-ORIENTED REGION-BASED REPRESENTATION
In this section, we propose a representation inspired by RVS-DGs to represent production processes.We first present the terminology that will be used in all the subsequent sections.Then, we use the terminology to introduce the definitions and compare our representation with RVSDGs.

A. Basic Concepts
A manufacturing process P is represented as a tuple (R, S, I, O, N, E), where the following relationships hold.
1) R := M ∪ C is the set of resources used by the production process.A resource r ∈ R may be either nonconsumable, such as the machinery in the production system, or consumable, such as materials and machine tools.M is the set of nonconsumable resources, while C is the set of consumable resources, such that M ∩ C = ∅.

2) S := |M |+|C| i=1
S i is the state-space of the production system.Each resource r k ∈ R is characterized by a statespace S k , while s k,t ∈ S k is the state of the resource r k at time t.s t = [s 1,t , . ..s |R|,t ] is the production system's state at time t, given by the vector of the states of the resources in R. The state of a resource r ∈ R is characterized by a set of attributes.We refer to the attribute i of the resource r as r.i.
3) I ⊆ M ∪ C is the set of the input of the region, i.e., the set of consumable resources (e.g., material to be used) being Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.input to the production process, and the nonconsumable resources being used.4) O ⊆ M ∪ C is the set of the output of the region, i.e., the set of consumable resources created by the production process, and the nonconsumable resources made available by the process.5) N := A ∪ Z is the set of nodes representing the tasks implementing the production process.A task may be either atomic and represented as a simple node, or composed by subservices and represented as a structural node.A is the set of nodes modeling atomic tasks, while Z is the set of the nodes modeling structured tasks, such that A ∩ Z = ∅.A node is recursively defined as a manufacturing process.Given a node n ∈ N , I n is its input set, and O n is its output set; if n is atomic, then N n = ∅ Each node n ∈ N implements a function f n : S → S, which modifies the state S of the production system P .6) E ⊆ N × N is the set of edges connecting the nodes in N , as defined for classic RVSDGs.The first main difference between RVSDGs and our proposed representation RRPDGs resides in atomic nodes.RRPDGs use machine instruction (e.g., arithmetic instruction, bitwise operations, and memory operations) as atomic nodes, whereas RRPDGs uses manufacturing services (e.g., pallet movement), embedding their functionality into atomic nodes.
Fig. 3 exemplifies the proposed representation for production processes.In Fig. 3(a), MovePlt represents a service that moves a resource Pallet:MU from an initial position to the destination position identified by the constant value 4. Furthermore, each node has some internal attributes specifying the physical features of the physical process described by the node, such as the processing time or the energy it consumes.These attributes allow both modeling additional constraints (e.g., maximum time to complete) and node comparison.It is also possible to define costs functions based on these attributes, selecting the best nodes carrying out the functionalities.We refer to the internal attribute i of the node n with n[i].
RVSDGs do not allow modeling race conditions between multiple processes.Still, manufacturing resources could require lock policies on certain resources, to avoid dangerous situations in which multiple production recipes act on the same resource.In our representation, producer and consumer nodes model reserve and release policy on a resource r, introducing the possibility to manage race conditions.A producer node reserves a resource of the production system and produces it within the represented production process.Such nodes have an output with the resource r but do not have an input with the same resource r (r / ∈ I n , and r ∈ O n ).The second atomic node in Fig. 3(a) produces C 1 :Mater as output.A consumer node is the opposite of a producer node: it consumes the resource r and releases it to the production system.Such nodes have an input with the resource r and do not have an output with the same resource (r ∈ I n and r / ∈ O n ).
From the definitions of producer and consumer node, we define the lock on a resource r as follows.
Definition 3.1 (Lock): Given two nodes n 1 and n 2 , respectively, producing and consuming a resource r, the lock L r on r is defined as the tuple L r = (n 1 , n 2 ).
Nodes consuming and producing a resource r model a function transforming the state of the resource s r,t into a new state s r,t .We define the transformation and identity node as follows.
Definition 3.2 (Transformation node): Given a node n, with a set of inputs I n and outputs O n , n is a transformation node for the input resource r if and only if both of the following conditions stand: 1) r ∈ I n , r ∈ O n , and 2) exists an attribute i of r, such that I n,r.i = O n,r.i .Thus, a transformation node modifies an input resource r by producing the same resource r, with at least one of its attributes modified.An identity node consumes and produces a resource r with the same attributes, and it is defined as follows.
Definition 3.3 (Identity node): Given a node n, with a set of inputs I n and outputs O n , n is an identity node for the input resource r if and only if both of the following conditions stand: 2) it does not exist an attribute i of r, s.t.I n,r.i = O n,r.i .
Based on these definitions, we can define a set of properties and transformations that allow to safely manipulate a production process implementation while keeping its results unaltered.

B. Equivalence, Consistency, and Transformations
To ensure that process manipulations preserve the overall result, it is necessary to define an equivalence relation for the proposed representation.Two manufacturing resources can have total or partial overlapping functionalities, meaning that both of these resources can be used within a manufacturing process to obtain the same objective result.For instance, consider two pallets with their sets of admissible destinations partially overlapping with each other.The two pallets can be equally used to reach any destination belonging to the intersection.At the same time, there are some destinations reachable only by one of the two pallets.This definition equivalence better suits manufacturing processes as it defines when two resources can replace each other.The semantic equivalence between two resources is defined as follows.
Definition 3.4 (Semantic Equivalence): Given two resources r 1 and r 2 , respectively, in a state s r 1 ,t and s r 2 ,t of a production system state s t , r 2 is semantically equivalent to r 1 , with respect to a target production system state sf t reachable exploiting the resource r 1 if and only if both the following conditions stand: 1) for each transformation node n 1 that can be applied to r 1 , transforming its state s r 1 ,t in s r 1 ,t and the production system state in s t , it exists a transformation node n 2 that can be applied to r 2 and it transforms its state s r 2 ,t in s r 2 ,t and the production system state in s t ; 2) s t is semantically or strictly equivalent to s t ( s t s t ).Given two resources r 1 and r 2 , we can check whether they are semantically equivalent as follows.Let us assume r 1 is in an initial state s r 1 ,t , and r 2 is in an initial state s r 2 ,t , both included in a production system state s t .Let us consider a sequence of transformation nodes T transforming s t in the objective state sf t .For each transformation node n ∈ T is applied to r 1 and transforming the production system state s t in s t that can be also applied to r 2 transforming s t in s t , we have the following conditions.
1) s t is strictly equivalent to s t or to an intermediate state s t+k (with a distance k from the initial state s t ) in the sequence that transforms s t in sf t .Then, we can state that r 2 is semantic equivalent to r 1 .2) s t is not equivalent to sf t or to an intermediate state s t+k , then we can check s t s t with the objective state sf t .If the search terminates without finding a chain of nodes for r 2 that transforms the production system's state s t in sf t , then r 1 and r 2 are not semantically equivalent.Briefly, a resource is semantically equivalent to another if both resources have a chain of transformation nodes able to transform the initial state s t into the same objective final state sf t .This definition implies that whenever two resources are semantically equivalent, a production system can choose to replace one with the other, to reach the same target state.Therefore, we introduce the following Lemma.
Lemma 3.1 (Resource Replaceability): If a manufacturing process p uses a resource r 1 to reach a production system state sf t from the state s t , and r 1 is semantically equivalent to a resource r 2 , then the process p can replace the resource r 1 with the resource r 2 to reach the same state.
Proof: Suppose that r 1 is semantically equivalent to r 2 with respect to the target state sf t , which can be reached from the current state s t only by exploiting the resource r 1 .This implies that for each node n acting on the resource r 2 and transforming the current state in a state s t such that s t s t .This contradicts our hypothesis that r 1 is semantically equivalent to r 2 , invalidating the conditions of the Definition 3.4.
Resources preemption is also trivial in manufacturing processes.Since preempted resources in an initial state are modified by the external process and return in an unknown state, such a state must be semantically equivalent to the initial one, to enable a well-formed preemption.By exploiting the equivalence definition, we define when a lock is well-formed as follows.
Definition 3.5 (Lock consistency): Given a resource r, a lock L r and two states s r,t and s r,t of r (respectively, before and after L r ), the lock L r is "well-formed" if and only if s r,t s r,t and s r,t s r,t .This means that for each node n that can be applied to r, and modifies its state s r,t , there must be an opposite node n 1 that cancels the side-effect of n.Therefore, a process P lock-consistent with respect to a resource r can safely preempt the resource r from another process, guaranteeing that the resource is returned in a state semantically equivalent to the state, in which the resource has been preempted.The advantage of manufacturing services is that they can be assembled to create more complex services.Moreover, production processes comprise a sequence of services in a specific order that implements the represented functionality.By exploiting the node characterization introduced previously, we define the composition of two nodes as follows.
Definition 3.6 (Node composition): Given two nodes n 1 and n 2 , their composition n 1 • n 2 is defined as the structural node z, such as follows: 1) The composition operation is noncommutative.Therefore, The resulting node z is a complex node, enclosing the functionalities of both nodes.Its inputs are the input of the first node and the input of the second node, which are not produced from the first node.Its outputs are the output of the second node and the output of the first node, which are not consumed by the second node.The internal parameters of the resulting node z are computed differently based on the parameter.For example, consider the internal parameter "time" t: z if the intersection O n 1 ∩ I n 2 is not empty, then the composition produces a new complex node z ∈ Z for each permutation of the association tuples Lemma 3.2 (Composition Equivalence): The execution of a complex node z = n 1 • n 2 in a production system state s t produces a new plant state s t equivalent to the state s t obtained by executing the ordered sequence of the two atomic nodes n 1 and n 2 in s t .
To support nodes replaceability we must define how the nodes of a manufacturing process P can be replaced while preserving the overall functionality of the process.Before introducing replaceability, it is necessary to define compatibility between nodes first.Definition 3.7 (Node Compatibility): Given two nodes n 1 and n 2 , n 2 is compatible with n 1 if and only if I n 2 ⊆ O n p , where n p is a region obtained from the composition of all the nodes preceding n 1 in the topological order.
That is, a node n 2 is compatible with a node n 1 if its inputs are in the output of the environment that contains the node n 1 .The environment of n 1 consists of the composition of all the nodes that are topological predecessors for the replaced node.We define node replaceability as follows.
Definition 3.8 (Node Replaceability): Given two nodes n 1 and n 2 , n 2 can replace n 1 (n 2 ≈ n 1 ) in the state s t if and only if the following conditions hold: 1) n 2 is compatible with n 1 , and 2) n 2 transforms the state s t in a state s t semantically equivalent to the state s t obtained by applying n 1 ( s t s t ).Lemma 3.3: Given a manufacturing process p using the node n 1 to transform the state s t into a state s t and a node n 2 such that n 2 ≈ n 1 , the replacement of the node n 1 with the node n 2 preserves the functionality of the process.
Therefore, to keep the process functionality unaltered, the replacing node must have at least all of its output to be semantically equivalent to the inputs of the replaced node.This guarantees that the subsequent nodes of the original node n 1 can still be applied after the node n 2 .For example, in Fig. 3(b) the lower node can replace the upper one if C 1 :Mater is available in the environment.On the other hand, the upper node cannot replace the lower node.

IV. AI-BASED PROCESS OPTIMIZATION
In the previous section, we have defined the structure of the proposed representation.Real-world production processes are characterized by constraints and requirements that must be satisfied within their entire sequence of services.For example, let us take a pallet and a service that picks the material placed on the pallet.This service should be executed only if the pallet effectively has material on top of it.Therefore, we need to add rules that enable defining when a node n ∈ N can be executed in a particular state s, avoiding transitions toward invalid states.We define a constraint on a node n as follows.
Definition 4.1 (Constraint): Given a node n with a set of inputs I n and a set of outputs O n , a constraint v is defined as a function v : R → {0, 1}, where the following relationships hold.
3) 1 identifies a satisfied constraint.A constraint v is a function that maps the inputs and outputs of a node n into the value 0 or 1.This allows specifying a set of constraints describing when a node can be applied in a certain state.We identify the set of all the constraints of a node n with V n .Using Definition 4.1, we can declare when a node n is able to produce a transition from a state s t to a valid state s t .We define a "safe transition" as follows.
Rule 4.1 (Safe transition): Given a state s t , a node n, and a set of constraints V n associated to n, we say that the node n produces a "safe transition" to the state s t if and only if This rule prevents transitioning toward invalid states, reducing the total number of neighbors in a state s t to the ones satisfying the specified set of constraints V n .Moreover, it reduces the total number of states that must be evaluated to find a certain solution.Thus, from Definition 4.1, we can extend Definition 3.6 previously introduced as follows.
Rule 4.2 (Node v-composition): Given two nodes n 1 and n 2 , each possessing a set of constraints (V n 1 and V n 2 , respectively), their composition n 1 • v n 2 is defined as the complex node z such that 1) z = n 1 • n 2 , and 2) In particular, the new set of constraints V z will have: 1) all the constraints associated to a resource r not shared between n 1 and n 2 (r ∈ O n 1 ∧ r ∈ I n 2 ); 2) the resulting constraints associated to each resource r, shared between n 1 and n 2 and obtained by solving the systems of equations V z,r = {V n 1 ,r = 1 ∧ V n 2 ,r = 1}.This allows expressing each constraint v ∈ V z only on its inputs I z and outputs O z .To represent optimization choices between two nodes and to enable multiobjective search procedures, we extend Definition 3.8, defining the α-replaceability as follows.
Rule 4.3 (Node α-Replaceability): Given two nodes n 1 and n 2 , n 2 can α-replace n 1 (n2 ≈ α n1) with respect to an internal parameter i if and only if the following conditions hold: 1) n1 ≈ n2, and 2) α ≥ n2 [i]  n1 [i] .The scaling factor α specifies a deterioration that is tolerated with respect to an attribute.This enables optimization policies and dynamic reconfiguration under some constraints.As an example, in Fig. 3(b) the lower node is α-replaceable with respect to the upper node and the internal attribute time where α ≥ 1, 4 for the lower bound and α ≥ 1, 5 for the upper bound.By combining the rules above, we define the following theorem.
Theorem 4.1 (Process manipulation): Let us consider a set of nodes N representing the manufacturing services of a production system, and a manufacturing process p defined using a sequence of nodes n i ∈ T such that n i ∈ N .The application of the rules safe transition, v-composition, and α-replaceability transforms the process p into a new process p , which produces a final state sp t semantically equivalent to the final state sp t produced by the process p ( sp t sp t ).
Rules 4.1-4.3,respectively, extend Definitions 4.1, 3.6, and 3.8, restricting their applicability to a smaller subset of the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
items satisfying the extended definitions.As such, they are supported by the same Lemmas 3.1-3.3,on which the definitions are based, guaranteeing the semantic equivalence of the rule's result.

A. Automated Reasoning Over Production Processes
When reasoning over production processes, both the generation and manipulation aim to find the answer for the same question: "which sequences of nodes allow transforming an initial state si t into a final state sf t ?".While the initial state si t is usually known ( si t = s t , where s t identifies a generic state), the final state can be partially defined.This allows defining a set of all the possible final states SF , such that each state sf t ∈ SF is a valid final state.Such a set can be represented through different constraints that identify a valid final state sf t .
Let si t be the initial state and sf t ∈ SF the target final state.Let T = n 1 , . .., n k be the set of tasks that allows moving from the state si t to the state sf t .Let V n be the set of constraints associated to a task n.We want to find the sequence of tasks that allows reaching the final state sf t with the minimum cost.
To find such sequence, we exploit the A* algorithm.The A* algorithm is a well-known method in path planning [18].The classical algorithm uses a cost function F ( s t ) = g( s t ) + h( s t ), in which g( s t ) is a function that returns the cost to reach the state s t from the initial state si t , while h( s t ) is a function that returns the estimated cost to reach the target state sf t from the state s t .This function allows finding and selecting the nodes with the lowest value, guiding the search to the most promising states.The cost (g( s t )) to reach a certain state is given by the sum of the costs of each node n in the sequence of nodes realizing the transition from si t to s t .To compute h( s t ) we estimate the distance from the current state s t to the goal state sf t and return a proportional value based on the current g( s t ).
The algorithm used in this scenario differs from the classical version specifically in how it computes the available neighbors.In our case, the list of neighbors is computed by applying all the tasks t ∈ T that produce a "safe transition" from the current state s t .We note that, in a certain state s t , a task n is able to produce multiple "safe transitions," generated by applying n on all the permutations on the inputs I n in the current state s t that satisfy the constraints V n .To ensure that A* only selects the nodes necessary to reach the goal state for each transition from a state s t to a new state s t , g( s t ) must be lower than g( s t ).If this condition is not satisfied, the algorithm will always choose the transition with a cost of 0 as the next state to evaluate.Therefore, each task t ∈ T must have a cost greater than zero.
The cost of each node is computed on the internal parameters i.This allows defining the objective function that A* minimizes (e.g., execution time).For all the tasks that reserve a resource, we set their cost equal to the cost of the most expensive task, to avoid reserving useless resources.Similarly, the release of a resource must happen only we the resource is no longer necessary.In this case, the cost of a task that releases a resource is proportional to the last time that the resource has been used in another node, decreasing to zero after a certain time.This principle also enables satisfying Definition 3.5, avoiding keeping the reserved resources.
The proposed representation also enables optimizing the solutions found by the algorithm.For example, after a solution has been found, the reserve and release operations can be optimized to avoid keeping unnecessary resources in a busy state.Thus, the edges between the nodes allow specifying dependencies between tasks and also identifying tasks that can be concurrently executed.

V. EVALUATION
To demonstrate the feasibility and the soundness of the proposed representation, we model through RRPDG a case study based on a real manufacturing process.Then, we discuss the results obtained by executing A* on two scenarios with four different heuristics.Finally, we compare the results obtained by using A* with those obtained by using other two search algorithms, i.e., enforced hill climbing (EHC) [19] and single player Monte Carlo tree search (SP-MCTS) [20].

A. Case Study: Bricks Assembly
The case study has been developed in the Industrial Computer Engineering (ICE) laboratory, a research facility equipped with a full-fledged production line. 1 The case study consists of a production process that must assemble three plastic components.As depicted in Fig. 4, two out of three pieces are raw materials retrieved from the warehouse.Such pieces are loaded onto pallets, moved to the assembly station, and composed together to create the first semifinished material C 1 .The third piece (C 2 ) is a semifinished product created with a fused deposition modeling (FDM) 3-D printer.The FDM technology is prone to defects, especially on the surface.Therefore, the material C 2 is processed by a quality control cell: it verifies that the piece meets all the requirements to be identified as the material C 2 , such as dimensions, finishing, and color.Then, the materials C 1 and C 2 are assembled to create the final product C 3 .Finally, C 3 is moved toward the warehouse to be stored.
The interaction between the abstract representation and the physical process can be accomplished by comparing the expected output of the nodes and the actual data coming from the production system.However, in a typical scenario, the system does not guarantee the availability of information related to the state of the physical process.For example, in Fig. 4, QltyCtrl allows determining the material characteristics and checking the physical state with the represented expected state.Moreover, in Fig. 4, if this node returns a different value, the production process is not feasible because the following nodes expect a specific state.For example, suppose that the output of QltyCtrl is a material C 4 .In this case, there are two possibilities: 1) re-execute all the nodes that produced C 2 ; 2) generate a new process that leads to the same result.
In the first case, the solution is straightforward: the material C 4 is removed from the process with a consumer node and the previous nodes that produced C 2 are re-executed.The second   case requires generating a node that allows fixing the unexpected state, transforming C 4 into C 2 (e.g., nodes in Fig. 5).Therefore, the algorithm searches for a node n whose inputs equal the unexpected state, and whose output equals the desired state.This step can be achieved by exploiting the definition of semantic equivalence 3.4.Specifically, it checks that C 4 C 2 , where the objective state is C 2 .Therefore, the initial and objective states of Definition 3.4 are equal.A more expensive alternative consists in generating the portion of the process that has not already been executed.In this case, A* searches for a replaceable node: the procedure searches for a node n with its inputs equal to all the node outputs not already consumed, and its output equals to the process output.
The search for a transformation node n can also be guided by a cost function.For example, in Fig. 5, there are two possible transformation chains that transform the material C 4 into the material C 2 .However, these nodes differ in their internal parameters.For example, the left sequence has a better lower bound but a worse upper bound for the time parameter.Meanwhile, it has better lower and upper bounds for the power consumption parameter.To choose between one of the two implementations, Rule 4.3 for α-replaceability can be exploited, searching between the left and right sequence and choosing the nodes with the desired α parameter.In this case, the outcome is α ≥ 1, 16 for the time lower bound and α ≥ 0, 89 for the time upper bound.Similarly, it outputs α ≥ 1, 15 for the power consumption lower bound and α ≥ 1, 17 for the upper bound.Therefore, the right sequence guarantees a lower maximum time but the other values favor the left one.

B. Experimental Results
The proposed methodology has been numerically evaluated in two instances of the case study described above.Both case studies start from the same initial state.The two instances differ in the number of resources and tasks: the first consists of 18 atomic tasks and 12 complex tasks acting on 16 unique resources, and the second is composed of 24 atomic tasks and 16 complex tasks acting on 20 unique resources.Each complex task has been created by composing pairs of atomic nodes exploiting Rule 4.2.Both instances have been tested on 20 different final states, increasing the length of the sequence of intermediate states to execute (i.e., the complexity).To evaluate the scalability of the proposed approach and the impact of the introduction of complex nodes, the instances have been initially tested with atomic tasks only.In a second round of experiments, complex nodes have been introduced and tested.Furthermore, each final state has been searched with four different heuristics.The first set is composed of "pwXD" and "pwXU," which have been proposed in [21].The second set contains "XDP" and "XUP," proposed in [22].All experiments have been executed on a 3.60 GHz Intel Core i7 with 64 GB of RAM.
Fig. 6 depicts the results of the first case study.Fig. 6(a) compares the total "execution time" necessary to reach a goal state with and without complex nodes.For this test case, a timeout for the execution time was set to 15 s.The introduction of complex nodes allows for reducing the total execution time necessary to find a solution to a third of the initial time.This also allows solving more complex instances.Fig. 6(b) compares the cost of the solution found with respect to the optimal value.It shows that the cost of the solutions found with and without the complex nodes are near-optimal.
The second case study is depicted in Fig. 7.The complexity of this case study increases exponentially with the distance between the initial and the final states.Therefore, in Fig. 7(a), the timeout was increased to 400 s.The results show that with a complexity of 13, the necessary time to find a solution is 300 s without complex nodes, while it reduces to 75 s by exploiting the complex nodes.Thus, with complex nodes, it is possible to solve also instances with a complexity of 20.Moreover, Fig. 7(b) demonstrates that the solutions found with and without the complex nodes are near-optimal.

C. Comparative Analysis
RRPDG is a flexible framework that can be used as a representation formalism by many different optimization algorithms.To demonstrate the versatility and advantages of RRPDGs, we implemented two additional search algorithms: EHC [19] and SP-MCTS [20].The algorithms have been implemented with different use cases in mind, allowing us to analyze the advantages of complex nodes obtained with the rules defined in the previous sections.EHC has been implemented with a greedy heuristic computed as the distance of the current state to the final goal, ignoring the cost needed to reach the current state.This allows finding a solution (without any guarantee of optimality) faster with respect to A*, enabling the application of our proposed representation in environments with strict timing constraints.SP-MCTS selects the best action to execute in the current state based on the win likelihood of the next states computed by randomly exploring it.Choosing one action at a time enables the application of our proposed representation in dynamic environments, in which the computation of a new solution must be called after each action.SP-MCTS has been implemented with the same heuristic of A*.
Table I reports the execution time necessary to find a solution for the first ten instances of the first case study with the three search algorithms.Notice that with "simple" instances, the introduction of complex nodes does not contribute to decreasing the necessary time to find a solution.Meanwhile, by increasing the complexity of the problems, the introduction of complex nodes leads to an improvement of up to two times for A*, three times for EHC, and three times for SP-MCTS.Among the algorithms, EHC is the fastest one (thanks to the greedy heuristic being used), A* placed second, whereas SP-MCTS provided the worst performance.The higher execution time of SP-MCTS depends on the solution's length (i.e., the number of actions in the solution), since the algorithm is called after each action.
Table II depicts the execution time necessary to find a solution for the first ten instances of the second case study.The higher complexity of the problem is reflected in slower execution times.SP-MCTS is unable to find a solution for the last two instances by relying only on atomic nodes.The algorithm reaches a plateau from which it is not able to escape, thus continuously executing the same set of actions in an infinite loop.By introducing complex nodes, we can observe a greater improvement in the execution time up to ten times for A*, three times for EHC, and three times for SP-MCTS.Thus, SP-MCTS is able to solve the last two instances by exploiting the complex nodes that allow escaping from the plateau.
In general, as a strong incentive toward the adoption of the RRPDG formalism to specify production processes, exploiting regions leads to better performance for all the considered algorithms.

VI. CONCLUSION
In this article, we introduced RRPDGs: a formalism with an algebra, useful to specify physical processes and production services.We defined a set of rigorous manipulations, aimed at proposing process transformations while preserving the original functionalities.The RRPDG formalism is meant to support different optimization strategies when reasoning on production systems reconfiguration.In this work, we showed an application of AI state-of-the-art search algorithms, integrating RRPDGs transformation rules to guide the procedure.Experiments showed that by exploiting regions algorithms are able to solve larger instances more efficiently, providing at the same time near-optimal solutions.
In the future, we aim to develop even more refined optimization strategies defined over the proposed formal framework.A possible direction may look toward defining methodologies to generate optimized complex nodes in advance.Thus, moving the search complexity offline and, consequently, speeding up the execution time of the proposed search algorithms.Furthermore, we plan to leverage the formal semantics of RRPDGs to develop monitoring and verification techniques useful for proving process properties at runtime.
RRPDG: A Graph Model to Enable AI-Based Production Reconfiguration and Optimization Sebastiano Gaiardelli , Student Member, IEEE, Michele Lora , Member, IEEE, Stefano Spellini , and Franco Fummi , Member, IEEE

Manuscript received 11
April 2023; revised 27 September 2023; accepted 1 January 2024.Date of publication 25 January 2024; date of current version 4 April 2024.This work was supported in part by the European Union's Horizon 2020 research and innovation program through the Marie Skłodowska-Curie grant under Grant 894237, in part by the European Union Next-GenerationEU (Piano Nazionale di Ripresa e Resilienza (PNRR) "Missione 4 Componente 2, Investimento 1.5" D.D. 1058 23/06/2022) through the PNRR research activities of the consortium iNEST under Grant ECS_00000043, and in part by the PRIN 2022T7YSHJ SMART-IC-Next Generation EU project.Paper no. TII-23-1274.(Corresponding author: Sebastiano Gaiardelli.)

Fig. 3 .
Fig. 3. Example of nodes composing the proposed representation.State transformations are highlighted with bold style.(a) Depicts two atomic nodes modeling machine services; (b) depicts two composed nodes: the Composed node is the composition of the two atomic nodes in (a); the MoveAndPick node is a node providing a functionality equivalent to the Composed node.The reported values have been measured in the research facility, the ICE laboratory, used in Section V to evaluate and validate the proposed approach.(a) Atomic Nodes.(b) Composition of atomic nodes.
otherwise.Now let us take the internal parameter "energy consumption" ec: z[ec] is always equal to n 1 [ec] + n 2 [ec].In Fig. 3(b), the top node is the composition of the two nodes of Fig. 3(a).Note that Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

Fig. 4 .
Fig.4.Schematic representation of the case-study manufacturing process.It consists of different operations to retrieve materials from the warehouse and from a 3-D printer producing a missing piece.Then, the materials are assembled together to produce the final material C 3 .Time and energy data have been collected from the real manufacturing system available in our research facility and further described in Section V.

Fig. 5 .
Fig.5.Two semantic equivalent and replaceable transformation chains that are based on different resources (i.e., milling and drilling).On the left, there is a chain with less energy consumed.On the right, a chain with a smaller time upper bound.

Fig. 6 .
Fig. 6. Results of the first case study.(a) Shows the "execution time" necessary to find a solution.(b) Compares the "cost" of the solution found with the optimal value.

Fig. 7 .
Fig. 7. Results of the second case study.(a) Shows the "execution time" necessary to find a solution.(b) Compares the "cost" of the solution found with the optimal value.

TABLE I COMPARISON
BETWEEN THE EXECUTION TIMES OF A*, EHC, AND SP-MCTS ON THE FIRST TEN INSTANCES OF THE FIRST CASE STUDY II COMPARISON BETWEEN THE EXECUTION TIMES OF A*, EHC, AND SP-MCTS ON THE FIRST TEN INSTANCES OF THE SECOND CASE STUDY