This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Theory and Techniques for Synthesizing a Family of Graph Algorithms

Srinivas Nedunuri   William R. Cook University of Texas at Austin nedunuri|wcook@cs.utexas.edu Kestrel Institute    Douglas R. Smith Kestrel Institute smith@kestrel.edu
Abstract

Although Breadth-First Search (BFS) has several advantages over Depth-First Search (DFS) its prohibitive space requirements have meant that algorithm designers often pass it over in favor of DFS. To address this shortcoming, we introduce a theory of Efficient BFS (EBFS) along with a simple recursive program schema for carrying out the search. The theory is based on dominance relations, a long standing technique from the field of search algorithms. We show how the theory can be used to systematically derive solutions to two graph algorithms, namely the Single Source Shortest Path problem and the Minimum Spanning Tree problem. The solutions are found by making small systematic changes to the derivation, revealing the connections between the two problems which are often obscured in textbook presentations of them.

1 Introduction

Program synthesis is experiencing something of a resurgence [22, 21, 5] [15, 23] following negative perceptions of its scalability in the early 90s. Many of the current approaches aim for near-automated synthesis. In contrast, the approach we follow, we call guided program synthesis, also incorporates a high degree of automation but is more user-guided. The basic idea is to identify interesting classes of algorithms and capture as much generic algorithm design knowledge as possible in one place.The user instantiates that knowledge with problem-specific domain information. This step is often carried out with machine assistance. The approach has been applied to successfully derive scores of efficient algorithms for a wide range of practical problems including scheduling [19], concurrent garbage collection [14], and SAT solvers [20].

One significant class of algorithms that has been investigated is search algorithms. Many interesting problems can be solved by application of search. In such an approach, an initial search space is partitioned into subspaces, a process called splitting, which continues recursively until a feasible solution is found. A feasible solution is one that satisfies the given problem specification. Viewed as a search tree, spaces form nodes, and the subspaces after a split form the children of that node. The process has been formalized by Smith [16, 18]. Problems which can be solved by global search are said to be in the Global Search (GS) class. The enhancements in GS over standard branch-and-bound include a number of techniques designed to improve the quality of the search by eliminating unpromising avenues. One such technique is referred to as dominance relations. Although they do not appear to have been widely used, the idea of dominance relations goes back to at least the 70s [6]. Essentially, a dominance relation is a relation between two nodes in the search tree such that if one dominates the other, then the dominated node is guaranteed to lead to a worse solution than the dominating one, and can therefore be discarded. Establishing a dominance relation for a given problem is carried out by a user. However this process is not always obvious. There are also a variety of ways in which to carry out the search, for example Depth-First (DFS), Breadth-First (BFS), Best-First, etc. Although DFS is the most common, BFS actually has several advantages over DFS were it not for its exponential space requirement. The key to carrying out BFS space-efficiently is to limit the size of the frontier at any level. However, this has not been investigated in any systematic manner up to now.

This paper has two main contributions:

  • We show how to limit the size of the frontier in search using dominance relations, thereby enabling space-efficient BFS. From this formal characterization, we derive a characteristic recurrence that serves as the basis of a program schema for implementing Global Search. Additionally, we show that limiting the size of the undominated frontier to one results in a useful class of greedy algorithms.

  • We show how to derive dominance relations and demonstrate they satisfy the greediness conditions for two graph problems, namely Single Source Shortest Path and Minimum Spanning Tree by a systematic process, which though not automatic, we believe has the potential to be automated.

2 Background To Guided Program Synthesis

2.1 Process

The basic steps in guided program synthesis are:

  1. 1.

    Start with a logical specification of the problem to be solved. A specification is a quadruple D,R,o,c\langle D,R,o,c\rangle where DD is an input type, RR an output or result type, o:D×Ro:D\times R is a predicate relating correct or feasible outputs to inputs, and c:D×RIntc:D\times R\rightarrow Int is a cost function on solutions. An example specification is in Eg. 1 (This specification is explained in more detail below)

  2. 2.

    Pick an algorithm class from a library of algorithm classes (Global Search, Local Search, Divide and Conquer, Fixpoint Iteration, etc). An algorithm class comprises a program schema containing operators to be instantiated and an axiomatic theory of those operators (see [10] for details). A schema is analogous to a template in Java/C++ , with the difference that both the template and template arguments are formally constrained.

  3. 3.

    Instantiate the operators of the program schema using information about the problem domain and in accordance with the axioms of the class theory. To ensure correctness, this step can be carried out with mechanical assistance. The result is an efficient algorithm for solving the given problem.

  4. 4.

    Apply low-level program transforms such as finite differencing, context-dependent simplification, and partial evaluation, followed by code generation. Many of these are automatically applied by Specware [2], a formal program development environment.

The result of Step 4 is an efficient program for solving the problem which is guaranteed correct by construction. The power of the approach stems from the fact that the common structure of many algorithms is contained in one reusable program schema and associated theory. Of course the program schema needs to be carefully designed, but that is done once by the library designer. The focus of this paper is the Global Search class, and specifically on how to methodically carry out Step 3 for a wide variety of problems. Details of the other algorithm classes and steps are available elsewhere [8, 16, 14].

Example 1.

Specification of the Single Pair Shortest Path (SPSP) problem is shown in Fig. 2.1 (The \mapsto reads as “instantiates to”) The input DD is a structure with 3 fields, namely a start node, end node and a set of edges. The result RR is a sequence of edges ([][\ldots] notation). A correct result is one that satisfies the predicate path?path? which checks that a path zz must be a contiguous path from the start node to the end node ( simple recursive definition not shown). Finally the cost of a solution is the sum of the costs of the edges in that solution. Note that fields of a structure are accessed using the ’.’ notation.

Ds:Node,e:Node,edges:{Edge}Edge=f:Node,t:Node,w:NatR[Edge]oλ(x,z)path?(z,x.s,x.e)path?(p,s,f)=cλ(x,z)edgezedge.w\begin{array}[]{rcl}D&\mapsto&\langle s:Node,e:Node,edges:\{Edge\}\rangle\\ &&Edge=\langle f:Node,t:Node,w:Nat\rangle\\ R&\mapsto&[Edge]\\ o&\mapsto&\lambda(x,z)\cdot\,path?(z,x.s,x.e)\\ &&path?(p,s,f)=...\\ c&\mapsto&\lambda(x,z)\,\cdot\sum_{edge\in z}edge.w\end{array}

Figure 2.1: Specification of Shortest Path problem

2.2 Global Search

