{'fraction_non_alphanumeric': 0.04008229284903519, 'fraction_numerical': 0.007839103291713962, 'mean_word_length': 4.211275415896488, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Abstractions for computing all robotic sensors that suffice to solve a planning problem

Whether a robot can perform some specific task depends on several aspects, including the robot's sensors and the plans it possesses. We are interested in search algorithms that treat plans and sensor designs jointly, yielding solutions---i.e., plan and sensor characterization pairs---if and only if they exist. Such algorithms can help roboticists explore the space of sensors to aid in making design trade-offs. Generalizing prior work where sensors are modeled abstractly as sensor maps on p-graphs, the present paper increases the potential sensors which can be sought significantly. But doing so enlarges a problem currently on the outer limits of being considered tractable. Toward taming this complexity, two contributions are made: (1) we show how to represent the search space for this more general problem and describe data structures that enable whole sets of sensors to be summarized via a single special representative; (2) we give a means by which other structure (either task domain knowledge, sensor technology or fabrication constraints) can be incorporated to reduce the sets to be enumerated. These lead to algorithms that we have implemented and which suffice to solve particular problem instances, albeit only of small scale. Nevertheless, the algorithm aids in helping understand what attributes sensors must possess and what information they must provide in order to ensure a robot can achieve its goals despite non-determinism.

I. INTRODUCTION We currently approach robot sensors from the perspective of consumers, purchasing whatever seems necessary from a catalogue, then writing program code to make robots useful. This perspective puts practical constraints up front: it is influenced by technologies that are currently available, it limits options to what can be fabricated cheaply and sold profitably. Worse, it relies on roboticists to reason (often only heuristically) about the information needed for a robot to achieve its goals. If there is some notion of task structure, reasoning about it is seldom formalized, and may be tied to assumptions often taken for granted (e.g., for fixed price, greater sensor precision is better). This paper approaches the question of sensors from a more fundamental perspectiveasking how we might represent and explore conceivable sensors. It is, therefore, of a more theoretical nature.
Which sensors are necessary depends on what your robot wants to do. We study robots that act to attain goals while managing uncertainty, formulating these precisely as planning problems, under worst-case non-determinism. Unlike many papers entirely focused on finding plans, this paper examines ways in which sensors affect whether a planning Yulin Zhang and Dylan A. Shell are with the Dept. of Computer Science, Texas A&M University, College Station, TX, USA.
This work was supported by the NSF through awards IIS-1453652 and IIS-1527436. Fig. 1: A wheeled robot (as a blue disk) needs a charging station (the lightning bolts), but is slightly lost (the uncertainty in its initial pose is shown visually, as three possibilities). Unable to navigate stairs, it must avoid those locations lest it topple down a stairwell. The robot is able to recharge its battery despite the presence of uncertainty, with the help of either a camera, a simple linear distance sensor, or a short-range scanning lidar. (If bumping into walls is permitted, a sensorless plan is possible as well.) problem can be solved. The perspective is that sensor choices alter the set of feasible plans, and we look at sensor/plan pairs jointly. We examine the space of sensors that are useful with respect to a specific given problem. These sensors, indeed especially those that provide little information, can be enlightening. Still, we do require they provide information to make progress toward goals [1], even in the presence of uncertainty. We are interested in exploring all sensors, including even hypothetical ones, for which there exists some goal-achieving plan. Fig. 1 shows a simple didactic scenario illustrating multiple aspects of the problem: a robot, uncertain about its initial position and incapable of navigating stairs, needs to reach a charging station. We give four exemplar sensors that, under different plans, ensure goal attainment: (i) a camera to distinguish red and gray helps to eliminate uncertainty in the initial pose when following the top plan; (ii) a robot with a distance sensor can disambiguate initial position 2 from {1, 3}, since it observes that it is near the wall after two forward moves only when it starts at 2, while observing medium or far from the wall for {1, 3}; (iii) with a lidar sensor the robot can distinguish 3 from {1, 2} since, after three forward moves from 3, it senses a different polygon from those of 2 and 3.
(iv) the vacuous sensor also suffices, albeit only under the assumption of benign collisions, and with many steps.
The sensors do not all quash the uncertainty completely, but they eliminate enough to reach the goal under different plans. For example, the robot with a distance sensor never resolves whether it came from 1 or 3 in executing the corresponding plan. The robot with a lidar sensor does not distinguish 1 from 2. But, in both cases, the robot reaches a charger. There are also important differences in the sensors' fidelity. The camera divides all the locations into three equivalent classes: a red location, a gray one, and the white ones. In contrast, the distance sensor's specification tells us that middle range distance readings are noisy, failing to separate medium and far distances from the wall crisply (when the robot observes 'med', then it is either at a medium or a far range from the wall; when obtaining 'near', it is close to the wall).
Sensors can be modeled as the information they provide for the plan. While previous works [2,3,4] regard sensors as partitions over all events to be perceived, this paper is more general, considering sensors as covers. Doing so requires some care, including new representations and means to lessen the combinatorial explosion that a naïve treatment entails.

II. MODEL
We study a setting depicted in Fig. 2. The robot is equipped with a sensor, through which it receives observations from the world. Actions are chosen to alter states according to the robot's plan to, ultimately, reach some goal states in the world. The sensor may have limited fidelity and fail to distinguish different observations from the world. The uncertainty in sensing is modeled via a type of function, termed a sensor map. These elements are formalized in terms of p-graphs and sensor maps that we outline below.

A. A p-graph and its interaction language
We start by defining p-graphs and related properties. For more complete formal definitions, please see [5].
Definition 1 (p-graph [5]). A p-graph is an edge-labeled directed bipartite graph G = (Vy ∪ Vu, E, Y, U, V0), where 1) the finite vertex set V (G), whose elements are also called states, form two disjoint subsets: the observation vertices V y and the action vertices V u , with V (G) = V y ∪ V u ; 2) each edge e ∈ E originating at an observation vertex bears a set of observations Y (e) ⊆ Y , containing observation labels, and leads to an action vertex; 3) each edge e ∈ E originating at an action vertex bears a set of actions U (e) ⊆ U , containing action labels, and leads to an observation vertex; and 4) a non-empty set of states V 0 (G) are designated as initial states, which may be either action states (V 0 (G) ⊆ V u ) or observation states (V 0 (G) ⊆ V y ), exclusively.
We use the word 'event' to mean either an action or an observation. Here, Y is assumed to be finite. A sequence of alternating actions and observations, also called an execution, can be traced in the p-graph, if there exists a path, starting from some initial state, with the same number of edges and each edge in the path bears the corresponding event. A pgraph G describes a set of such event sequences.
One p-graph is used to model the world, another the robot. Both p-graphs are coupled, resulting in a planning problem. Sensors influence this coupling relationship by influencing the distinguishability of observations made by the robot. Conflations and corruptions of events are treated next.

