The Community for Technology Leaders
Green Image
<p><b>Abstract</b>—In engineering (including computing), mathematics and logic, expressions can arise that contain function applications where the argument is outside the function's domain. Such a situation need not represent a conceptual error, for instance, in conditional expressions, but it is traditionally considered a type error. Various solutions can be found in the literature based on the notion of <it>partial function</it> and/or a distinguished value <it>undefined</it>. However, these have rather pervasive effects, complicating function definition, sacrificing convenient algebraic laws of logical operators and/or Leibniz's rule, one of the most valuable assets in formal reasoning (especially in the calculational style). Other solutions have in common the realization that well-structured mathematical arguments are always <it>guarded</it> by conditions and that the value of <tmath>$A \Rightarrow B$</tmath> is not affected by domain violations in <tmath>$B$</tmath> in case <tmath>$\neg A$</tmath>. These solutions preserve Leibniz's rule and the standard meaning of the logical operators. In this second category, we propose the simplest possible solution, called <it>supertotal function definition</it>, and consisting of assigning the value <b>false</b> (or 0, depending on the preferred formalism) to any function application where the argument is outside the domain. This approach assumes the notion of function with which a <it>domain</it> is associated as a part of its specification. Ramifications regarding formal reasoning, use in software engineering (such as Parnas's predicate calculus) and in mathematical formulation in general are discussed. The proposed solution justifies formal reasoning as usual, but with increased freedom in expressions regarding types of function arguments. Hence, it can be adopted in existing formalisms with very minor changes to the latter. As a bonus, this discussion includes a very simple new view on conditional expressions, yielding unusually powerful and convenient calculational properties. Finally, differences and advantages w.r.t. other approaches are pointed out.</p>
Formal methods, software specification, predicate calculus, calculational reasoning, functional mathematics, guarded formulas, conditional expressions, undefinedness, type correctness, subtyping.

R. Boute, "Supertotal Function Definition in Mathematics and Software Engineering," in IEEE Transactions on Software Engineering, vol. 26, no. , pp. 662-672, 2000.
91 ms
(Ver 3.3 (11022016))