Before delving into a program schema for Global Search, it helps to understand the structures over which the program schema operates. In [16], a search space is represented by a descriptor of some type R^\widehat{R}, which is an abstraction of the result type RR. The initial or starting space is denoted \bot. There are also two predicates split:D×R^×R^:D\times\widehat{R}\times\widehat{R}, written \pitchfork, and extract:R^×R:\widehat{R}\times R, written χ\chi. Split defines when a space is a subspace of another space, and extract captures when a solution is extractable from a space. We say a solution zz is contained in a space yy (written zyz\in y) if it can be extracted after a finite number of splits. A feasible space is one that contains feasible solutions. We often write (x,y,y)\pitchfork(x,y,y^{\prime}) as yxyy\pitchfork_{x}y^{\prime} for readability, and even drop the subscript when there is no confusion. Global Search theory (GS-theory) [16] axiomatically characterizes the relation between the predicates \bot, \pitchfork and χ\chi, as well as ensuring that the associated program schema computes a result that satisfies the specification. In the sequel, the symbols R^,,,χ,\widehat{R},\bot,\pitchfork,\chi,\oplus are all assumed to be drawn from GS-theory. A theory for a given problem is created by instantiating these terms, as shown in the next example.

R^Rλx[]λ(x,p,p)ex.edgesp=p++[e]χλ(z,p)p=z\begin{array}[]{rcl}\widehat{R}&\mapsto&R\\ \bot&\mapsto&\lambda x\cdot\,[]\\ \pitchfork&\mapsto&\lambda(x,p,p^{\prime})\cdot\,\exists e\in x.edges\cdot\\ &&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,p^{\prime}=p{+\mkern-4.0mu+}[e]\\ \chi&\mapsto&\lambda(z,p)\cdot\,p=z\end{array}

Figure 2.2: GS instantiation for Single Pair Shortest Path
Example 2.

Instantiating GS-theory for the Single Pair Shortest Path problem. The type of solution spaces R^\widehat{R} is the same as the result type RR 111there is a covariant relationship between an element of R^\widehat{R} and of RR. For example, the initial space, corresponding to all possible paths, is the empty list.. A space is split by adding an edge to the current path - that is the subspaces are the different paths that result from adding an edge to the parent path. Finally a solution can be trivially extracted from any space by setting the result zz to the space pp. This is summarized in Fig. 2.2 ([][] denotes the empty list, and ++{+\mkern-4.0mu+} denotes list concatenation).

2.3 Dominance Relations

As mentioned in the introduction, a dominance relation provides a way of comparing two subspaces in order to show that one will always contain at least as good a solution as the other. (Goodness in this case is measured by some cost function on solutions). The first space is said to dominate (\vartriangleright) the second, which can then be eliminated from the search. Letting cc^{*} denote the cost of an optimal solution in a space, this can be formalized as (all free variables are assumed to be universally quantified):

yyc(x,y)c(x,y)y\vartriangleright y^{\prime}\Rightarrow c^{*}(x,y)\leq c^{*}(x,y^{\prime}) (2.1)

Another way of expressing the consequent of (2.1) is

zyo(x,z)zyo(x,z)c(x,z)c(x,z)\forall z^{\prime}\in y^{\prime}\cdot\,o(x,z^{\prime})\Rightarrow\exists z\in y\cdot\,o(x,z)\wedge c(x,z)\leq c(x,z^{\prime}) (2.2)

To derive dominance relations, it is often useful to first derive a semi-congruence relation [16]. A semi-congruence between two partial solutions yy and yy^{\prime}, written yyy\rightsquigarrow y^{\prime}, ensures that any way of extending yy^{\prime} into a feasible solution can also be used to extend yy into a feasible solution. Like \pitchfork, \rightsquigarrow is a ternary relation over D×R^×R^D\times\widehat{R}\times\widehat{R} but as we have done with \pitchfork and many other such relations in this work, we drop the input argument when there is no confusion and write it as a binary relation for readability. Before defining semi-congruence, we introduce two concepts. One is the idea of useability of a space. A space yy is is useable, written o(x,y)o^{*}(x,y), if z.χ(y,z)o(x,z)\exists z.\,\chi(y,z)\wedge o(x,z), meaning a feasible solution can be extracted from the space. The second is the notion of incorporating sufficient information into a space to make it useable. This is defined by an operator :R^×tR^\oplus:\widehat{R}\times t\rightarrow\widehat{R} that takes a space and some additional information of type tt and returns a more defined space. The type tt depends on R^\widehat{R}. For example if R^\widehat{R} is the type of lists, then tt might also be the same type. Now the formal definition of semi-congruence is:

yyo(x,ye)o(x,ye)y\rightsquigarrow y^{\prime}\Rightarrow o^{*}(x,y^{\prime}\oplus e)\Rightarrow o^{*}(x,y\oplus e)

That is, yyy\rightsquigarrow y^{\prime} is a sufficient condition for ensuring that if yy^{\prime} can be extended into a feasible solution than so can yy with the same extension. If cc is compositional (that is, c(st)=c(s)+c(t)c(s\oplus t)=c(s)+c(t)) then it can be shown [10] that if yyy\rightsquigarrow y^{\prime} and yy is cheaper than y,y^{\prime}, then yy dominates yy^{\prime} (written yyy\vartriangleright y^{\prime}). Formally:

yyc(x,y)c(x,y)yyy\rightsquigarrow y^{\prime}\wedge c(x,y)\leq c(x,y^{\prime})\Rightarrow y\vartriangleright y^{\prime} (2.3)

The axioms given above extend GS-theory [16].

Example 3.

Single Pair Shortest Path. If there are two paths pp and pp^{\prime} leading from the start node, if pp and pp^{\prime} both terminate in the same node then ppp\rightsquigarrow p^{\prime}. The reason is that any path extension ee (of type t=[Edge]t=[Edge]) of pp^{\prime} that leads to the target node is also a valid path extension for pp. Additionally if pp is shorter than pp^{\prime} then pp dominates pp^{\prime}, which can be discarded. Note that this does not imply that pp leads to the target node, simply that no optimal solutions are lost in discarding pp^{\prime}. This dominance relation is formally derived in Eg. 8

Example 4.

0-1 Knapsack

The 0-1 Knapsack problem is, given a set of items each of which has a weight and utility and a knapsack that has some maximum weight capacity, to pack the knapsack with a subset of items that maximizes utility and does not exceed the knapsack capacity. Given combinations k,kk,k^{\prime}, if kk and kk^{\prime} have both examined the same set of items and kk weighs less than kk^{\prime} then any additional items ee that can be feasibly added to kk^{\prime} can also be added to kk, and therefore kkk\rightsquigarrow k^{\prime}. Additionally if kk has at least as much utility as kk^{\prime} then kkk\vartriangleright k^{\prime}.

The remaining sections cover the original contributions of this paper.

3 A Theory Of Efficient Breadth-First Search (EBFS)