B. Sensor maps
Definition 2 (observation/sensor maps [6]). A sensor map on p-graph G is a function h : Y → P(X) \ {∅} mapping from an observation in Y to a non-empty set of observations X, where P(X) is the powerset of X.
If h maps y 1 to {x 1 , x 2 , x 3 , x 4 } then, when event y 1 happens in the world, the robot may receive any of those four values as a sensor reading; further, we assume the choice happens non-deterministically.
Given any subset of sensor readings X ⊆ X as input to (that is, observed or perceived by) the robot, the associated observations within the world W are related via the preimages of X under h, denoted by h −1 (X ) := { ∈ Y (W ) | h( ) ∩ X = ∅}. Below, the notation for a sensor map h and its preimage h −1 is extended in the usual manner to p-graphs by applying the function to labels on each observation edge, i.e., in the obvious way.

C. Planning problems and plans
Definition 3 (planning problem and plan). A planning problem is a p-graph W along with a goal region V goal ⊆ V (W ); a plan is a p-graph P equipped with a termination region V term ⊆ V (P ).
Definition 4 (solves under sensor map). A plan (P, V term ) solves a planning problem (W, V goal ) under sensor map h if there is some integer which bounds the length of all jointexecutions of W and h −1 P , and for each joint-execution and any pair of nodes (v ∈ V (h −1 P ), w ∈ V (W )) reached by that execution simultaneously, the following holds: 1) if v and w are both action nodes and, for every label borne by each edge originating at v, there exist edges originating at w bearing the same action label; 2) if v and w are both observation nodes and, for every label borne by each edge originating at w, there exist edges originating at v bearing the same observation label; 3) if v ∈ V term and then w ∈ V goal ; 4) if v / ∈ V term then some extended joint-execution exists, continuing from v and w, reaching the termination region.
Property 1) and 2) define a notion of safety; 3) of correctness; 4) of liveness. Note that the sensor map, modeling robot's sensor in this paper, may affect the solvability of the planning problem. In other words, we have to examine the safety when searching for sensor maps.

