Side Effects in Steering Fragments

Side Effects in Steering Fragments
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

In this thesis I will give a formal definition of side effects. I will do so by modifying a system for modelling program instructions and program states, Quantified Dynamic Logic, to a system called DLAf (for Dynamic Logic with Assignments as Formulas), which in contrast to QDL allows assignments in formulas and makes use of short-circuit evaluation. I will show the underlying logic in those formulas to be a variant of short-circuit logic called repetition-proof short-circuit logic. Using DLAf I will define the actual and the expected evaluation of a single instruction. The side effects are then defined to be the difference between the two. I will give rules for composing those side effects in single instructions, thus scaling up our definition of side effects to a definition of side effects in deterministic \dlaf-programs. Using this definition I will give a classification of side effects, introducing as most important class that of marginal side effects. Finally, I will show how to use our system for calculating the side effects in a real system such as Program Algebra (PGA).


💡 Research Summary

The thesis presents a formal treatment of side effects in imperative programs by extending Quantified Dynamic Logic (QDL) into a new system called DLAf (Dynamic Logic with Assignments as Formulas). Traditional QDL separates program commands from logical formulas and does not allow assignments within formulas, which limits its ability to model side effects that arise during expression evaluation. DLAf remedies this by permitting assignment statements to appear as atomic formulas and by adopting short‑circuit evaluation semantics for logical connectives ∧₍r₎ (short‑circuit and) and ∨₍r₎ (short‑circuit or). This choice reflects the reality that the order of evaluation can change program state.

The core contribution is a precise definition of side effects as the discrepancy between two notions of evaluation for a given instruction: the expected evaluation, which assumes that only the intended state change occurs, and the actual evaluation, which follows DLAf’s short‑circuit rules and therefore captures any additional state modifications that happen while evaluating the instruction. By formalising this difference, side effects become a mathematically tractable object that can be measured, compared, and composed.

The thesis proceeds in several stages. First, it introduces the syntax and semantics of DLAf, including a toy WHILE‑style language enriched with assignments inside tests, sequential composition, conditional (IF‑THEN‑ELSE) and looping constructs. It then develops a variant of short‑circuit logic called Repetition‑Proof Short‑Circuit Logic, which guarantees that repeated evaluation of the same formula yields the same result, a property needed for the soundness of DLAf’s formulas.

Next, the work defines side effects for single instructions, for basic commands (assignment, test, loop), and for whole deterministic DLAf programs. A special focus is placed on steering fragments (also called tests), which consist of a Boolean formula that determines control flow. Because steering fragments can contain compound formulas with logical connectives, the order of evaluation can introduce hidden state changes. The thesis classifies side effects into several categories:

  • Marginal side effects – changes that affect intermediate state but not the final outcome of the program. These are subtle and often overlooked during optimization.
  • Core side effects – changes that directly influence the final result.
  • Hidden side effects – more complex interactions where the expected and actual evaluations diverge in non‑obvious ways.

Rules are provided for composing side effects when multiple instructions are combined, ensuring that the overall side‑effect profile of a program can be derived systematically from its parts.

To demonstrate applicability, the thesis applies DLAf to Program Algebra (PGA), a formal model of sequential programs. PGA’s basic and extended instructions are mapped to DLAf formulas, and an algorithm is presented for detecting side effects within PGA programs. A concrete example involving assignments inside a conditional test illustrates how marginal side effects are identified and distinguished from core effects.

The conclusion argues that DLAf offers a robust framework for reasoning about side effects, with potential impact on static analysis, program optimization, and security verification. Future work is suggested in the directions of automated side‑effect extraction tools, extending the approach to functional and object‑oriented languages, and integrating side‑effect awareness into program synthesis and composition theories.


Comments & Academic Discussion

Loading comments...

Leave a Comment