While search can in principle solve for any computable function, it still leaves open the question of how to carry it out effectively. Various search strategies have been investigated over the years; two of the most common being Breadth-First Search (BFS) and Depth-First Search (DFS). It is well known that BFS offers several advantages over DFS. Unlike DFS which can get trapped in infinite paths222resolvable in DFS with additional programming effort, BFS will always find a solution if one exists. Secondly, BFS does not require backtracking. Third, for deeper trees, BFS will generally find a solution at the earliest possible opportunity. However, the major drawback of BFS is its space requirement which grows exponentially. For this reason, DFS is usually preferred over BFS.

Our first contribution in this paper is to refine GS-theory to identify the conditions under which a BFS algorithm can operate space-efficiently. The key is to show how the size of the undominated frontier of the search tree can be polynomially bounded. Dominance relations are the basis for this.

In [16], the relation l\pitchfork^{l} for l0l\geq 0 is recursively defined as follows:

y0y=(y=y)yl+1y=y′′yy′′y′′ly\begin{array}[]{rcl}y\pitchfork^{0}y^{\prime}&=&(y=y^{\prime})\\ y\pitchfork^{l+1}y^{\prime}&=&\exists y^{\prime\prime}\cdot\,y\pitchfork y^{\prime\prime}\wedge y^{\prime\prime}\pitchfork^{l}y^{\prime}\end{array}

From this the next step is to define those spaces at a given frontier level that are not dominated. However, this requires some care because dominance is a pre-order, that is it satisfies the reflexivity and transitivity axioms as a partial order does, but not the anti-symmetry axiom. That is, it is quite possible for yy to dominate yy^{\prime} and yy^{\prime} to dominate yy but yy and yy^{\prime} need not be equal. An example in Shortest Path is two paths of the same length from the start node that end at the same node. Each path dominates the other. To eliminate such cyclic dominances, define the relation yyy\thickapprox y^{\prime} as yyyyy\vartriangleright y^{\prime}\wedge y^{\prime}\vartriangleright y. It is not difficult to show that \thickapprox is an equivalence relation. Now let the quotient frontier at level ll be the quotient set 𝑓𝑟𝑜𝑛𝑡𝑖𝑒𝑟l/\mathit{frontier_{l}}/\thickapprox . For type consistency, let the representative frontier 𝑟𝑓𝑟𝑜𝑛𝑡𝑖𝑒𝑟l\mathit{rfrontier_{l}} be the quotient frontier in which each equivalence class is replaced by some arbitrary member of that class. The representative frontier is the frontier in which cyclic dominances have been removed. Finally then the undominated frontier 𝑢𝑛𝑑𝑜𝑚l\mathit{undom_{l}} is 𝑟𝑓𝑟𝑜𝑛𝑡𝑖𝑒𝑟l{yy𝑟𝑓𝑟𝑜𝑛𝑡𝑖𝑒𝑟lyy}\mathit{rfrontier_{l}}-\{y\mid\exists y^{\prime}\in\mathit{rfrontier_{l}}\cdot\,y^{\prime}\vartriangleright y\}.

Now given a problem in the GS class, if it can be shown that undoml\left\|undom_{l}\right\| for any ll is polynomially bounded in the size of the input, a number of benefits accrue: (1) BFS can be used to tractably carry out the search, as implemented in the raw program schema of Alg. 1, (2) The raw schema of Alg. 1 can be transformed into an efficient tail recursive form, in which the entire frontier is passed down and (3) If additionally the tree depth can be polynomially bounded (which typically occurs for example in constraint satisfaction problems or CSPs [4]) then, under some reasonable assumptions about the work being done at each node, the result is a polynomial-time algorithm for the problem.

3.1 Program Theory

A program theory for EBFS defines a recursive function which given a space yy, computes a non-trivial subset Fx(y)F_{x}(y) of the optimal solutions contained in yy, where

Fx(y)=optc{zzyo(x,z)}F_{x}(y)=opt_{c}\{z\mid z\in y\wedge o(x,z)\}

optcopt_{c} is a subset of its argument that is the optimal set of solutions (w.r.t. the cost function cc), defined as follows:

optcS={zzS(zSc(z)c(z))}opt_{c}S=\{z\mid z\in S\wedge(\forall z^{\prime}\in S\,\cdot\,c(z)\leq c(z^{\prime}))\}

Also let undom(y)undom(y) be undoml(y)+1{yyyyy}undom_{l(y)+1}\cap\{yy\mid y\pitchfork yy\} where l(y)l(y) is the level of yy in the tree. The following proposition defines a recurrence for computing the feasible solutions in a space:

Proposition 5.

Let D,R,R^,o,c,,,χ,,\langle D,R,\widehat{R},o,c,\bot,\pitchfork,\chi,\vartriangleright,\oplus\rangle be a well-founded GS-Theory w.r.t. the subspace relation \pitchfork and let Fx(y)={zzyo(x,z)}F_{x}(y)=\{z\mid z\in y\wedge o(x,z)\} be the set of feasible solutions contained in yy and Gx(y)={zχ(y,z)o(x,z)}yyyGx(yy)}G_{x}(y)=\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{yy\pitchfork y}G_{x}(yy)\} be a recurrence. Then Gx(y)=Fx(y)G_{x}(y)=F_{x}(y) for any yy

Proof.

See [16]. ∎

Finally he following theorem defines a recurrence that can be used to compute FOx(y)FO_{x}(y):

Theorem 6.

Let \pitchfork be a well-founded relation of GS-theory and let GOx(y)=optc{zχ(y,z)o(x,z)}yyundom(y)GOx(yy))GO_{x}(y)=opt_{c}\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{yy\in undom(y)}GO_{x}(yy)) be a recurrence. Then GOx(y)FOx(y)GO_{x}(y)\subseteq FO_{x}(y)

Proof.

By generalized induction. The base case is those spaces which do not have subspaces. Then GOx(y)=optc{zχ(y,z)o(x,z)}GO_{x}(y)=opt_{c}\{z\mid\chi(y,z)\wedge o(x,z)\}. By Prop. 5 {zχ(y,z)o(x,z)}={zzyo(x,z)}\{z\mid\chi(y,z)\wedge o(x,z)\}=\{z\mid z\in y\wedge o(x,z)\}. The inductive case is as follows:

