-
RulePad: Interactive Authoring of Checkable Design Rules
Authors:
Sahar Mehrpour,
Thomas D. LaToza,
Hamed Sarvari
Abstract:
Good documentation offers the promise of enabling developers to easily understand design decisions. Unfortunately, in practice, design documents are often rarely updated, becoming inaccurate, incomplete, and untrustworthy. A better solution is to enable developers to write down design rules which are checked against code for consistency. But existing rule checkers require learning specialized quer…
▽ More
Good documentation offers the promise of enabling developers to easily understand design decisions. Unfortunately, in practice, design documents are often rarely updated, becoming inaccurate, incomplete, and untrustworthy. A better solution is to enable developers to write down design rules which are checked against code for consistency. But existing rule checkers require learning specialized query languages or program analysis frameworks, creating a barrier to writing project-specific rules. We introduce two new techniques for authoring design rules: snippet-based authoring and semi-natural-language authoring. In snippet-based authoring, developers specify characteristics of elements to match by writing partial code snippets. In semi-natural language authoring, a textual representation offers a representation for understanding design rules and resolving ambiguities. We implemented these approaches in RulePad. To evaluate RulePad, we conducted a between-subjects study with 14 participants comparing RulePad to the PMD Designer, a utility for writing rules in a popular rule checker. We found that those with RulePad were able to successfully author 13 times more query elements in significantly less time and reported being significantly more willing to use RulePad in their everyday work.
△ Less
Submitted 23 November, 2021; v1 submitted 9 July, 2020;
originally announced July 2020.
-
Pseudo-Triangle Visibility Graph: Characterization and Reconstruction
Authors:
Sahar Mehrpour,
Alireza Zarei
Abstract:
The visibility graph of a simple polygon represents visibility relations between its vertices. Knowing the correct order of the vertices around the boundary of a polygon and its visibility graph, it is an open problem to locate the vertices in a plane in such a way that it will be consistent with this visibility graph. This problem has been solved for special cases when we know that the target pol…
▽ More
The visibility graph of a simple polygon represents visibility relations between its vertices. Knowing the correct order of the vertices around the boundary of a polygon and its visibility graph, it is an open problem to locate the vertices in a plane in such a way that it will be consistent with this visibility graph. This problem has been solved for special cases when we know that the target polygon is a {\it tower} or a {\it spiral}. Knowing that a given visibility graph belongs to a simple polygon with at most three concave chains on its boundary, a {\it pseuodo-triangle}, we propose a linear time algorithm for reconstructing one of its corresponding polygons. Moreover, we introduce a set of necessary and sufficient properties for characterizing visibility graphs of pseudo-triangles and propose polynomial algorithms for checking these properties.
△ Less
Submitted 2 May, 2019;
originally announced May 2019.
-
Polygon Simplification by Minimizing Convex Corners
Authors:
Yeganeh Bahoo,
Stephane Durocher,
J. Mark Keil,
Debajyoti Mondal,
Saeed Mehrabi,
Sahar Mehrpour
Abstract:
Let $P$ be a polygon with $r>0$ reflex vertices and possibly with holes and islands. A subsuming polygon of $P$ is a polygon $P'$ such that $P \subseteq P'$, each connected component $R$ of $P$ is a subset of a distinct connected component $R'$ of $P'$, and the reflex corners of $R$ coincide with those of $R'$. A subsuming chain of $P'$ is a minimal path on the boundary of $P'$ whose two end edges…
▽ More
Let $P$ be a polygon with $r>0$ reflex vertices and possibly with holes and islands. A subsuming polygon of $P$ is a polygon $P'$ such that $P \subseteq P'$, each connected component $R$ of $P$ is a subset of a distinct connected component $R'$ of $P'$, and the reflex corners of $R$ coincide with those of $R'$. A subsuming chain of $P'$ is a minimal path on the boundary of $P'$ whose two end edges coincide with two edges of $P$. Aichholzer et al. proved that every polygon $P$ has a subsuming polygon with $O(r)$ vertices, and posed an open problem to determine the computational complexity of computing subsuming polygons with the minimum number of convex vertices.
We prove that the problem of computing an optimal subsuming polygon is NP-complete, but the complexity remains open for simple polygons (i.e., polygons without holes). Our NP-hardness result holds even when the subsuming chains are restricted to have constant length and lie on the arrangement of lines determined by the edges of the input polygon. We show that this restriction makes the problem polynomial-time solvable for simple polygons.
△ Less
Submitted 13 December, 2018;
originally announced December 2018.
-
Exploring Increasing-Chord Paths and Trees
Authors:
Yeganeh Bahoo,
Stephane Durocher,
Sahar Mehrpour,
Debajyoti Mondal
Abstract:
A straight-line drawing $Γ$ of a graph $G=(V,E)$ is a drawing of $G$ in the Euclidean plane, where every vertex in $G$ is mapped to a distinct point, and every edge in $G$ is mapped to a straight line segment between their endpoints. A path $P$ in $Γ$ is called increasing-chord if for every four points (not necessarily vertices) $a,b,c,d$ on $P$ in this order, the Euclidean distance between $b,c$…
▽ More
A straight-line drawing $Γ$ of a graph $G=(V,E)$ is a drawing of $G$ in the Euclidean plane, where every vertex in $G$ is mapped to a distinct point, and every edge in $G$ is mapped to a straight line segment between their endpoints. A path $P$ in $Γ$ is called increasing-chord if for every four points (not necessarily vertices) $a,b,c,d$ on $P$ in this order, the Euclidean distance between $b,c$ is at most the Euclidean distance between $a,d$. A spanning tree $T$ rooted at some vertex $r$ in $Γ$ is called increasing-chord if $T$ contains an increasing-chord path from $r$ to every vertex in $T$. In this paper we prove that given a vertex $r$ in a straight-line drawing $Γ$, it is NP-complete to determine whether $Γ$ contains an increasing-chord spanning tree rooted at $r$. We conjecture that finding an increasing-chord path between a pair of vertices in $Γ$, which is an intriguing open problem posed by Alamdari et al., is also NP-complete, and show a (non-polynomial) reduction from the 3-SAT problem.
△ Less
Submitted 1 July, 2017; v1 submitted 27 February, 2017;
originally announced February 2017.