From Devs to Formal Methods
Total Page:16
File Type:pdf, Size:1020Kb
FROM DEVS TO FORMAL formulation; for example, Hamilton’s develop- METHODS: A CATEGORICAL ment of quaternions revolutionized physics. My APPROACH intent is to explore DEVS through category the- ory with the goal of developing formal methods D. E. STEVENSON, CLEMSON UNIVERSITY, 442 for modeling and simulation. R. C. EDWARDS HALL, DEPARTMENT OF COMPUTER SCIENCE, CLEMSON UNIVERSITY, The goal is to transform the development CLEMSON, SC 29634-1906 framework (ZS) to a logical framework. In or- STEVE‘CS.CLEMSON.EDU der to utilize ZS as a basis for formal meth- ods, I must show how ZS can be translated to Abstract. The DEVS formalism de- a it is to a formal system (one with axioms and veloped by Zeigler and Sarjoughian is rules of inference) in an acceptable meta-system. extended by the use of category theory. This makes modeling and simulation accessible Several functors are needed to produce the correct categories. Verification and to mathematicians and theoretical computer sci- validation is modeled by adjunction and entists by translating discipline dependent con- the information-gap approach to uncer- cepts into a broader setting. Reasoning occurs tainty. in topoi (singular topos) that form algebraic set- tings for logic and computation. Verification, validation, and accreditation can be approached Keywords. Simulation, DEVS, Category The- as reasoning and as an adjunction. I develop my ory, Information-Gap Uncertainty framework as described in [16]. My goal is to identify category-theoretic concepts that directly support ZS. These con- 1. Motivation cepts will be used to guide research into devel- Two conclusions from the Foundations ’02 oping formal methods for VV&A. In Section 2 I workshop [12] were that (1) the formalisms of discuss concepts of the ZS framework and intro- Zeigler, et al. [17] and Sarjoughian et al. [13] duce categories related to the specification lev- (collectively referred to as ZS) is the most widely els with the identification of possible categories. held formalism by the community represented at Section 3 presents an overview of the category the workshop and (2) there is a need for more theoretic concepts used in this paper. Section 4 formal methods to support the development of describes the categorical formulation. models and simulations. The ZS formalism has some roots in gen- 2. ZS Formalism eral systems theory (GST) as developed by Klir [9, 8, 10] and many others and is based on a dy- The fundamental objects of study is the namical systems theory vocabulary. ZS posits system. Systems have inner structure and ex- algebraic concepts between specification levels, hibit external behavior. In the system theo- behavior, states, and components. ZS relies on retic framework, system structure can be mod- compositionally closed systems of components. eled as state transition systems and system be- The concepts form a natural tie-in with category- havior can be represented by input/output rela- theoretic concepts [1, 3, 4, 5, 6, 11]. tionships. Furthermore, systems can be modeled The history of science and engineering is as components that are coupled compositionally. replete with stories of great advances occurring ZS suggest that systems theory focuses on after notions are examined by new methods for three fundamental questions: SA Systems analysis: the system is given and its behavioral characteristics must This work was partially supported by the Shodor Com- putational Science Fund funded by the Shodor Education be determined. Foundation, Inc., Durham, NC and NSF Grant DUE- SS Systems synthesis: the behavior is given, 0127488. a set of components and rules are given 1 and the system must be constructed to initial state, the input stimulus produces match the behavior. a unique output. SI System inference: the system is given H4 State Transition. Given a state and an and we must infer its structure from its input, the state transition system pro- behavior. duces output state(s). I take H4 as a category that I denote ST Engineers study these classical systems theory H5 Coupled Component. Components are problems, although a very small, informal poll subsystems with their own behavior and of scientists shows they are not familiar with the rules under which they may be com- the terminology. I outlined in [15] why I be- posed. H5 is taken as a category that lieve modeling and simulation (M&S) goes be- denoted CC yond systems theories. For M&S, there are at least three more fundamental problems: The last fundamental concept of system specification to describe is the concept of a mor- SR Systems representation: a system can be phism. The ZS program defines morphisms in represented in many ways. The manner terms of the specification hierarchy above. in which the system is represented often determines how well the system can be utilized. 3. Category Theoretic Approach SVR Systems verification: verification of a What does category theory have to do system definition is the determination of with ZS or formal methods? veracity with respect to rules and con- Formal methods are mathematical ap- ventions. proaches to software and system development SVA System validation or accreditation: val- which support the rigorous specification, design idation or accreditation of a system de- and verification of computer systems. The use termines how the system fits into the real of notations and languages with a defined math- world. ematical meaning enable specifications, (state- ments of what the proposed system should do) Actually, accreditation spans verification and to be expressed unambiguously. Because they validation since its goal is to certify a particu- are formal mathematical structures there must lar use. be underlying formal (axiomatic) theories. Cur- Classical systems theory is primarily in- rent formal methods are concerned with the ver- terested in problems SA and SS. In this con- ification but not validation. Using the concept text, the fundamental operations are decompo- first proposed in [16], we classify the verification sition for SA and composition for SS. But for direction as covariant functor and the validation VV&A, the issue is SI and the three other prob- direction as contravariant. lems: SR, SVR, and SVA. Category theory becomes a tool to un- The ZS program specifies five specifica- derstand the development process as a series tion categories in a hierarchy: of transformations. In order to be useful, for- H1 Observational Frame. The observational mal methods must be able to represent complex frame specifies the resolution of the sys- structures as well as convert various viewpoints. tem: the variables, how the variables are By extending ZS into this structure, we have a measured with respect to accuracy and complete mechanism for describing systems and the time base. then reasoning about them. H2 I/O Behavior. The time-indexed data The ZS approach strongly suggests cate- collected from system observations as tu- gory theory, with its emphasis on morphisms, as ples. I take H2 to a category in or pre- a natural formalization setting. Category the- sentation, where we will use the symbol ory also played a role in development of General Beh for behavior Systems Theory, primarily by Goguen [3, 4, 5, 6]. H3 I/O Function. The I/O function includes The usefulness of the categorical approach is that knowledge of the initial state. Given this it links ZS and system theory on the one hand to 2 abstract algebra, logic, and theoretical computer produces the opposite category Cop. If f : A → B science on the other. then f op : B → A. The category Cop has the same objects as C but has arrows as the oppo- 3.1. Basic Categories. A category C consists sites. The opposite category captures the con- of objects obC and arrows arC. There is no fixed cept of duality while the opposite arrows capture notion of what the objects are; they could be sets inverse. or algebras or logics or data structures. The ar- rows are transformations, either as functions or 3.3. Topoi. Topoi embody many of the proper- morphisms. To give a concrete example, the cat- ties of topologies and sets. From sets they collect egory Set has sets as objects and total functions concepts like initial objects (null sets) and termi- between sets as arrows. nal objects (closures). A topos is guaranteed to For ZS, there are several obvious cate- have certain functions, called exponentials, prod- gories: Sys, the category of systems; Beh, the ucts, and co-products. The existence of prod- category of behaviors; ST , the category of state- ucts and co-products gives rise to concepts of se- transitions; and CC, the category of component- quence, limits, and co-limits. Operationally, the coupling systems. Com has obCom as compo- idea of subset is the same as the equalizers and nents, while if a, b are components, then there is quotients (partitions) as coequalizers. an arrow from a to b, denoted a → b, if com- A necessary concept relating to a topos is ponent a can be transformed into component that of a subobject classifier, signified Ω. The b. Beh objects might be different forms for dis- subobject classifiers play the role of boolean val- playing the behaviors and the the arrows would ues. The term subobject classifier arises from the be morphisms that preserve the structure but manner in which the concept of subset arises in change the way the behavior is written down. topoi. In the category Set, we would symbolize ⊆ We can algebraically operate on cate- Y ⊆ X as X / Ω. Ω has a minimal struc- gories to form new categories in a way that mimic ture somewhat looser than Boolean algbra called sets: products (Cartesian products) and co-prod- Heyting algebra. ucts (disjoint unions). For example the category I interpret H4 and H5 to be specifications Com × Beh would pair every possible component and not the total of all possible implementations.