FOx(y)={defn}optc{zzyo(x,z)}={defn of Fx}opt(Fx(y))={Fx(y)=Gx(y) by Prop.5}opt({zχ(y,z)o(x,z)}yyyGx(yy))={Gx(yy)=Fx(yy) by Prop.5}opt({zχ(y,z)o(x,z)}yyyFx(yy))={distributivity of opt}opt(opt{zχ(y,z)o(x,z)}opt(yyyFx(yy)))={distributivity and idempotence of opt}opt({zχ(y,z)o(x,z)}yyyopt(Fx(yy)))={unfold defn of Fx, fold defn of FOx}opt({zχ(y,z)o(x,z)}yyyFOx(yy)){yyundom(y)yyy}opt({zχ(y,z)o(x,z)}yyundom(y)FOx(yy)){induction hypothesis:FOx(yy)GOx(yy)}opt({zχ(y,z)o(x,z)}yyundom(y)GOx(yy))={fold defn of GOx}GOx(y)by\begin{array}[]{l}FO_{x}(y)\\ =\{\mbox{defn}\}\\ opt_{c}\{z\mid z\in y\wedge o(x,z)\}\\ =\{\mbox{defn of }F_{x}\}\\ opt(F_{x}(y))\\ =\{F_{x}(y)=G_{x}(y)\mbox{ by Prop.}\ref{prop:G-recurrence}\}\\ opt(\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{y\pitchfork yy}G_{x}(yy))\\ =\{G_{x}(yy)=F_{x}(yy)\mbox{ by Prop.}\ref{prop:G-recurrence}\}\\ opt(\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{y\pitchfork yy}F_{x}(yy))\\ =\{\mbox{distributivity of }opt\}\\ opt(opt\{z\mid\chi(y,z)\wedge o(x,z)\}\cup opt(\bigcup_{y\pitchfork yy}F_{x}(yy)))\\ =\{\mbox{distributivity and idempotence of }opt\}\\ opt(\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{y\pitchfork yy}opt(F_{x}(yy)))\\ =\{\mbox{unfold defn of }F_{x},\mbox{ fold defn of }FO_{x}\}\\ opt(\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{y\pitchfork yy}FO_{x}(yy))\\ \supseteq\{yy\in undom(y)\Rightarrow y\pitchfork yy\}\\ opt(\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{yy\in undom(y)}FO_{x}(yy))\\ \supseteq\{\mbox{induction hypothesis:}FO_{x}(yy)\supseteq GO_{x}(yy)\}\\ opt(\{z\mid\chi(y,z)\wedge o(x,z)\}\cup\bigcup_{yy\in undom(y)}GO_{x}(yy))\\ =\{\mbox{fold defn of }GO_{x}\}\\ GO_{x}(y)\end{array}by

The theorem states that if the feasible solutions immediately extractable from a space yy are combined with the solutions obtained from GOxGO_{x} of each undominated subspace yyyy, and the optimal ones of those retained, the result is a subset of FOx(y)FO_{x}(y). The next theorem demonstrate non-triviality333Non-triviality is similar but not identical to completeness. Completeness requires that every optimal solution is found by the recurrence, which we do not guarantee. of the recurrence by showing that if a feasible solution exists in a space, then one will be found.

Theorem 7.

Let \pitchfork be a well-founded relation of GS-Theory and GOxGO_{x} be defined as above. Then

FOx(y)GOx(y)FO_{x}(y)\neq\emptyset\Rightarrow GO_{x}(y)\neq\emptyset
Proof.

The proof of Theorem 6 is a series of equalities except for two steps. It is sufficient to show that both of these steps preserve non-triviality. The proof is again by induction over the subspace relation. The first refinement reduces yyyFOx(yy)\bigcup_{y\pitchfork yy}FO_{x}(yy) to yyundom(y)FOx(yy)\bigcup_{yy\in undom(y)}FO_{x}(yy). Suppose yyyyyFOx(yy)\exists yy\cdot\,y\pitchfork yy\wedge FO_{x}(yy)\neq\emptyset. If yyyyundom(y)\in undom(y) then we are done. Otherwise if yyyy is dominated, then there is some yyyyyy^{\prime}\vartriangleright yy and by the property of dominance, FOx(yy)FO_{x}(yy^{\prime})\neq\emptyset, so yyundom(y)FOx(yy)\bigcup_{yy\in undom(y)}FO_{x}(yy)\neq\emptyset. The second refinement follows again by induction, using the induction hypothesis FOx(yy)GOx(yy)FO_{x}(yy)\neq\emptyset\Rightarrow GO_{x}(yy)\neq\emptyset. ∎

From the characteristic recurrence we can straightforwardly derive a simple recursive function bfs to compute a non-trivial subset of FxF_{x} for a given yy, shown in Alg. 1

  • solve :: D -> {R}

    solve(x) = bfs x {initial(x)}

    bfs :: D -> {RHat}-> {R}

    bfs x frontier =

    let localsof y = let z = extract x y

    in if z!={} && o(x,z) then z else {}

    locals = (flatten.map) localsof frontier

    allsubs = (flatten.map) (subspaces x) frontier

    undom = {yy : yy\inallsubs &&

    (yy’\insubs && yy’ ‘dominates‘ yy \Rightarrow yy==yy’)}

    subsolns = bfs x undom

    in opt(locals \cup subsolns)

    subspaces :: D -> RHat -> {RHat}

    subspaces x y = {yy: split(x,y,yy))

    opt :: {R} -> {R}

    opt zs = min {c x z | z \inzs}

Algorithm 1 pseudo-Haskell Program Schema for EBFS (schema parameters underlined)

The final program schema that is included in the Specware library is the result of incorporating a number of other features of GS such as necessary filters, bounds tests, and propagation, which are not shown here. Details of these and other techniques are in [16].

3.2 A class of strictly greedy algorithms (SG)

A greedy algorithm [3] is one which repeatedly makes a locally optimal choice. For some classes of problems this leads to a globally optimum choice. We can get a characterization of optimally greedy algorithms within EBFS by restricting the size of undomlundom_{l} for any ll to 1. If undomlundom_{l}\neq\emptyset then the singleton member yy^{*} of undomlundom_{l} is called the greedy choice. In other work [13] we show how to derive greedy algorithms for a variety of problems including Activity Selection, One machine scheduling, Professor Midas’ Traveling Problem, Binary Search.

4 Methodology

We strongly believe that every formal approach should be accompanied by a methodology by which it can be used by a competent developer, without needing great insights. Guided program synthesis already goes a long way towards meeting this requirement by capturing design knowledge in a reusable form. The remainder of the work to be done by a developer consists of instantiating the various parameters of the program schema. In the second half of this paper, we demonstrate how carrying this out systematically allows us to derive several related graph algorithms, revealing connections that are not always obvious from textbook descriptions. We wish to reiterate that once the dominance relation and other operators in the schema have been instantiated, the result is a complete solution to the given problem. We focus on dominance relations because they are arguably the most challenging of the operators to design. The remaining parameters can usually be written down by visual inspection.

The simplest form of derivation is to reason backwards from the conclusion of yyo(x,ye)o(x,ye)y\rightsquigarrow y^{\prime}\Rightarrow o^{*}(x,y^{\prime}\oplus e)\Rightarrow o^{*}(x,y\oplus e), while assuming o(x,ye)o^{*}(x,y^{\prime}\oplus e) . The additional assumptions that are made along the way form the required semi-congruence condition. The following example illustrates the approach.