D. Sensor design in a planning problem
Now we can define the central problem of the paper: Problem: Joint-Plan-Sensor-Design (JPSD) Input: A planning problem (W, V goal ) Output: All the sensor maps H, such that there exists a plan (P, V term ) to solve the planning problem (W, V goal ) under each sensor map h ∈ H.

III. COMPUTATIONAL ABSTRACTIONS FOR SENSOR MAPS
Sensor maps map observations to their images, while the planning problem is defined in the preimage space. To solve this problem, we will begin by considering an alternate form in the preimage space for the sensor maps.

A. Equivalent representation for sensor maps
Any sensor map has an equivalent cover representation.
Theorem 1. For planning problem (W, V goal ), any sensor map h is equivalent to a cover up to plan solvability.
Proof. ⇒: Given any sensor map h, to see whether a plan is a solution (cf. Def. 4), we must determine the preimage Collect all the data associated with h, on the X, via where X = {x 1 , x 2 , . . . , x n }. This is a multiset. But now observe that where for any x i and x j we have h −1 (x i ) = h −1 (x j ), we can construct a new sensor map by replacing x i and x j with a new symbol x . This new sensor map is also a solution if and only if h is a solution for JPSD. Under this new sensor map, no two readings in the sensor map share the same preimage, and h −1 can be thus represented as set The set above is called a cover for set Y (W ). Henceforth, we call the cover for sensor map h an observation cover, ⇐: Having just showed that there exists a cover interpretation for any sensor map h, we now construct a sensor map for any observation cover. Suppose cover {S 1 , S 2 , . . . , S k } ⊆ P(Y (W )) for set Y (W ) is given. Taking the first k natural numbers for X, consider a label map h defined so that y Together, the cover C h is an equivalent representation for any sensor map h, up to plan solvability.

B. Operations on observation covers
Next, we give two operations on covers (projection and intersection) that are useful for sensor maps.
The sensor map is a cover for all observations in the planning problem. Only some small number of observations may be applicable while at particular world states. We are interested in how the observations in such a reduced set conflate with each other. This is realized via an operation that reduces the domain: We call sensor map π D (C) with reduced domain d(C) ∩ D a partial sensor map. The word 'partial' is apt as the sensor map need not cover every observation in the planning problem.
On the other hand, we are also interested in finding all sensor maps with certain behavior on their restrictions. Specifically, we desire to find all label maps which, when given two partial label maps, agree with those label maps on their projections. This comes from an intersection between two partial sensor maps.
Definition 6 (cover intersection). For any two partial sensor maps, expressed as cover C 1 and C 2 , with the union of their domains D = d(C 1 )∪d(C 2 ), then let D be all covers 1 whose domain is D. Then the intersection of C 1 and C 2 , denoted C 1 C 2 , is defined so that ∀C ∈ D, we have C ∈ C 1 C 2 , if and only if Note that is associative and that C 1 ∅ = ∅ for any cover C 1 . When no cover that satisfies (a) and (b) above, then C 1 C 2 = ∅. We say that C 1 is compatible with C 2 if C 1 C 2 = ∅. We will also lift this notation to the intersection of lists of covers. In writing L 1 L 2 for two lists of covers L 1 and L 2 , we mean L 1 L 2 = ∪ C1∈L1,C2∈L2 C 1 C 2 .

