Catamorphisms ("foldr" on lists, but generally applicable to any regular recursive datatype) are not just useful but are an effective basis for a recursion-pattern-based discipline of program design. A new presentation for catamorphisms makes it clear how they provide functional semantics for symbolic datatypes, with the capacity to expose significant variations in program design. A further development of the new presentation exploits the higherorder capabilities of functional languages. This is the key enabler for a comprehensive replacement of symbolic data and their interpreters, either implicit or explicit, with direct functional representations. These extensions, of the applicability of catamorphisms and of their presentations, make them even more attractive as bases for program structuring and design, and likewise as targets for software reverse engineering and design recovery. KEY WORDS Software design and development; Programming Tools and languages; Functional programming; Recursion pattern. 2 Catamorphisms are Useful Catamorphisms represent a general, indeed generic recursion pattern on regular recursive datatypes. The design of programs is improved by expressing their recursive components as explicit instantiations of these general patterns.
Here, the use of category theory, long advocated as applicable for manipulating many abstractions found in computer programming, is extended to serve additionally as a meta-level design tool to address a practical, software engineering problem: the design and use of effective software execution tracing systems. Software execution tracing is a widely used technique arising out of basic debugging practices with diverse implementations found in many software engineering processes, but it lacks a useful, theoretical foundation, resulting in engineering problems at several levels: for the designers, implementers and users of tracing systems all of whom have no recourse to rigorously defined and clearly understood engineering abstractions, when it comes to either implementing or using tracing effectively. Category theory has been used widely and successfully in computer science for decades, and more recently for a variety of applications in software engineering, establishing it as a key mathematical basis for this engineering discipline.Practical execution tracing systems have not used the existing theoretical concept of trace already provided by computer science -the trace monoid -because monoidal traces, while nevertheless useful in the theoretical investigation of concurrent and non-deterministic systems, are the consequence of an operational view of semantics, and therefore lack the complex, compositional structure required to encode much of the source-oriented information needed in practical execution traces. As a consequence of the categorical duality between operational and denotational semantics, the novel, dual notion of 'denotational trace' is introduced, where a 'canonical' denotational trace contains the complete collection of source-oriented and compositional, denotational semantic information required for practical execution tracing activities. To highlight the practical, straightforward nature of both denotational tracing implementation and usage, a canonical, denotational tracer is implemented for a simple language, sufficient to provide some simple examples of nevertheless sophisticated uses for denotational traces, including a specification recovery from execution trace and analyses of space and time complexity using formal reasoning applied to traces (i.e., proof by induction, as implied by categorical reasoning based on the denotational basis, for which induction is the associated proof technique). The novel application of category theory as a meta-level design tool, to the long standing software engineering problem of designing and using effective software execution tracing systems, has resulted in an elegant and systematic solution to those problems, further demonstrating that category theory has much to offer software engineering as a practical toolset based on a solid theoretical grounding. Thus category theory has delivered another useful result in software engineering as further evidence of its general applicability to this field, thereby reinforcing its usefulness for modeling, desig...
Software execution tracing is a popular and effective technique, used to support a range of software engineering activities. Nevertheless execution tracing has rarely been the focus of study in its own right, although many case studies and applications have been described. Existing formal notions of trace in computer science are shown to be based implicitly, and then explicitly, on an operational semantic basis, and the limitations of the resulting trace monoid structure for many practical tracing tasks is highlighted. Justified by the category theoretic notion of duality, this paper introduces the denotational basis for software execution tracing, to address these practical limitations. An example of a language with denotational trace added is presented: a simple program in that language, its denotational traces, and their subsequent analysis are shown to support complex tasks such as specification recovery and reasoning about correctness, as well as simple, informal proofs of space and time complexity-techniques and results of immediate usefulness to the practicing software engineer. While both the theory of denotational trace and its consequences are in an early stage of development, initial results suggest uniquely useful, practical results can be derived from denotational traces.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.