Example 8.

Derivation of the semi-congruence relation for Single Pair Shortest Path in Eg. 1 is a straightforward calculation as shown in Fig 4.1. It relies on the specification of Shortest Path given in Eg. 1 and the GS-theory in Eg. 2.

o(x,ye)={defn of o}zχ(ye,z)o(x,z)={defn of χ}o(x,ye)={defn of o}path?(ye,x.s,x.e)={distributive law for path?}npath?(y,x.s,n)path?(e,n,x.e){o(x,ye), ie.mpath?(y,x.s,m)path?(e,m,x.e). Let m be witness for n}path?(y,x.s,m)path?(e,m,x.e)={m=last(y).t, (where last returns the last element of a sequence)}last(y).t=last(y).tpath?(y,x.s,n)\begin{array}[]{l}o^{*}(x,y\oplus e)\\ =\mbox{\{defn of }o^{*}\}\\ \exists z\cdot\,\chi(y\oplus e,z)\wedge o(x,z)\\ =\{\mbox{defn of }\chi\}\\ o(x,y\oplus e)\\ =\{\mbox{defn of }o\}\\ path?(y\oplus e,x.s,x.e)\\ =\{\mbox{distributive law for }path?\}\\ \exists n\cdot\,path?(y,x.s,n)\wedge path?(e,n,x.e)\\ \Leftarrow\{o^{*}(x,y^{\prime}\oplus e)\mbox{, ie.}\exists m\cdot\,path?(y^{\prime},x.s,m)\wedge path?(e,m,x.e).\mbox{ Let }m\mbox{ be witness for }n\}\\ path?(y,x.s,m)\wedge path?(e,m,x.e)\\ =\{m=last(y).t\mbox{, (where }last\mbox{ returns the last element of a sequence)}\}\\ last(y).t=last(y^{\prime}).t\wedge path?(y,x.s,n)\end{array}

Figure 4.1: Derivation of semi-congruence relation for Single Pair Shortest Path

The calculation shows that a path yy is semi-congruent to yy^{\prime} if yy and yy^{\prime} both end at the same node and additionally yy is itself a valid path from the start node to its last node. Since the cost function is compositional, this immediately produces a dominance relation yy=last(y)=last(y)path?(y,x.s,n)edgeyedge.wedgeyedge.wy\vartriangleright y^{\prime}=last(y)=last(y^{\prime})\wedge path?(y,x.s,n)\wedge\sum_{edge\in y}edge.w\leq\sum_{edge^{\prime}\in y^{\prime}}edge^{\prime}.w. Note the use of the distributive law for path?path? in step 4. Such laws are usually formulated as part of a domain theory during a domain discovery process, or even as part of the process of trying to carry out a derivation such as the one just shown. Given an appropriate constructive prover (such as the one in KIDS [17]) such a derivation could in fact be automated. Other examples that have been derived using this approach are Activity Selection [12], Integer Linear Programming [16], and variations on the Maximum Segment Sum problem [11].

While this dominance relation could in principle be used to computer Single Source Shortest Path using a Best-First search (such as A*) it would not be very efficient as every pair of nodes on the frontier would need to be compared. In the next section, a more powerful dominance relation is derived which can be used in a Breadth-First search, and even more importantly, be shown to be in the SG class, resulting in a very efficient greedy algorithm. The dominance relation just derived is still utilized, but in a subsidiary role.

5 More complex derivations: A family of related algorithms

5.1 (Single Source) Shortest Path

Previously in Eg. 8 we derived a dominance relation for the (undirected) single pair shortest path problem. To solve the problem of finding all shortest paths from a given start node to every other node in the graph it is convenient to consider the output as a set of edges that form what is called a path tree, a subgraph of the input graph which forms a spanning tree rooted at the start node. The desired output is a path tree in which every path from the root is the shortest. The specification of Single Pair Shortest Path in Fig. 2.1 is revised as shown in Fig. 5.1

Ds:Node,edges:{Edge}Edge=a:Node,b:Node,w:NatR{Edge}oλ(x,z)connected(x,z)acyclic(x,z)cλ(x,z)ppathsFrom(x.s)c(p)c(p)=edgepedge.w\begin{array}[]{rcl}D&\mapsto&\langle s:Node,edges:\{Edge\}\rangle\\ &&Edge=\langle a:Node,b:Node,w:Nat\rangle\\ R&\mapsto&\{Edge\}\\ o&\mapsto&\lambda(x,z)\cdot\,connected(x,z)\wedge acyclic(x,z)\\ c&\mapsto&\lambda(x,z)\,\cdot\sum_{p\in pathsFrom(x.s)}c^{\prime}(p)\\ &&c^{\prime}(p)=\sum_{edge\in p}edge.w\end{array}

Figure 5.1: Specification of Shortest Path problem

The revised instantiation of Global Search theory is shown in Fig. 5.2

R^Rλx{}λ(x,p,pe)ex.edgespe=p{e}χλ(z,p)p=z\begin{array}[]{rcl}\widehat{R}&\mapsto&R\\ \bot&\mapsto&\lambda x\cdot\,\{\}\\ \pitchfork&\mapsto&\lambda(x,p,pe)\cdot\,\exists e\in x.edges\cdot\,pe=p\cup\{e\}\\ \chi&\mapsto&\lambda(z,p)\cdot\,p=z\\ \oplus&\mapsto&\cup\end{array}

Figure 5.2: GS instantiation for Shortest Path

In what follows, the extends operator \oplus is shown by simple concatenation. The goal is to show that there is at most one undominated child following a split of a partial solution α\alpha. Let αe\alpha e and αe\alpha e^{\prime} be two children following a split of α\alpha, that is the graphs α\alpha with edge ee added and that with ee^{\prime} added. Without loss of generality (w.l.o.g.) assume neither ee nor ee^{\prime} are already contained in α\alpha and both connect to α\alpha. Let z=αeωz^{\prime}=\alpha e^{\prime}\omega^{\prime} be a feasible solution derived from αe\alpha e^{\prime}. The task is to construct a feasible solution zz from αe\alpha e and discover the conditions under which it is cheaper than zz^{\prime}. We will use the definition of general dominance (2.2), repeated here for convenience:

zyo(x,z)zyo(x,z)c(x,z)c(x,z)\forall z^{\prime}\in y^{\prime}\cdot\,o(x,z^{\prime})\Rightarrow\exists z\in y\cdot\,o(x,z)\wedge c(x,z)\leq c(x,z^{\prime})

Establishing o(αeω)o(\alpha e\omega) requires connected(αeω)(\alpha e\omega) and acyclic(αeω)(\alpha e\omega).