IV. JOINTLY SEARCHING FOR SENSOR DESIGNS & PLANS
First, we construct a robot's belief tree and then give approaches to search for all sensor designs and plans in it.

A. The belief tree under different sensor maps and actions
The robot's plan must manage uncertainties owing to initial ignorance, action non-determinism, and sensor imperfection. The robot's belief expresses this uncertainty, which we represent as a set of states. Without this, the robot may violate plan safety by trying to execute some action that is not possible in its actual state. The dynamics of the belief will be captured by a finite tree structure, where each vertex lists a set of world states, the robots' belief. Plans need only visit each belief vertex at most once. Let A(w) be the set of outgoing events for vertex w ∈ V (W ). Then the belief tree, a sketch of which appears in Fig. 3, can be constructed as follows: Initialization: An initial vertex W 0 of the same vertex type is created for the set of initial world states V 0 (W ).
Expanding action vertex W: Collect the common actions as U (W) = ∩ w∈W A(w), i.e., the set of actions each of which is available at every state in W. Now, for any action a ∈ U (W), consider the transition W {a} − − → W . If the set of world states W has not appeared earlier in the path from W 0 to W, add new belief vertex W connected via an edge bearing {a}. Otherwise, add transition from W to a vertex W dummy to avoid expanding the same belief vertex multiple times. Expanding observation vertex W: Let all possible observations at the states in W be Y (W), i.e., Y (W) = ∪ w∈W A(w). As before, construct a transition from W to W if W is new, or to W dummy otherwise. But now do this, not just the singletons, but for every G ⊆ Y (W). Goals in the tree: Mark W a goal state, if W ⊆ V goal . The belief tree is finite. Any sensor map and goalachieving plan are a subtree that satisfies the following: (i) Goals are achieved: the leaf vertices in the subtree are all in the goal region; (ii) Readiness to receive all observations: the outgoing labels at a particular observation vertex in the subtree cover all outgoing events in the original belief tree; (iii) Discernment is consistent: the subset of observations in the tree is universal, i.e., if {o 1 , o 2 } appears on any edge of the subtree, then it will appear at every belief vertex whose outgoing events contains both o 1 and o 2 .

B. Searching for sensor designs and plans jointly
Next, we search this structure for sensor designs and plans jointly, returning all appropriate sensor maps. While the tree is constructed from the root down, this search bubbles from the leaves back upwards.
For each belief vertex W, we will maintain a list of covers, denoted by L(W), to record all the appropriate observation covers in the subtree. When W is in the goal region, there are no constraints on sensor maps from its subtree. Hence, we create a new symbol ∈ Y , and initialize its cover list to L(W) = { } . This will make it compatible with any cover when integrating with the goal-achieving sensor covers in a bottom-up manner. For any non-goal belief vertex W p ('p' stands for parent), we will construct its cover list from its children. Let the outgoing events be {G 1 , G 2 , . . . , G m } and the corresponding child vertices be {W c 1 , W c 2 , . . . , W c m } ('c' for child). Then we have: • If W p is an action vertex, then each cover in any of its children's lists L(W c i ) is a valid one for W p (under a particular action choice), i.e., L(W p ) = ∪ 1≤i≤m L(W c i ). • If W p is an observation vertex, we must consider the combinations from {G 1 , G 2 , . . . , G m } that nevertheless cover Y (W p ). Let K denote one such combination, then . Each edge labeled with G kj gives a child vertex W c kj , where that child has a cover list L(W c kj ) modeling the sensors that can reach the goal from W c kj . For a given combination K, representing a set of sensor readings, we want to find all sensor maps, denoted as L K , that can generate K when projected to d(K), and is goalachieving for the subtrees starting from each child vertex W c kj . This is realized via intersection operations: The operation guarantees the universality of the subsets in the resulting cover. Let C be the set of all such combinations, such that their labels cover Y (W p ). Each combination K ∈ C gives a list of covers for the parent vertex. So we update L(W p ) to value ∪ K∈C L K . By propagating the list of covers from the goal vertices back upward until the initial belief vertex, we are able to obtain all the covers from L(W 0 ) where there exists some plan for each cover in L(W 0 ) toward the goal.

