<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Petri Nets for the Iterative Development of Interactive Robotic Systems</title></titleStmt>
			<publicationStmt>
				<publisher>AAAI</publisher>
				<date>01/22/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10505257</idno>
					<idno type="doi">10.1609/aaaiss.v2i1.27724</idno>
					<title level='j'>Proceedings of the AAAI Symposium Series</title>
<idno>2994-4317</idno>
<biblScope unit="volume">2</biblScope>
<biblScope unit="issue">1</biblScope>					

					<author>Pragathi Praveena</author><author>Andrew Schoen</author><author>Michael Gleicher</author><author>David Porfirio</author><author>Bilge Mutlu</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[We argue for the use of Petri nets as a modeling language for the iterative development process of interactive robotic systems. Petri nets, particularly Timed Colored Petri nets (TCPNs), have the potential to unify various phases of the development process-design, specification, simulation, validation, implementation, and deployment. We additionally discuss future directions for creating a domain-specific variant of TCPNs tailored specifically for HRI systems development.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Introduction</head><p>Imagine the following coffee shop scenario.</p><p>A robot assists the owner of a coffee shop in daily operations, involving friendly banter with patrons and reorganizing tables to accommodate large groups.</p><p>The robot also works with the pastry chef to arrange cupcakes in the display case. As a large group deliberates over what to order, the robot offers suggestions and manages the group's multiple requests. Developing an interactive system for the coffee shop scenario involves coordinating the robot's spoken dialogue with social gestures, facilitating joint action between the owner and the robot while reorganizing tables, managing access to shared workspaces as the robot and chef arrange cupcakes, and mediating interaction in group settings during the order process. In the field of Human-Robot Interaction (HRI), the development of such complex systems typically draws on the expertise of a diverse array of application developers, including domain experts, designers, programmers, and research professionals, each employing methods, tools, and representations tailored to their specific stage of the development cycle. Additionally, given the iterative nature of systems development, there is often a significant amount of refinement and cross-communication between these phases.</p><p>The representations and tools that application developers utilize for their respective phases of system development-such as low-fidelity prototypes by designers and high-fidelity simulators by algorithm developers-may not be effectively interoperable across different phases. We propose that a unifying representation can facilitate a smoother transition across the various stages of the iterative development process. While representations and tools tailored for individual phases are indispensable, we posit that an accompanying, unified representation can enhance this design process by encoding information that can be used to coordinate between phases. We believe that Petri nets, particularly Timed Colored Petri nets (TCPNs), hold the potential to unify various phases of the development process. In what follows, we describe the benefits of TCPNs in terms of their ability to unify all phases of systems development and aid application developers to iteratively cycle between phases.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Related Work</head><p>Petri nets are a class of state machines that specialize in modeling the flow and dependencies between events and resources in distributed and concurrent systems <ref type="bibr">(Peterson 1977)</ref>. Petri nets are defined as a set of place nodes that hold tokens, transition nodes that indicate actions that move tokens from place to place, and directed arcs between places and transitions that define the logic of where and which tokens are consumed and produced by transitions. Firing a transition, i.e., consuming tokens to execute a transition, depends on the availability of sufficient tokens on incoming arcs from places to each transition. The marking of the Petri net is the arrangement of tokens across places in the net and indicates its current state. High-level Petri nets represent a class of Petri nets with additional features that allow for a more compact representation of dependencies and behaviors while producing a more semantically meaningful graph <ref type="bibr">(Jensen 1983)</ref>. A Colored Petri net is a High-level Petri net that includes data values of different types (colors) in individual tokens, such as integers, strings, or user-defined types, and guard functions that evaluate whether the tokens present in incoming arcs are sufficient for the transition to execute. A Timed Colored Petri net introduces the concept of time, e.g., to indicate the time a token must remain in a place before it can move or the time a transition will take to fire once it is enabled. A full description of the formal specification of TCPNs can be found in Jensen and Kristensen.</p><p>Although Petri nets have had a relatively modest adoption in robotics <ref type="bibr">(Costelha and Lima 2007;</ref><ref type="bibr">Chao and Thomaz 2016;</ref><ref type="bibr">Brooks 2017)</ref>, they have demonstrated utility in wideranging applications that span game design, biological systems, and industrial processes. Game narratives and player interactions mirror the complexities found in robotic systems, and Petri nets have been successfully used to model and analyze game mechanics <ref type="bibr">(Balas et al. 2008;</ref><ref type="bibr">Ara&#250;jo and Roque 2009;</ref><ref type="bibr">Muratet, Carron, and Yessad 2022)</ref>. Variants of Petri nets have been used to model complex biological processes such as viral infection and 2D diffusion <ref type="bibr">(Assaf 2022)</ref>, molecular transport across cell membranes <ref type="bibr">(Liu 2012)</ref>, and metabolic reactions between enzymes and substrates <ref type="bibr">(Baldan et al. 2010)</ref>. Biological processes share many characteristics with industrial and workflow-based processes, where multiple actors may come together to transform components or resources into products. Van der Aalst created a variant of Petri nets called Workflow-Nets (WF-nets), and Petri nets have been used to optimize agent-task allocations and scheduling between humans and robots <ref type="bibr">(Casalino et al. 2019;</ref><ref type="bibr">Cheng, Sun, and Fu 1994;</ref><ref type="bibr">Drakaki and Tzionas 2017)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Value Proposition of the Representation</head><p>We posit that TCPNs hold much untapped potential within HRI. Specifically, TCPNs can yield cumulative benefits by serving as a unifying representation for all phases of systems development. We find it useful to think of systems development in terms of six phases as shown in Figure <ref type="figure">1:</ref> (1) design, (2) specification, (3) simulation, (4) validation, (5) implementation, and (6) deployment. In what follows, we provide details about how TCPNs can enhance each of these phases.</p><p>Design. Design is the conceptualization phase of systems development where user requirements are gathered through observations and participatory design, scenarios are created to envision system interactions, and the system architecture is structured. A high-level plan is established at this stage for how the system will meet user needs and technical considerations, and produces tangible outcomes such as wireframes, user flows, personas, and low-fidelity prototypes.</p><p>A key property that enables Petri nets to enhance the Design phase is their ability to be used at different levels of abstraction. In the early stages of design, Petri nets support high levels of abstraction, e.g., modeling the robot's highlevel dialogue, joint action, and decision-making behavior. This model can then be gradually refined to yield a more detailed and precise description of the system under consideration, ultimately resulting in an executable prototype of the system (see Implementation). The ability for the representation to have various levels of abstraction could make it an appropriate shared language for communication between domain experts, end-users, designers, and programmers. This was demonstrated by <ref type="bibr">(Jensen and Kristensen 2009)</ref> in a case study where a suitably abstracted Petri net-based model was used to engage end-users (hospital nurses) for elicitation, negotiation, and agreement of user requirements.</p><p>Specification. Specification involves defining the requirements, behavior, features, and constraints of the system being developed. Specifications expressed in natural language or in visual formats like flowcharts and activity diagrams are prone to ambiguity. Additionally, other representations (e.g., state machines) suffer from an explosion of state spaces as the complexity of the system increases, resulting in representations that are less comprehensible for human interpretation. In contrast, TCPNs can model the same phenomenon in a much more compact way. Hence, they provide a precise, concise, and human-friendly way to represent system behavior, yielding models that are both mathematically sound and accessible to systems developers through their visual and graphical nature <ref type="bibr">(Jensen and Kristensen 2009)</ref>.    The Petri net representation can be designed to map to semantically meaningful domain properties (e.g., distinct physical areas within a setting, human and robotic agents, and abstract concepts like speaking floor). For instance, physical spaces like tables or the cupcake display case can be depicted as places, and the robot can be represented by a token. The movement of the robot can be specified and visualized as the movement of the token through the Petri net. When the robot token occupies the cupcake display case place, we can semantically infer that the robot is positioned at the display case, potentially assisting the pastry chef. Additionally, Petri nets can facilitate the development of complex systems by enabling users to specify smaller subprocesses, which can then be automatically combined using mathematical properties into a behavior model of a larger and more intricate system. Finally, the formal specification of system behavior using Petri nets is beneficial for the downstream process of Validation of the system through the application of formal techniques.</p><p>Simulation. Simulation involves viewing how a system behaves under different conditions via a simplified representation of real-world phenomena. Any valid Petri net will support simulation, and visual inspection can be enabled in two ways: (1) interactive, where users have the ability to actively engage with the Petri net model to explore hypothetical scenarios by placing tokens or triggering transitions; and</p><p>(2) automated, where system behavior is analyzed without user intervention based solely on the design of the system and possible initial markings. The results of these simulations could prompt the designer to consider alterations to the Specification, Implementation, or prompt Validation. Interactive: By placing tokens in appropriate places within the Petri net, developers can emulate real-world events such as sensor activations and user commands. Due to the visual and graphical nature of the representation, developers can visually track the movement of tokens as they traverse transitions and places. The comprehensibility of the interactive simulation is enhanced when the Petri net elements hold semantic significance (as elaborated in Specification). Automated: Petri nets can facilitate the methodical exploration and discovery of optimal system parameters via the use of automated simulations. This can be particularly valuable for the design of complex systems where there are potentially many choices for possible transitions given a certain marking, and in which naively selecting or handcrafting actions and managing token consumption can lead to suboptimal outcomes. Additionally, in interactive robotics systems, it is important to account for actions from both controlled (e.g., robots and other automated systems) and uncontrolled (e.g., workers, customers, and pets) agents, as these actions collectively impact interaction quality.</p><p>The exploration of these options and the determination of optimal strategies can be accomplished through a combination of simulation and methods like search or reinforcement learning. These methods can be relatively simple, as with <ref type="bibr">(Cheng, Sun, and Fu 1994)</ref>, who used A* search to determine an optimal firing sequence of transitions in a Petri net that modeled manufacturing systems. More recent methods have utilized reinforcement learning and deep learning to derive optimal strategies, i.e., policies, to support a nuanced set of interactions <ref type="bibr">(Drakaki and Tzionas 2017;</ref><ref type="bibr">Hu et al. 2020)</ref>.</p><p>The focus of our work is on high-level control or behavior modeling, thereby reducing the need for many off-the-shelf robotics simulators that instead focus on realistic physics, robot control, and computer vision (e.g., NVIDIA's Omniverse <ref type="bibr">(Mittal et al. 2023)</ref> or Habitat <ref type="bibr">(Manolis Savva et al. 2019;</ref><ref type="bibr">Szot et al. 2021)</ref>). Only the features specified as tokens and the structure of the Petri net need to be encoded, reducing the state vector size. Furthermore, the action space is generally more constrained given specific markings, so methods such as action masking can be used to improve learning in these action spaces <ref type="bibr">(Huang and Onta&#241;&#243;n 2020)</ref>. As such policies can be trained prior to deployment, they require minimal computational power to execute in real-time. However, this does not preclude online learning if the developer wants to support in-situ adaptation.</p><p>Validation. Validation involves assessing whether the system is built correctly according to its design and performs its intended functions accurately and reliably. HRI systems can benefit from both formal and experimental validation techniques. Formal techniques can be used to prove whether programs adhere to specific properties <ref type="bibr">(Wing 1990</ref>), such as ensuring a robot never greets the same human twice <ref type="bibr">(Porfirio et al. 2018)</ref>. On the other hand, experimental techniques are useful for validation of user behavior and ergonomic properties (Ait-Ameur and Baron 2006), such as ensuring that an individual is able to effectively communicate with the robot in the presence of ambient noise. Petri nets are formal models that can be shared between formal and experimental validation, and bridge the gap between these techniques. Here we elaborate on formal validation and discuss experimental validation under Deployment.</p><p>It is often useful to verify the temporal or probabilis-tic behavior of complex systems. For example, developers may need to ensure that the duration of a specific task probabilistically falls within a certain time bound if performed collaboratively with a robot. This and similar phenomena can be captured within verifiable logic, such as Signal Temporal Logic <ref type="bibr">(Donz&#233; and Maler 2010), e.g., P = ? F [10,20]</ref> [success], or in plain English, what is the probability that the task will take between 10 and 20 seconds? While expressing such properties is straightforward, their verification is challenging. Example prior work in robotics involves sampling simulated trajectories through methods such as Monte Carlo <ref type="bibr">(Scher, Sadraddini, and Kress-Gazit 2023)</ref>. Combined with high-fidelity off-the-shelf simulators (e.g., RoboSuite, <ref type="bibr">Zhu et al. 2020</ref>), such techniques have been shown to be successful, though they are restrictive to a small set of domains and are expensive due to the large number of samples required and simulator performance limitations.</p><p>The concise and semantically meaningful properties of Petri nets are also well-suited for validation. Sampling a single trajectory in a Petri net is much less computationally intensive than if done in simulators with high realism, e.g., those with photorealism and physics engines. Although this higher level of abstraction in modeling by the Petri net as compared to high-fidelity simulation may constrain users to verifying coarse approximations of phenomena, we hypothesize that it facilitates system modeling at a level of abstraction that requires less effort compared to equivalent representations (e.g., probabilistic timed automata).</p><p>Implementation. The Design, Specification, Simulation, and Validation stages of the systems development process produce a precise, concise, and human-friendly model in the form of a Petri net, which can be integrated into the system's implementation. This integration eliminates any loss of information or unintended alterations that might occur during translations between different representations at various phases. As a result, the specified behaviors and interactions captured within the Petri net model can be faithfully translated into the program's execution. If, at any point, the designer realizes changes need to be made to the implementation, since the model is still represented as a Petri net, this can seamlessly be introduced into the previous Specification, Simulation, and Validation steps.</p><p>Existing Petri net libraries can facilitate the implementation of Petri net models. For instance, the SNAKES library <ref type="bibr">(Pommereau 2015)</ref> supports a wide range of Petri net models and allows the use of Python objects as tokens and Python expressions for transition guards or arc conditions. If a developer uses SNAKES for Design, Specification, Simulation, and Validation, the same SNAKES models can then be used as the skeleton upon which the full implementation can be built. For example, transitions within Petri nets, which often signify system actions, can instigate system behaviors (such as motion planning or image processing) when they are fired. Further, sensor activations and user commands can introduce tokens into the Petri net. Utilizing a Petri net-based representation for modeling system behavior allows the separation of high-level logic from low-level processes (e.g., sensing and motion planning).</p><p>Deployment. Petri nets can be beneficial to monitor and visualize the real-time execution of finished systems. This can prove challenging with alternative representationsstate machines tend to be large and difficult to visualize, while block-based representations lack an explicit portrayal of movement, progression, or transfer of system entities (e.g., tracking the location of a cupcake or monitoring occupancy of a physical space). The compact and graphical nature of Petri nets provides a clear depiction of the system flow, especially with the use of tokens to model dynamic behaviors and allow for tracing an entity through the system.</p><p>Petri nets are ideal for run-time analysis and experimental validation during deployment because they model complex interactions, capture dynamic behaviors, and provide a visual presentation of system behavior. Complex systems are characterized by many free interactions, leading to elaborate interaction traces that are challenging for analysis and interpretation by people. <ref type="bibr">(Muratet, Yessad, and Carron 2016)</ref> use a Petri net representation to algorithmically analyze and label player behaviors during a game. However, even for the manual generation of labels, qualitative coding of Petri net traces could serve as a complement to, or even a potential substitute for, video coding. Moreover, Petri net elements could be time-stamped or tagged with data for dynamic behavior (e.g., when transitions are fired) to facilitate downstream analysis such as understanding response times, waiting times, and throughput. This approach could enable a more direct translation of empirical insights from deployment into tangible improvements in the design, specification, or implementation of system behavior. We emphasize that the efficacy of this approach hinges on the model effectively capturing all aspects that the developer seeks to analyze. This is achievable using Petri nets because of the representation's versatility in expressing a variety of concepts, including user-activity model, task model, and context model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Case Study: Arranging Cupcakes</head><p>Returning to the coffee shop scenario in which the robot assists the pastry chef in arranging cupcakes, we present three processes and observe how they can be modeled through a Petri net-based representation (see Figure <ref type="figure">2</ref>).</p><p>Cupcakes transfer: Both the chef and the robot can transfer cupcakes from a tray to a display case. We model this by two places: Tray Space and Case Space . Both the human and the robot start outside this Petri net module and are represented by tokens of distinct color values but the same Agent color type. An agent transitions into the module from an external one and occupies the tray to collect a cupcake token . Then, both the agent and the cupcake would transfer to the case , resulting in a cupcake displacing an empty spot in the case .</p><p>Single-occupancy enforcement: To ensure safety, we add a Resource Place , which contains tokens indicating the occupancy of the tray or case. An agent can occupy a space if the agent possesses the requisite resource token for either the tray or the case . This design enforces the robot to follow the single-occupancy rule. However, if the human accesses the space while the robot is already present , the model assigns an error token to the human, which can then  be utilized by subsequent processes to either stop the robot or withdraw it from the space. This approach allows us to model the way humans might violate expectations within the same representation used to specify robot behavior, thereby enabling simulation or validation of such behaviors.</p><p>Double-occupancy for handovers: To model handovers, where one agent delivers a cupcake to another, who then transports it to the tray, a place called Handover Space is introduced. One agent arrives with a cupcake token, another without a cupcake token, and both agents would have to be in possession of the handover resource tokens to enable cupcake handover . Upon exiting the transition, the agent, initially without a cupcake token, now possesses one.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Discussion</head><p>Based on the value proposition that we discuss above, we argue that Petri nets could be an indispensable tool for iterative systems development. However, we believe that there is a need for an extended, domain-specific TCPN that is tailored for HRI systems development. An extended representation might enforce, for instance, that physical locations in the robot's environment are represented as places, or that tokens are drawn from a predefined set of colors that represent the robot, the human, or the availability of physical space (see the Case Study above). Thus, our domain-specific instantiation will inherit from TCPNs, contain semantic significance to HRI systems, and be accessible to developers lacking experience with Petri nets. Given an extended TCPN representation, we also advocate the need for an end-user development tool that selectively exposes aspects of the underlying representation to developers in an intuitive, graphical way.</p><p>Our future work will involve creating a new representation specifically tailored to HRI that extends TCPNs and evaluating its effectiveness in terms of developer accessibility. We believe that Petri nets can enable the development of more complex and nuanced human-robot interactions.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_0"><p> </p></note>
		</body>
		</text>
</TEI>
