From: Ian Jackson Date: Sun, 27 May 2012 23:22:47 +0000 (+0100) Subject: strategy: split into more files X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topbloke-formulae.git;a=commitdiff_plain;h=8ee16bd8a84437fc51257805eb234c4dee054889 strategy: split into more files --- diff --git a/article.tex b/article.tex index 6e3d515..96857aa 100644 --- a/article.tex +++ b/article.tex @@ -174,5 +174,8 @@ \chapter{Update strategy} \input{strategy.tex} +\input{ranking.tex} +\input{trav-alg.tex} +\input{trav-proofs.tex} \end{document} diff --git a/ranking.tex b/ranking.tex new file mode 100644 index 0000000..e705a56 --- /dev/null +++ b/ranking.tex @@ -0,0 +1,124 @@ +\section{Ranking phase} + +We run the following algorithm: +\begin{enumerate} +\item Set $\allpatches = \{ \}$. +\item Repeatedly: +\begin{enumerate} +\item Clear out the graph $\hasdirdep$ so it has no edges. +\item Execute $\alg{Rank-Recurse}(\pc_0)$ +\item Until $\allpatches$ remains unchanged. +\end{enumerate} +\end{enumerate} + +$\alg{Rank-Recurse}(\pc)$ is: +\begin{enumerate} + +\item If we have already done $\alg{Rank-Recurse}(\pc)$ in this +ranking iteration, do nothing. Otherwise: + +\item Add $\pc$ to $\allpatches$ if it is not there already. + +\item Set +$$ + \set S \iassign h(\pcn) + \cup + \bigcup_{\p \in \allpatches} + \bigcup_{H \in h(\pn) \lor H \in h(\py)} + \{ \baseof{E} \; | \; E \in \pendsof{H}{\pcy} \} +$$ + +and $W \iassign w(h(\pcn))$ + +\item While $\exists_{S \in \set S} S \ge W$, +update $W \assign S$ and $\set S \assign \set S \, \backslash \{ S \}$ + +(This will often remove $W$ from $\set S$. Afterwards, $\set S$ +is a collection of heads to be merged into $W$.) + +\item Choose an ordering of $\set S$, $S_i$ for $i=1 \ldots n$. + +\item For each $S_i$ in turn, choose a corresponding $M_i$ +such that $$ + M_i \le S_i \land \left[ + M_i \le W \lor \bigexists_{j