In guided program synthesis, it is often useful to write down laws [17] that will be needed during the derivation. Some of the most useful laws are distributive laws and monotonicity laws. For example the following distributive law applies to ayclicayclic :

𝑎𝑐𝑦𝑐𝑙𝑖𝑐(αβ)=𝑎𝑐𝑦𝑐𝑙𝑖𝑐(α)𝑎𝑐𝑦𝑐𝑙𝑖𝑐(β)𝑎𝑐(α,β)\mathit{acyclic}(\alpha\beta)=\mathit{acyclic}(\alpha)\wedge\mathit{acyclic}(\beta)\wedge\mathit{ac}(\alpha,\beta)

where acac defines what happens at the “boundary” of α\alpha and β\beta:

𝑎𝑐(α,β)=m,npαpath?(p,m,n)¬qβpath?(q,m,n)\mathit{ac}(\alpha,\beta)=\forall m,n\cdot\,\exists p\in\alpha^{*}\cdot\,path?(p,m,n)\Rightarrow\neg\exists q\in\beta^{*}\cdot\,path?(q,m,n)

requiring that if pp is a path in α\alpha (α\alpha^{*} is a regular expression denoting all possible sequences of edges in α\alpha) connecting mm and nn then there should be no path between mm and nn in β\beta. Examples of monotonicity laws are acyclic(αβ)acyclic(α)acyclic(\alpha\beta)\Rightarrow acyclic(\alpha) and connected(α)connected(β)nodes(α)nodes(β)connected(αβconnected(\alpha)\wedge connected(\beta)\wedge nodes(\alpha)\cap nodes(\beta)\neq\emptyset\Rightarrow connected(\alpha\beta). By using the laws constructively, automated tools such as KIDS [17] can often suggest instantiations for terms. For instance, after being told connected(αeω)connected(\alpha e^{\prime}\omega^{\prime}), the tool could apply the monotonicity law for connectedconnected to suggest connected(αeeω)connected(\alpha ee^{\prime}\omega^{\prime}), that is to try ω=eω\omega=e^{\prime}\omega^{\prime}. With this binding for ω\omega we can attempt to establish acyclic(αeω)acyclic(\alpha e\omega), by expanding its definition. One of the terms is ac(\ldots ac(e,αeω)e,\alpha e^{\prime}\omega^{\prime})\ldots which fails because conn(αeω)conn(\alpha e^{\prime}\omega^{\prime}) implies path?(αeω,e.a,e.b)path?(\alpha e^{\prime}\omega^{\prime},e.a,e.b) so adding edge ee creates a cycle. The witness to the failure is some path π=ejek\pi^{\prime}=e_{j}\ldots e_{k} where ej.a=e.aek.b=e.be_{j}.a=e.a\wedge e_{k}.b=e.b. One possibility is that ej=ek=ee_{j}=e_{k}=e, that is ω\omega^{\prime} contains ee. If so, let ω=eψ\omega^{\prime}=e\psi^{\prime} for some ψ\psi^{\prime}. Then z=αeω=αeeψ=αeeψz^{\prime}=\alpha e^{\prime}\omega^{\prime}=\alpha e^{\prime}e\psi^{\prime}=\alpha ee^{\prime}\psi^{\prime}. Let ω=eψ\omega=e^{\prime}\psi^{\prime} and now z=zz=z^{\prime}. Otherwise, w.l.o.g assume that ee connects with α\alpha at e.ae.a, and therefore so does eje_{j}, so the case ej.b=e.be_{j}.b=e.b is not very interesting. The only option then is to remove edge eke_{k} from ω\omega^{\prime} . Let ω=ekψ\omega^{\prime}=e_{k}\psi^{\prime} and so ω\omega is eψe^{\prime}\psi^{\prime}. Now the requirement becomes

acyclic(αe)acyclic(eψ)ac(αe,eψ)acyclic(\alpha e)\wedge acyclic(e^{\prime}\psi^{\prime})\wedge ac(\alpha e,e^{\prime}\psi^{\prime})

acyclic(eψ)acyclic(e^{\prime}\psi^{\prime}) follows from acyclic(αeψ)acyclic(\alpha e^{\prime}\psi^{\prime}) by monotonicity and ac(αe,eψ)ac(\alpha e,e^{\prime}\psi^{\prime}) follows from acyclic(αeψ)acyclic(\alpha e^{\prime}\psi^{\prime}) and the fact that ee was chosen above to remove the cycle in αeeω\alpha ee^{\prime}\omega^{\prime} . This demonstrates o(αeω)o(\alpha e\omega) provided acyclic(αe)acyclic(\alpha e) where ω\omega is constructed as above.

Finally, to establish general dominance it is necessary to show that zz costs no more than zz^{\prime}. Note that the cost of a solution is the sum of individual path costs starting from x.sx.s. Let mm denote e.ae.a and nn denote e.be.b (and analogously for ee^{\prime}). Now consider a path to a node pp in zz^{\prime}. If the path to pp does not contain edge eke_{k} ie. pass through nn then the same path holds in zz. Otherwise let βeiγeδ\beta^{\prime}e^{\prime}_{i}\gamma^{\prime}e"\delta be a path to pp in zz^{\prime} where ee" is the edge eke_{k} above (see Fig. 5.3).

Refer to caption
Figure 5.3: Feasible solution αeω\alpha e^{\prime}\omega^{\prime}

β\beta^{\prime} is a path from x.sx.s in α\alpha and eie^{\prime}_{i} is some edge that leads out of α\alpha on the path to pp. Then the corresponding path in zz is βeδ\beta e\delta (see Fig. 5.4).

c(αeω,βeδ)c(αeω,βeγieδ)={expand defns}c(z,βe)+c(z,δ)c(z,βei)+c(z,e)+c(z,δ)={+ve edge weights, triangle inequality}c(z,βe)c(z,βe)i\begin{array}[]{l}c(\alpha e\omega,\beta e\delta)\leq c(\alpha e^{\prime}\omega^{\prime},\beta^{\prime}e{}_{i}\gamma^{\prime}e"\delta)\\ =\{\mbox{expand defns}\}\\ c(z,\beta e)+c(z,\delta)\leq c(z^{\prime},\beta^{\prime}e_{i})+c(z^{\prime},e")+c(z,\delta)\\ =\{\mbox{+ve edge weights, triangle inequality}\}\\ c(z,\beta e)\leq c(z^{\prime},\beta^{\prime}e{}_{i})\end{array}

As there were no restrictions on ee^{\prime} above, let eie_{i} be the witness for ee^{\prime} and this establishes

Refer to caption
Figure 5.4: Feasible solution αeω\alpha e\omega

That is, provided the path βe\beta e is shorter than βe\beta^{\prime}e^{\prime}, there cannot be a shorter path via ee^{\prime} to nn. As cost is the sum of the path costs, it follows that c(x,αeω)c(αeω)c(x,\alpha e\omega)\leq c(\alpha e^{\prime}\omega^{\prime}). The dominance condition is then αeαeacyclic(αe)c(z,βe)c(z,βe)\alpha e\vartriangleright\alpha e^{\prime}\Leftarrow acyclic(\alpha e)\wedge c(z,\beta e)\leq c(z^{\prime},\beta^{\prime}e^{\prime}) . Finally, as it is not known at the time of the split which ee^{\prime} will lie on the path to e.be.b, to be conservative, let ee be that edge whose endpoint e.be.b is the closest to the start node. This is therefore the greedy choice. Iincorporating finite differencing to incrementally maintain the distances to the nodes, using the dominance relation derived earlier for Single Pair Shortest Path to eliminate the longer paths to a node, and data structure refinement results in an algorithm similar to Dijkstra’s algorithm for MSTs.

5.2 Minimum Spanning Tree

The specification of MST is very similar to that of Shortest Path, with the difference that there is no longer a distinguished node ss, the input graph must be connected, and the cost of a solution is simply the sum of the weights of the edges in the tree

D{Edge}connectedEdge=f:Node,t:Node,w:NatR{Edge}oλ(x,z)connected(x,z)acyclic(x,z)cλ(x,z)edgezedge.w\begin{array}[]{rcl}D&\mapsto&\{Edge\}\mid connected\\ &&Edge=\langle f:Node,t:Node,w:Nat\rangle\\ R&\mapsto&\{Edge\}\\ o&\mapsto&\lambda(x,z)\cdot\,connected(x,z)\wedge acyclic(x,z)\\ c&\mapsto&\lambda(x,z)\,\cdot\sum_{edge\in z}edge.w\end{array}

Figure 5.5: Specification of Min. Spanning Tree problem

The instantiation of the simple GS operators is as for SP. Again, any edge that is added must not create a cycle or it cannot lead to a feasible solution. We will describe the algorithm construction process informally so as to expose the connection with the Shortest Path algorithm more clearly. However the derivations shown here can also be similarly formalized.

There are now two ways to satisfy the acyclicity requirement. One is by choosing an edge connecting a node in α\alpha to one outside of α\alpha. Another is to choose an edge that connects two nodes within α\alpha, being careful not to create cycles. The two options are examined next,

Option 1: Let z=αeωz^{\prime}=\alpha e^{\prime}\omega^{\prime} be a feasible solution derived from αe\alpha e^{\prime}. If ω\omega^{\prime} includes ee then let ω\omega in a feasible solution z=αeωz=\alpha e\omega simply be ω{e}{e}\omega^{\prime}-\{e\}\cup\{e^{\prime}\} and then z=zz=z^{\prime}. Otherwise, if ω\omega’ does not contain ee there must be some other path connecting α\alpha with e.te.t. W.l.o.g. assume that path is via ee^{\prime}. If αeω\alpha e^{\prime}\omega^{\prime} is feasible, then it is a tree, so ω\omega’ is also a tree. Therefore it is not difficult to show that z=αeωz=\alpha e\omega^{\prime} is also a spanning tree. Now to show dominance, derive conditions under which zz is cheaper than zz^{\prime}:

c(x,αeω)c(x,αeω)={defn of c}edgeαeωedge.wedgeαeωedge.w=e.we.w\begin{array}[]{l}c(x,\alpha e\omega^{\prime})\leq c(x,\alpha e^{\prime}\omega^{\prime})\\ =\{\mbox{defn of }c\}\\ \sum_{edge\in\alpha e\omega^{\prime}}edge.w\leq\sum_{edge\in\alpha e^{\prime}\omega^{\prime}}edge.w\\ =\\ e.w\leq e^{\prime}.w\end{array}

Finally, as it is not known at the time of the split which ee^{\prime} will lie on the path to e.te.t, to be conservative, let ee be that edge with the least weight connecting α\alpha with an external node . This is therefore the greedy choice. The result is an algorithm that is similar to Prim’s algorithm for MSTs.

Option 2: The difference with Option 1 is in how ee is chosen in order to ensure acyclicity. For a feasible solution, α\alpha must not contain any cycles. Therefore it consists of a collection of acyclic connected components, ie trees. Any new edge cannot connect nodes within a component without introducing a cycle. Therefore it must connect two component trees. Connecting two trees by a single edge results in a new tree. As in Option 1, let z=αeωz^{\prime}=\alpha e^{\prime}\omega^{\prime} be a feasible solution derived from αe\alpha e^{\prime}. If ω\omega^{\prime} includes ee then let ω\omega in a feasible solution z=αeωz=\alpha e\omega simply be ω{e}{e}\omega^{\prime}-\{e\}\cup\{e^{\prime}\} and then z=zz=z^{\prime}. Otherwise, if ω\omega’ does not contain ee there must be some other edge used to connect the two trees that ee would have connected. W.l.o.g. assume that edge is ee^{\prime}. If αeω\alpha e^{\prime}\omega^{\prime} is feasible, then it is a tree, so ω\omega’ is also a tree. Therefore it is not difficult to show that z=αeωz=\alpha e\omega^{\prime} is also a spanning tree. The derivation of a cost comparison relation is identical to Option 1, and once again the greedy choice is the edge ee that connects two trees and is of least weight. The result of this option is an algorithm that is similar to Kruskal’s algorithm.

In conclusion, we observe that far from being completely different algorithms, Dijkstra’s algorithm, Prim’s algorithm and Kruskal’s algorithm differ only in very small number of (albeit important) ways. In contrast, many textbook descriptions of the algorithms introduce the algorithms out of the blue, followed by separate proofs of correctness. We have shown how a systematic procedure can derive different algorithms, with relatively minor changes to the derivations.

6 Related Work

Gulwani et al. [22, 5] describe a powerful program synthesis approach called template-based synthesis. A user supplies a template or outline of the intended program structure, and the tool fills in the details. A number of interesting programs have been synthesized using this approach, including Bresenham’s line drawing algorithm and various bit vector manipulation routines. A related method is inductive synthesis [7] in which the tool synthesizes a program from examples. The latter has been used for inferring spreadsheet formulae from examples. All the tools rely on powerful SMT solvers. The Sketching approach of Solar-Lezama et al [15] also relies on inductive synthesis. A sketch, similar in intent to a template, is supplied by the user and the tool fills in such aspects as loop bounds and array indexing. Sketching relies on efficient SAT solvers. To quote Gulwani et al. the benefit of the template approach is that “the programmer only need write the structure of the code and the tool fills out the details” [22].Rather than the programmer supplying an arbitrary template, though, we suggest the use of a program schema from the appropriate algorithm class (refer to Step 2 of the process in Sec. 2.1). We believe that the advantage of such an approach is that, based on a sound theory, much can already be inferred at the abstract level and this is captured in the theory associated with the algorithm class. Furthermore, knowledge of properties at the abstract level allows specialization of the program schema with information that would otherwise have to either be guessed at by the programmer devising a template or inferred automatically by the tool (e.g. tail recursive implementation or efficient implementation of dominance testing with hashing). We believe this will allow semi-automated synthesis to scale up to larger problems such as constraint solvers (SAT, CSP, LP, MIP, etc.), planning and scheduling, and O/S level programs such as garbage collectors [14].

Program verification is another field that shares common goals with program synthesis - namely a correct efficient program. The difference lies in approach - we prefer to construct the program in a way that is guaranteed to be correct, as opposed to verifying its correctness after the fact. Certainly some recent tools such as Dafny [9] provide very useful feedback in an IDE during program construction. But even such tools requires significant program annotations in the form of invariants to be able to automatically verify non-trivial examples such as the Schorr-Waite algorithm [9]. Nevertheless, we do not see verification and synthesis as being necessarily opposed. For example, ensuring the correctness of the instantiation of several of the operators in the program schema which is usually done by inspection is a verification task, as is ensuring correctness of the schema that goes in the class library. We also feel that recent advances in verification via SMT solvers will also help guided synthesis by increasing the degree of automation.

Refinement is generally viewed as an alternative to synthesis. A specification is gradually refined into an efficient executable program. Refinement methods such as Z and B have proved to be very popular. In contrast to refinement, guided program synthesis already has the program structure in place, and the main body of work consists of instantiating the schema parameters followed by various program transformations many of which can be mechanically applied. Both refinement and synthesis rely extensively on tool support, particularly in the form of provers. We expect that advances in both synthesis and refinement will benefit the other field.

7 Summary and Future Work

We have formulated a theory of efficient breadth-first search based on dominance relations. A very useful specialization of this class occurs when there is at most one undominated child node. This is the class of Strictly Greedy algorithms. We have also derived a recurrence from which a simple program schema can be easily constructed. We have shown how to systematically derive dominance relations for a family of important graph algorithms revealing connections between them that are obscured when each algorithm is presented in isolation.

Nearly all the derivations shown in this paper have been carried out by hand. However, they are simple enough to be automated. We plan on building a prover that incorporates the ideas mentioned in here. We are encouraged by the success of a similar prover that was part of KIDS, a predecessor to Specware.

References

  • [1]
  • [2] Specware. Http://www.specware.org.
  • [3] T. Cormen, C. Leiserson, R. Rivest & C. Stein (2001): Introduction to Algorithms, 2nd edition. MIT Press.
  • [4] R Dechter (2003): Constraint Processing. Morgan Kauffman.
  • [5] S. Gulwani, S. Jha, A. Tiwari & R. Venkatesan (2011): Synthesis of loop-free programs. In: PLDI, pp. 62–73, 10.1145/2F1993498.1993506.
  • [6] T. Ibaraki (1977): The Power of Dominance Relations in Branch-and-Bound Algorithms. J. ACM 24(2), pp. 264–279, 10.1145/2F322003.322010.
  • [7] S. Itzhaky, S. Gulwani, N. Immerman & M. Sagiv (2010): A simple inductive synthesis methodology and its applications. In: OOPSLA, pp. 36–46, 10.1145/2F1869459.1869463.
  • [8] C. Kreitz (1998): Program Synthesis. In W. Bibel & P. Schmitt, editors: Automated Deduction – A Basis for Applications, chapter III.2.5, III, Kluwer, pp. 105–134.
  • [9] K. R. M. Leino (2010): Dafny: an automatic program verifier for functional correctness. In: Proc. 16th intl. conf. on Logic for Prog., AI, & Reasoning, LPAR, pp. 348–370, 10.1007/2F978-3-642-17511-4_20.
  • [10] S. Nedunuri (2012): Theory and Techniques for Synthesizing Efficient Breadth-First Search Algorithms. Ph.D. thesis, Univ. of Texas at Austin.
  • [11] S. Nedunuri & W.R. Cook (2009): Synthesis of Fast Programs for Maximum Segment Sum Problems. In: Intl. Conf. on Generative Prog. and Component Engineering (GPCE), 10.1145/2F1621607.1621626.
  • [12] S. Nedunuri, D. R. Smith & W. R. Cook (2010): A Class of Greedy Algorithms and Its Relation to Greedoids. Intl. Colloq. on Theoretical Aspects of Computing (ICTAC), 10.1007/2F978-3-642-14808-8_24.
  • [13] S. Nedunuri, D. R. Smith & W. R. Cook (2012): Theory and Techniques for a Class of Efficient Breadth-First Search Algorithms. In: Intl. Symp. on Formal Methods (FM).
  • [14] D. Pavlovic, P. Pepper & D. R. Smith (2010): Formal Derivation of Concurrent Garbage Collectors. In: Math. of Program Constr. (MPC), 10.1007/2F978-3-642-13321-3_20.
  • [15] Y. Pu, R. Bodík & S. Srivastava (2011): Synthesis of first-order dynamic programming algorithms. In: OOPSLA, pp. 83–98, 10.1145/2F2048066.2048076.
  • [16] D. R. Smith (1988): Structure and Design of Global Search Algorithms. Tech. Rep. Kes.U.87.12, Kestrel Institute.
  • [17] D. R. Smith (1990): KIDS: A Semi-Automatic Program Development System. IEEE Trans. on Soft. Eng., Spec. Issue on Formal Methods 16(9), pp. 1024–1043, 10.1109/2F32.58788.
  • [18] D. R. Smith (2010): Global Search Theory Revisited. Unpublished.
  • [19] D. R. Smith, E. A. Parra & S. J. Westfold (1995): Synthesis of high-performance transportation schedulers. Technical Report, Kestrel Institute.
  • [20] D. R. Smith & S. Westfold (2008): Synthesis of Propositional Satisfiability Solvers. Final Proj. Report, Kestrel Institute.
  • [21] A. Solar-Lezama, L. Tancau, R. Bodik, S. Seshia & V. Saraswat (2006): Combinatorial sketching for finite programs. In: Proc. of the 12th intl. conf. on architectural support for prog. lang. and operating systems (ASPLOS), pp. 404–415, 10.1145/2F1168857.1168907.
  • [22] S. Srivastava, S. Gulwani & J. S. Foster (2010): From program verification to program synthesis. In: POPL, pp. 313–326, 10.1.1.148.395.
  • [23] M. Vechev & E. Yahav (2008): Deriving linearizable fine-grained concurrent objects. PLDI ’08, pp. 125–135, 10.1145/2F1375581.1375598.