Conditional statements (if/else) are fundamental building blocks of all programming languages. Traditional analysis of programming constructs focuses on implementation and runtime behavior, but rarely on formal algebraic representation. This paper proposes a mathematical framework to represent conditional statements as algebraic functions, incorporating input-output mapping and execution time. Using this approach, we demonstrate how simple conditionals can be analyzed theoretically, extended to loops and program modules, and provide a foundation for a formal theory of programming.
Prasoon Jadon (Tue,) studied this question.