Search arXiv⌕ Search

arXiv subjects

Mohamed Elsheikh

Publications and source records attributed to Mohamed Elsheikh.

2 recordsLinked to original sources

From Sequential to Dataflow: Formally-verified Compilation for Concurrent and Distributed Architectures

On serverless cloud platforms, an application consists of many functions that communicate through the network, which makes it hard to debug, monitor and verify. A growing line of work therefore lets developers write a sequential, imperative program and compiles it into a distributed application. The correctness of these compilers, however, rests on informal arguments, and a mechanized guarantee is hard to obtain: the compiled program runs concurrently but must keep the order of the updates to each state, it must not deadlock, and it may be run by many different executors. We implement a compiler from a sequential, imperative language with state, loops and tail recursion to a dataflow language, and verify it in Rocq. The compiler translates a program directly into a graph of nodes connected by channels: each state becomes a chain of channels that orders its updates, and each tail recursion becomes a loop in the graph that feeds the result of one round back as the argument of the next. To verify the compiler, we give both languages a semantics with interaction trees, derive weakest precondition calculi from these semantics, and show that every weakest precondition proved for the sequential program holds for its compiled graph. Our result is stated against a contract of graph execution, which fixes the order of calls and iterations, leaves every other firing free, and requires that the graph never gets stuck. It therefore holds for every executor that meets the contract. We show that a scheduler meets it under every schedule, and so does an executor without a scheduler, in which nodes fire in parallel as soon as their inputs hold data.

cs.PL↗

Enumeration Complexity of Permutation Classes

We study classes of permutations that are defined by avoidance of forbidden patterns. For each fixed finite set $B$ of forbidden patterns, we study the \emph{avoider enumeration problem}: given an integer $n$, output all $B$-avoiding permutations of length $n$. Avoider enumeration is output-polynomial for every fixed $B$. However, our main notion of efficiency is polynomial delay. We use the insert-maximum tree as a search tree, in which permutations are built by repeatedly inserting a new maximum while preserving pattern avoidance. This leads to the \emph{insert-maximum extension problem}, which asks if a given permutation has an avoiding descendant at a specified depth. An algorithm for this problem can prune branches that cannot reach the target length. Hence, if this problem is in P, we obtain polynomial-delay enumeration. To investigate this problem, we introduce and study \emph{pockets}, the maximal finite subtrees of the insert-maximum tree. For fixed $B$, if there is a polynomial $p$ such that every pocket rooted at $ρ$ has at most $p(|ρ|)$ nodes, then the extension problem is solvable in polynomial time and enumeration has polynomial delay. In particular, a bound on pocket depth depending only on $B$ suffices. We prove such a bound if the class is well-quasi-ordered, has a regular insertion encoding, or if $B$ omits one of the three maximum-position types: leftmost, interior, or rightmost. We also prove that extension is in NP for every fixed $B$, even with binary-encoded target depth. On the negative side, we construct a fixed set of $55$ forbidden patterns for which extension is NP-complete. Consequently, enumerating valid extensions from a given starting permutation cannot have polynomial delay unless P=NP. This also answers a question of Hanika by showing that the forbidden permutation constraint satisfaction problem can be NP-complete for a fixed forbidden set.

cs.CC↗