C. Compact representation with upper covers
In the data structure above, we need to maintain a list of covers L(W) for each belief vertex W. The list can grow very large. Luckily, we only need to maintain the largest covers among the ones with the same domain. Every subset of such covers is also a valid solution, so long as it is a proper cover.  This theorem can be proved by showing that the subtree without edges bearing subsets of events in C \ C, still has all leaf vertices as goals and sensor map as a valid cover.
Definition 7 (upper cover). Let C be a list of observation covers, C is an upper cover in C if there does not exist any cover C ∈ C, such that C C and d(C ) = d(C).
According to Theorem 3, we only need to maintain a set of upper covers in each L(W).

D. Empirical explorations of sensor maps
We implemented the algorithms in Python to search for all sensor map solutions for the problem displayed in Fig. 4, a modified version of the (Fig. 1) motivating example: a robot, initially located at 1 or 2, moves to the charging station. The robot can only move forward one or two steps, turn left or right at the location 5 or the corner 6. The robot must avoid bumping into the walls of the four offices A-D and also the stairs. It must, thus, obtain information from its sensors to reduce its uncertainty. To realize this scenario, we construct a world p-graph with 22 states and 11 observations.
The algorithm outputs an upper cover with 767 entries. By enumerating all subsets of the upper cover that covers all the observations (Theorem 3), an enormous number of sensor maps are produced. Among these, several are directly recognizable sensors. For example, they include a sensor map distinguishing every pair of positions, describing a GPS device. The sensor partitioning the situations into those before and after bumping into walls, could be realized as a contact sensor.
Naturally, some of the sensor maps are inscrutable and there are others for which not known hardware implementation could be discerned. For instance, the sensor isolating cell 5 when facing west from cell 7 when facing north (e.g., a distance sensor won't work). This motivates the next section.

REALIZABLE SENSORS
The covers found via the preceding approach might be thought of as a sort of 'free object', on which we may now impose additional constraints. Specifically we're interested in including constraints that help model aspects pertinent to realizable sensors.

A. Sensor map properties
We will start with the following properties: The label map for the camera in Fig. 1 is a partition, as it divides the space into red, gray and white locations.
The next concept of interest is a notion of contiguousness, but we need a more basic structure first.
The distance sensor in Fig. 1 has a contiguous sensor map for the obvious neighbor notion, since its noise distribution is contiguous.
The cardinality of the sensor keeps track of total number of output readings, a sort of notion of dynamic range.

Property 4 (overlap). A cover
This is a generalization of the partition property, quantifying how much readings bleed into one another.
The width of a cover gives a notion of precision, a sense of the volume of noise, describing the number of events that could account for a single sensor reading.
The properties above may also be combined in specifying constraints on sensor maps.
All of the properties can be used either in (1) reducing the sets generated, or in (2) filtering to discard those which violate the constraints, as operators are applied. For instance, in the first case, if searching for partitions only, then partitions exclusively need be computed-a process easier to write and faster to execute than the full cover case.

B. Empirical search for sensors under fabrication constraints
We included the properties described above in our implementation and examined in the following scenario. A robot moves along a cyclic track toward some goal, marked by a star. The robot can move forward or backward at different speeds at different parts of the track, which discretizes the track into 6 segments {s 1 , s 2 , . . . , s 6 } as shown in Fig. 5. The angular range of segment s i is denoted as {o i } for i ∈ {1, . . . , 4}, and {o i , o} for i ∈ {5, 6}. The overlap o is the common angular range for both s 5 and s 6 , arising from the kink. Now, the set of all observations is Y = {o, o 1 , o 2 , . . . , o 6 }, where each observation represents a range of angles. 2 The neighbor relationship of these observations inherits from the circular neighbor relationship of their angles as shown in the figure. Considering only forward or backward actions, the robot, initially located at s 1 or s 3 , must move to reach the goal s 5 . To achieve this, the robot has to reduce its uncertainty, and it does this via a VHF omnidirectional range (VOR) sensor. As shown on the right-hand side of Fig. 5 5: A robot with a sensor equipped to determine angles moves from its initial position toward the goal along a cyclic track. The sensor is realized by a VOR-like beacon at the center, a photo-electric sensor and a timer on the robot. The beacon has a unidirectional blue light rotating at a fast constant angular velocity, which is so fast that can be neglected with respect to robot's movement. It also emits an omnidirectional red light when the blue light points North. The robot can determine angular information by timing the difference between seeing red-red and red-blue flashes.
Consideration of the scenario above leads to the following: Proposition 1. A noiseless sensor taking measurements on a continuous or non-continuous space always gives a 1overlapping sensor map under discretization.
Proof. When there is no noise for the sensor, the sensor map partitions the original continuous or non-continuous measurement space. The task may only need a coarser discretization of the measurement space. If every boundary of the sensor map is a discretization boundary, then the sensor map is still a partition on the discretized space. If it is not, then there exists a sensor map boundary that falls into one of the discretized observations. That observation is shared by the preimage of only the readings separated by the 2 Previously we pointed out that Y was finite; this is still true, though the elements it contains are themselves infinite sets. corresponding sensor map boundary. Hence, the maximum overlap between subsets in the observation cover is 1.

VI. GENERALIZATION TO BELIEF STIPULATIONS
Some prior work has examined instances wherein a robot should be stopped from knowing too much due to privacy considerations [7,8]. In these cases, one may pose constraints on robot's belief; in our prior work this was achieved via logical expressions [4]. To search for sensor maps and plans that also satisfy these richer stipulations, the algorithm above needs the following modifications: • The belief tree should only contain belief vertices satisfying the stipulations, and the dummy vertex. We transition to the dummy if the target belief violates the stipulations.
• We must expand the action vertex in the belief tree over all subsets of actions in the plan instead of just the singleton ones, since none of the singleton actions may transition to the subtree that satisfies the stipulations in each belief vertex.
VII. RELATED WORK Approaches for automated design of robots have been the subject of three recent workshops at RSS and ICRA over the last 3 years [9]. Current research examines aspects of hardware fabrication (e.g., 3D-printing [10] and prototyping [11,12]), interconnection optimization [13], rapid endto-end development and deployment [14,15], automated synthesis (jointly for mechanisms and controllers) from specifications of desired capabilities [16], and optimization subject to functionality-resource interdependencies [17,18].
A rich history of robotics research has examined the information required to accomplish a particular task, including specifically what sensors ought to provide [1]. Since sensors can be costly and unreliable, important early papers explored how one might forgo them entirely [19,20]; other work examined how one might reason about sensors to establish that they do provide enough information [21,22]. Our prior work [8] exploits properties of carefully conceived sensors. We are interested in all possible sensors, including hypothetical ones, that provide adequate information to solve the planning problem. Imperfection in sensors is modeled as conflation in the perceived events. This conflation is usually considered to be transitive in existing work [22,4,23,2,24], when reasoning about the information through the sensors. This paper describes sensors via a sensor map representation which can model non-transitive conflation, in the spirit of [6,5]. It contributes methods to search for all sensors such that there exists a plan for each one to accomplish a given task.
VIII. CONCLUSION This paper explores the space of all sensors that provide enough information to solve the planning problem for the robots. The abstraction used for sensors is a generalization of prior models. A notion of upper cover is proposed to compress the representation and speed the search process. Properties are introduced to express domain-knowledge regarding fabrication constraints for sensors.