ACTMF7SRTJF5RDFRMAQLSMVM7NRC4PGXOZ2TBGGYLI26RHLQ32YAC X6WLKC2Y5PDS7SYRNPTXTUYVU4V3I5ZZ2KS4IZSMMXCI6GSQE77QC 567NUQ633R5ESTE2LWXVUGM7XEZGJ65IRKPOCDZJS3JE5RAMR5KAC KDY46C5VOI2QWEXPE6J6BW3U2KEMH3IYPUNYKH5FAISTRCWBWO3AC 5MHYFQWH3WWCAARBKU5OEMKNW2F5EMA2FJ5HS7PDDGEFH2HWKEPQC USNRNHANGXUQHFFVHLAVWWA7WGPX2RZOYFQAV44HU5AYEW5YC27QC NEWG2Q2EYR3BOPWVN44EXIPVH2GH23BYFHJXUSNYWWT7WWDEAIKQC Q3TJZVCBWD7FDMS4MWTT7VUNOI3R3MQCOU6JJCJ5UVIDJPXKMLWAC QIVGMR6INKBVT5IFCO2UJJQEO4PVW3ZM7IDTCTCOKOX7VKG7UPFAC TKJMPTB73W5TLLTNUOC4FGRQ7DHE5GRBTL7C5QBXRCNQPMJKGEQAC M3WK5HF3XU5MN2JKJMRJVDMC74F4MZAQ23FTGJRW4CGU5ZL72MHAC In \Cref{ch:theory} the method of control-flow refinement via partial evaluationwas expanded to \acrfull{pip}. The method is proven to be sound for \gls{pip}sand can be used to refine a \gls{pip} when classical analysis fails at findingtight runtime bounds. In \Cref{ch:implementation} we have presented a newimplementation of partial evaluation on probabilistic programs and successfullyinferred tighter expected runtime complexity bounds for two probabilisticexamples.
good as iRankFinder on a small number of programs in the test sets. Since wetried to mirror the behaviour of iRankFinder as close as possible, there weremost probably mistakes made during implementation. For example, ourimplementation of the heuristics deviate from iRankFinders implementation or theselecting the feedback set for locations had an unexpected impact on theanalysis. In any case, the worsened analysis results warrant furtherinvestigation. Until then, \gls{koat} can keep using iRankFinder for
good as iRankFinder on a small number of programs in the test sets. We tried tomirror the behaviour of iRankFinder as closely as possible, but probablydeviated from it a significant way. For example, our implementation mightcompute slightly different properties heuristically than iRankFinder'simplementation, or selecting the feedback set for locations had an unexpectedimpact on the analysis. In any case, the worsened analysis results warrantfurther investigation. Until then, \gls{koat} can keep using iRankFinder for
to Aprons representation of polyhedra. There is probably room for improvement,by reducing the number of conversions to and from apron. Furthermore, the
to Aprons representation of polyhedra. There is room for improvement byreducing the number of conversions to and from apron. Furthermore, the
\section{Conclusion}\label{sec:conclusion}In \Cref{ch:theory} the method of control-flow refinement via partial evaluationwas expanded to \gls{pip}. The method is proven to be sound for \gls{pip} andcan be used to refine a \gls{pip} when classical analysis fails at finding tightruntime bounds. In \Cref{ch:implementation} we have presented a newimplementation of partial evaluation on probabilistic programs and successfullyinferred tighter expected runtime complexity bounds for an example \gls{pip}. Tothe best of our knowledge, we applied partial evaluation for the first time in acomplexity analysis frame work for probabilistic programs.
\section{Conclusion}\label{sec:conclusion}Considering our goals, it was successfully proven in theory that partialevaluation can be adapted to \glspl{pip}. The control-flow refinement techniquecan be used when searching expected runtime complexity bounds of \glspl{pip}since the expected runtime complexity bounds are preserved during partialevaluation. With our new implementation, we successfully improved the runtimeperformance of \gls{koat} during analysis of non-probabilistic integer programs.In the future, our implementation can be used to replace iRankFinder, which isused as a black-box at the moment. Furthermore, we have demonstrated that ourimplementation for \glspl{pip} can be integrated into \gls{koat}'s analysis ofprobabilistic integer programs and that tighter expected runtime complexitybounds can be found on some programs. To the best of our knowledge, we appliedpartial evaluation for the first time in a complexity analysis frame work forprobabilistic integer programs.
localised property-based abstraction as introduced in \Cref{ch:theory}. In\Sref{sec:implementation} we describe the implementation using pseudo-code. Wewill mostly focus on the practical aspects of the partial evaluation.\Sref{sec:technical_details} will briefly describe the technical details of theimplementation. Finally, in \Sref{sec:performance} we will analyse theperformance of the new implementation.
localised property-based abstraction as introduced in \Cref{ch:theory}. Weextend \gls{koat}'s analysis of non-probabilistic programs with a newimplementation of control-flow refinement via partial evaluation and implementpartial evaluation on probabilistic programs. In \Sref{sec:implementation} wedescribe the implementation using pseudo-code. We will mostly focus on thepractical aspects of the partial evaluation. \Sref{sec:technical_details} willbriefly describe the technical details of the implementation. Finally, in\Sref{sec:performance} we will analyse the performance of the newimplementation.
which require a call to the \gls{smt}-solver. This call is expensive and as wasdemonstrated in Example \ref{ex:global_abstr}, a global abstraction functiondoes not yield the smallest partial evaluations, which makes successive analysisunnecessarily slow.
which require a call to an \gls{smt}-solver in \gls{koat}. This call isexpensive and as was demonstrated in Example \ref{ex:global_abstr}, a globalabstraction function does not yield the smallest partial evaluations, whichmakes successive analysis unnecessarily slow.
Given a finite collection of finite sets $S = \{S_1, \dots, S_n\}$, whereeach $S_i \subseteq U$ for some set $U$, find a minimal set $R$ such that$R\intersect S_i \neq \emptyset$ for all $i = 1,\dots,n$.
For a given finite collection of finite sets $S = \{S_1, \dots,S_n\}$, whereeach $S_i \subseteq U$ for some finite set $U$, find a minimal set $R$ suchthat $R\intersect S_i \neq \emptyset$ for all $i = 1,\dots,n$.
The evaluation on sub-\gls{scc} was integrated into \gls{koat}s analysis similarto iRankFinder as described in \cite{giesl2022lncs}, possibly replacing the oldimplementation in the future. The analysis command was expanded with newsettings, which allow to select the various parameters of the evaluation, suchthe selection of locations for abstraction.
The evaluation on sub-\gls{scc} was integrated into \gls{koat}s analysis ofclassical programs similar to iRankFinder as described in \cite{giesl2022lncs},possibly replacing the old implementation in the future. The analysis commandwas expanded with new settings, which allow to select the various parameters ofthe evaluation, such as the selection of locations for abstraction.Unfortunately, for probabilistic programs we were not able to integrate thesub-\gls{scc} level implementation into the analysis due to technical problems.The current implementation uses an extensive typing system that asserts thatpartial evaluation cannot be used with probabilistic programs and we were notable to change those constraints in \gls{koat}s source-code without rewritingand restructuring major parts of the analysis, which went beyond the scope ofthis thesis. Furthermore, the probabilistic analysis underwent a full rewriteduring the writing of this thesis by its developers, making the task at handeven harder to fulfill. However, the implementation we provide should bereasonably easy to integrate, for someone who has experience dealing with\gls{koat}s typing system.
the maximum depth of linear ranking functions to $\textit{mdepth} = 1$.The control-flow refinement is done by calling iRankFinder as a
the maximum depth of multi-phase ranking functions to $\textit{mdepth} =1$. The control-flow refinement is done by calling iRankFinder as a
well. The average analysis time of programs where a finite runtime-bound isfound shortens by 0.96 seconds from 5.10 seconds to 4.14 seconds without\glspl{mprf}; and by 1.93 seconds from 5.74 seconds to 3.81 seconds with
well. The average analysis time of programs where a finite runtime complexitybound is found shortens by 0.96 seconds from 5.10 seconds to 4.14 secondswithout \glspl{mprf}; and by 1.93 seconds from 5.74 seconds to 3.81 seconds with
This worsened behaviour needs further investigation. We suspect there to beeither a bug in the implementation or that the properties are not optimallychosen. Besides, there is certainly room for performance optimisation in the newimplementation.
This worsened behaviour needs further investigation.
The implementation for probabilistic programs was done on a
Due to the missing integration into the full analysis of probabilistic programs,the implementation for probabilistic programs was evaluated on two cases.Instead of using sub-\gls{scc} level control-flow refinement, we partiallyevaluate the entire program and then feed the results to the probabilisticanalysis.Our first test was done with the example program $\Prog_3$ studied in\Cref{ch:introduction} and \Cref{ch:theory}. The full partial evaluation yieldsthe same program as the theoretically conjectured partial evaluation of Example\ref{ex:localized_pba}. For the original program, \gls{koat} failed at findingfinite expected runtime complexity bounds. After the partial evaluation,\gls{koat} successfully finds a quadratic expected runtime complexity bound$18y^2 + 524y+ 543 \in \mathcal{O}(n^2)$.Our second test, addresses multiphase-loops in probabilistic programs.\gls{mprf} have a very similarly advantage as partial evaluation whendetermining the runtime of loops where the loop implicitly has multiple phases.However, probabilistic ranking functions are lacking this capabilities, hencerendering partial evaluation on probabilistic programs even more powerful. Wedemonstrate it with our second test program $P_5$ displayed in\fref{fig:splitting-loop}. The loops at $\ell_1$ have two phases. In the firstphase $y$ is incremented up to $z$, and in the second phase $x$ in decrementeduntil it reaches a value less than zero. On non-probabilistic programs, thisbehaviour could be bounded using a single \gls{mprf} at $\ell_1$. Probabilisticranking functions cannot bound the runtime complexity of this loop and\gls{koat} cannot find a finite expected runtime complexity bound for thisprogram. After a full partial evaluation with our implementation the program istransformed into an equivalent program, and \gls{koat} finds the linearexpected runtime complexity bound $12y + 12z + 24x + 47/2 \in \mathcal{O}(n)$.
\begin{figure}\centering\input{figures/ch4_p5_program}\caption{The \gls{pip} $\Prog_5$ with a multiphase-loop at $\ell_1$ and ahard to detect expected runtime complexity bound.\label{fig:splitting-loop}}\end{figure}We successfully demonstrated that partial evaluation of \gls{pip}s works and itcan be used to find tighter expected runtime complexity bounds with \gls{koat}.% \begin{figure}% \centering% \input{figures/ch4_p5_pe}% \caption{The partial evaluation of the entire \gls{pip} $\Prog_5$. \label{fig:splitting-loop-pe}}% \end{figure}
Lemma \ref{lem:constrfleq} implies that $\simu(\varf)\in\fpath_{\Prog'}$ isadmissible for any admissible finite prefix $f \in \fpath_\Prog$.
Lemma \ref{lem:constrfleq} implies that$\simu_{\Prog,S,T}(\varf)\in\fpath_{\Prog'}$ is admissible for any admissiblefinite prefix $f \in \fpath_\Prog$.
&\text{if } \varf' = \simu(\varf(\ell,t,s)) = \dots c'_n, \\&\scheduler(c'_n) = (g, \tilde{s})\text{, and } g \neq g_\bot
&\text{if } \varf' = \simu_{\Prog,S,T}(\varf(\ell,t,s)) = \dotsc'_n, \scheduler(c'_n) = (g, \tilde{s})\text{, and }\\ &g \neqg_\bot,\end{aligned}\\(g^*, \tilde{s}^*) & \begin{aligned}&\text{if } \simu_{\Prog,S,T}(\varf(\ell,t,s)) = \dots c'_n,\scheduler(c'_n) = (g, \tilde{s}), \\ &g = g_\bot \text{, and }g^* \in \GTPout(\ell), \text{ and } \tilde{s}^* \models\tau_{g^*} \text { exists,}
\begin{rem}Since all general transitions have more restrictive guards then theiroriginals, it is possible that a location $\ell$ a general transitionwith a satisfiable guard exists in $\Prog$ whereas the guards of allgeneral transitions at a location $\langle \ell, \varphi\rangle$ cannotbe satisfied by the scheduler. In that case, the new scheduler selectsany one of the valid general transitions $g^*$ and a matching assignment$\tilde{s}^*$. As before, this doesn't matter since thoseconfigurations can never be reached by an admissible run.\end{rem}
prefix $f \in \fpath_\Prog'$ with probability $\prSs(\varf) > 0$ thereexists a finite prefix $\varf' \in \fpath_\Prog$ for which
prefix $f = \dots (\langle\ell_n, \varphi_n\rangle, t_n, s_n) \in\fpath_{\Prog'}$ with probability$\prSs(\varf) > 0$ there exists a finite prefix $\varf' = \dots(\ell_n,\bar{t}_n,s_n) \in \fpath_\Prog$ for which
initial configuration with non-zero probability $\prSs(f_0) = 1$. We set$\varfpi{0} = c'_0 = (\ell_0, t_\text{in}, s_0)$ which is by construction theonly valid starting configuration of $\Prog'$ with $\prSns(c'_0) = 1$.
initial configuration with non-zero probability $\prSs(\varff_0) = 1$. Weset $\varfpi{0} = c'_0 = (\ell_0, t_\text{in}, s_0)$ which is byconstruction the only valid starting configuration of $\Prog'$ with$\prSns(c'_0) = 1$.
\in \N$ be an admissible prefix with probability $\prSs(f_{n+1})>0$, then$f_n = c_0\dots{}c_{n}$ of length $n$ is also admissible with $\prSs(f_n) >0$. By induction hypothesis a finite prefix $\varfpi{n} = c'_0\dots{}c'_{n}\in \fpath_{\Prog}$ of equal length and probability exists.
\in \N$ be an admissible prefix with probability $\prSs(\varff_{n+1})>0$,then $f_n = c_0\dots{}c_{n}$ of length $n$ is also admissible with$\prSs(\varff_n) > 0$. By induction hypothesis a finite prefix $\varfpi{n}= c'_0\dots{}c'_{n} \in \fpath_{\Prog}$ of equal length and probabilityexists. Additionally $c_n = (\langle\ell_n,\varphi\rangle, \_, s_n)$ and$c'_n = (\ell_n, \_, s_n)$.
\textbf{Case 2}: $g = g_\bot$. In that case the constructed schedulerselects $\scheduler'(c'_{n+1}) = (g_bot,s)$ as well. This is correctbecause every outgoing general transition of $\Prog$ at $\ell$ was unfoldedor copied and added to the partial evaluation with more restrictive guards.Hence, no general transition in $\Prog$ is satisfiable.
\textbf{Case 2}: $g = g_\bot$. By construction of the unfolding the $s_n\models \varphi_n$ and because $s_n \not\models \varphi \land \tau_g =\varphi \land \tau_{\bar{g}}$ for any general transition $g \in\GTPnout(\langle\ell_n, \varphi_n\rangle)$, there cannot be any generaltransition $g' \in \GTPout$ for which $s_n \models \tau_{g'}$. The newlyconstructed scheduler selects $\scheduler'(c'_{n+1}) = (g_\bot,s)$ as well.