Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART C: APPLICATIONS AND REVIEWS, VOL. 36, NO.

2, MARCH 2006 161

On the Informatics Laws and Deductive


Semantics of Software
Yingxu Wang, Senior Member, IEEE

Abstract—A fundamental finding in computer science is that In order to answer the above question, this paper explores
software, an artifact of human creativity, is not constrained by the the informatics and semantic properties and laws of software,
laws and properties known in the physical world. Thus, a natural as well as their mathematic models. The metaphors and basic
question we have to ask is “what are the constraints that soft-
ware obeys?” This paper attempts to demonstrate that software characteristics of software are examined in Section II. A set
obeys the laws of informatics and mathematics. This paper ex- of 19 informatics laws of software is derived in Section III.
plores a comprehensive set of informatics and semantic properties Then, the semantic laws of software are developed on the basis
and laws of software as well as their mathematical models. In order of a novel formal semantics known as deductive semantics in
to provide a rigorous mathematical treatment of both the abstract Section IV, which rigorously interpret and analyze the meanings
and concrete semantics of software, a new type of formal seman-
tics known as the deductive semantics is developed. The deductive and behaviors of software.
models of semantics, semantic function, and semantic environment
at various composing levels of programs are formally described.
The findings of this paper can be applied to perceive the basic
II. FUNDAMENTAL CHARACTERISTICS OF SOFTWARE
characteristics of software and the development of fundamental In order to reveal the fundamental characteristics of software,
theories that deal with the informatics and semantic properties of this section explores basic perceptions or metaphors of soft-
software.
ware. In contrast to the conventional mathematics or product
Index Terms—Cognitive informatics, constraint laws of soft- metaphors, an information metaphor is introduced that identi-
ware, deductive semantics, foundations, informatics properties, fies software as instructive and behavioral information.
metaphors on software, semantic analysis, software engineering.

A. Metaphors of Software
I. INTRODUCTION
The nature of software has been perceived quite differently
T IS recognized that matter, energy, and information are the
I three essences of the natural and abstract worlds [17], [18]. In
a modern society, information plays an increasingly important
in the research and practice of computing and software engi-
neering. The following metaphors have been reported in the
literature.
role because it is the only link between the physical (external) 1) Software is a mathematical entity [6], [9].
and the abstract (internal) worlds in human life. In cognitive 2) Software is a concrete product [10], [11], [15].
informatics [17], [18], software is perceived as a type of in- 3) Software is a set of behavioral instructions to computers
structive and behavioral information that describes a solution and a coded solution to given problems [18], [22].
for the design and implementation of a computing system. The following subsections analyze the basic characteristics of
A fundamental finding in computer science and software engi- a software in terms of the mathematics, product, and informatics
neering is that software, as a unique entity, is not constrained by metaphors.
any law or principle known in the physical world [7], [11], [17]. 1) Mathematical Metaphor of Software: The mathematical
Therefore, we have to ask the following question: What kind of metaphor of software has been adopted by some computer sci-
constraints does software obey? entists who perceive software as a stored programmed logic on
This paper attempts to demonstrate that software obeys the computing hardware [1], [4] or a mathematical entity [9].
laws of informatics [18], [22], because software is a mathemat- A general taxonomy of the usages of computational mathe-
ical entity and a kind of instructive and behavioral information matics can be derived on the basis of their relations with nat-
that we use to communicate with computers as the servers, to ural languages. It is recognized that language is the means of
provide specified functionality for users of the computing sys- thinking. Although natural languages can be rich, complex, and
tem [17]. However, by answering the above question, another powerfully descriptive, they share the common and basic mech-
important question comes up: What are the laws of informatics anisms [19], [22] in three functional categories known as “to be
that constrain software in computing and software engineering? (| =),” “to have (| ⊂),” and “to do (| >)” as shown in Table I.
All mathematical means and forms, in general, are an ab-
stract description of these three categories of human or system
Manuscript received January 6, 2004; revised September 26, 2004. This work
was supported in part by the Natural Sciences and Engineering Research Council behaviors and their common rules. By taking this into view,
of Canada. This paper was recommended by Guest Editor W. Kinsner. mathematical logic may be perceived as the abstract means for
The author is with the Theoretical and Empirical Software Engineering Re- describing to be, set theory for describing to have, and algebras,
search Center, University of Calgary, Calgary, AB T2N 1N4, Canada (e-mail:
yingxu@ucalgary.ca). particularly the process algebra, for describing to do. A descrip-
Digital Object Identifier 10.1109/TSMCC.2006.871138 tive mathematic means in the third category, known as real-time
1094-6977/$20.00 © 2006 IEEE
162 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART C: APPLICATIONS AND REVIEWS, VOL. 36, NO. 2, MARCH 2006

TABLE I
FUNDAMENTAL ELEMENTS IN NATURAL LANGUAGES

process algebra (RTPA), has been developed in [16] for a formal


and rigorous treatment of human and software system architec-
tures and behaviors [19], [21]–[23].
2) Product Metaphor of Software: In the IT industry, soft-
ware is perceived broadly as a concrete product [11], [15]. With
the product metaphor, a number of manufacturing technologies
and quality assurance principles were introduced into software
engineering. However, the phenomenon that we are facing, al-
most all the same problems in software engineering as we dealt
with 40 years ago, indicates a failure of the manufacture-based
and mass-production-oriented metaphor and related technolo-
gies in software development. Therefore, we have to rethink the Fig. 1. Engineering objective model.
nature of software and how we produce software in software
engineering.
There are three generic engineering goals, known as effi- Because software engineering is a branch of engineering dis-
ciency, productivity, and quality. These generic goals can be ciplines, it obeys the generic engineering rules of Theorem 1.
described by a triangular engineering objective model (EOM), There are a number of goals proposed in software engineer-
as shown in Fig. 1 [22]. In the EOM model, each of the three ing [11], [15], such as to improve customer satisfaction, ensure
generic goals obeys a basic constraint for engineering organiza- quality, reduce time to market, decrease costs and effort, improve
tion and practice in terms of costs, time, and utility, respectively. process capability, enhance reliability/dependability/code sta-
It is found, unfortunately, the three basic goals in engineering bility, provide better services, minimize defects, increase project
are contradictive. It is difficult to achieve them all at the same estimation accuracy, and obtain better maintainability. However,
time within a given engineering context, or there is always a productivity, efficiency, and quality as identified in EOM are the
need for tradeoffs between these goals. most fundamental categories of goals that dominate the individ-
This observation on the EOM model as shown in Fig. 1 leads ual ones in software engineering.
to the following theorem [22]. In the EOM model, productivity is the principal objective and
Theorem 1: The law of conservation of basic engineering major purpose of any engineering discipline. The improvement
constraints states that the three constraints of the basic objec- of productivity is the key to achieve other engineering goals by
tives of engineering time (T ), costs (C), and utility (U ) are technical innovation, i.e., by increasing δ as described in (1). For
conservative in a given engineering context, i.e., example, the automatic exchanger revolutions in the telecom-
munication industry in the 1940s and 1990s show how enhance-
U
ft (T −1 ) + fc (C −1 ) + fu (U ) = k ≡δ (1) ment of productivity by technical innovation may increase δ.
TC Therefore, it is inevitable that software engineering should set
where k and δ are constants. ⵧ its paramount goal on the improvement of productivity in soft-
Theorem 1 explains that the three basic engineering con- ware development by intelligent tools rather than human labor.
straints cannot be achieved to their maximum at the same 3) Informatics Metaphor of Software: Information is the
time in a given engineering context. That is, any pair of con- third essence in modeling the natural world in addition to matter
straints among the three may be achieved in the sacrifice and energy. In cognitive informatics [17], [18] it is recognized
or tradeoff of the remainder. For example, the reduction of that human beings live in a dual world. One aspect of it is
time (T ) and expectations of better result (U ) will increase the physical or the concrete world; the other is the abstract or
costs (C). the perceived world. We use matter and energy to model the
WANG: INFORMATICS LAWS AND DEDUCTIVE SEMANTICS OF SOFTWARE 163

nature and basic properties of software in software engineer-


ing. Definition 2 also indicates that the current philosophy and
methodology using manufacturing quality control principles in
organizing and managing software engineering as mass man-
ufacturing processes are perhaps fundamentally mismatching.
Therefore, the processes and techniques widely used in the pub-
lishing and journalism sectors are worth to be intensively studied
and adopted in software engineering on the basis of the infor-
matics metaphor of software.
Fig. 2. IME model of the world view.

former and information to model the latter. An information- B. Software as Instructive and Behavioral Information
matter-energy (IME) model, as shown in Fig. 2, is developed to A software system can be perceived as a virtual agent of
describe the generic view toward the physical and information human beings created to do something repeatable, to extend
worlds [18]. human capability, reachability, and/or memory capacity. The
Models of the natural world have been well studied in physics author found that both human and software behaviors can be
and other natural sciences. Relationships between matter and en- described by a three-dimensional (3-D) representative model
ergy have been investigated and revealed by Albert Einstein and comprising of action, time, and space. For software system
other scientists. However, the modeling of the abstract world is behaviors, the three dimensions are known as mathematical
still a fundamental issue yet to be explored in informatics, com- operations, event/process timing, and memory manipulation
puting, software science, cognitive science, and life sciences. [16], [19].
The relationships between I-M-E and their transformations are For explaining the information nature of software, let us con-
especially perceived as one of the fundamental questions in sider when one needs a software system in particular, and a
cognitive informatics. It is believed that any breakthrough in computing solution in general.
this area will profoundly facilitate the development of next gen- Theorem 2: The need for software is necessarily and suffi-
eration technologies in informatics, computing, software, and ciently determined by the following three conditions
cognitive sciences. 1) Repeatability: Software is required when one needs to do
Definition 1: Information in cognitive informatics is defined something for more than once.
as abstract artifacts and their relations that can be modeled, 2) Flexibility or programmability: Software is required when
processed, and stored by human brains. one needs to repeatedly do something not exactly the same.
The content of information in cognitive informatics is mea- 3) Run-time determinability: Software is required when one
sured by the cost of code to abstractly represent a given size of needs to flexibly do something by a series of choices on
message M in a digital system based on a constant k [18], i.e., the basis of varying sequences of events determinable only
Ik = f : M → Sk = logk M (2) at run-time. ⵧ
Theorem 2 describes that the above three situations, namely
where Ik is the content of information in a k-based digital system repeatability, flexibility, and runt-time determinability, form the
and Sk the measurement scale based on k. The unit of Ik is the necessary and sufficient conditions that warrant the requirement
number of k-based digits. for a software solution in computing [22].
Equation (2) is a generic information size measurement. Repeatability is one of the most premier needs for a software
When a binary digital representation system is adopted, i.e., solution, but it is not the only sufficient condition for demand-
k = b = 2, it becomes the most practical one: ing a software system, because repeatability may also be im-
plemented by wired logic or hardware. Therefore, the flexibility
Ib = f : M → Sb = log2 M [bit] (3)
and run-time determinability, particularly the latter, are neces-
where the unit of information Ib is a bit. Note that the bit here sary and sufficient for the usage of software. The third situation
is concrete and deterministic, and it no longer possesses a prop- may be also considered as the nondeterminism at compile-time
erty as a value of weighted probability as that in the classical or design-time. This property of software is the fundamental
informatics [18]. issue in computation that constitutes the complexity of pro-
Software, in daily life, is simply meant as anything flexi- gramming [4], [22]. In conventional engineering disciplines,
ble and without a physical dimension. In cognitive informatics, the common approach moves from abstract to concrete, and the
software can be defined as follows: final product is the physical realization of a design blueprint. In
Definition 2: Software is a kind of coded and instructive in- software engineering, however, the approach is reversed. The
formation that describes the algebraic process logic of software final software product is the virtualization and abstraction of a
system architectures and behaviors in computing. set of original real-world requirements by binary streams. The
This definition indicates a new way to explain the laws and only tangible part of a software system is its storage media or
properties that govern the behavior of software. That is, the its run-time behaviors. This is probably the most unique and
informatics metaphor provides a new approach to study the interesting feature of software engineering.
164 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART C: APPLICATIONS AND REVIEWS, VOL. 36, NO. 2, MARCH 2006

According to cognitive informatics [18], information is any The human brain consists of about 100 billion (100 × 109 )
property or attribute of entities in the natural world that can be neurons, and each of them has hundreds to thousands of synapses
abstracted, digitally represented, and mentally processed. For (relations) connecting to various subsets of related neurons [20].
software engineering to become a matured engineering disci- Thus, according to (4), the upper limit of potential connections
pline like others, it must establish its own laws and theories, of the neural clusters in the brain is in the order of
which are perceived to be relied on cognitive informatics. n! 1011 !
C kn = = 3 ≈ 108432 . (5)
k!(n − k)! 10 ! × (1011 − 103 )!
III. INFORMATICS LAWS OF SOFTWARE This result is an astonishing finding [20], [22] that shows the
The informatics laws that constrain software can be explored capacity and complexity of the brain is on a magnitude we might
by investigating the properties and basic principles of cognitive only find in the universe. However, it indeed also interestingly
informatics. This section describes the fundamental properties exists in our internal world—the brain.
and laws of information that software and software behaviors Property 3 (Cumulativeness): The natural world is conser-
obey. Some of the properties may not be necessarily compli- vative. According to the natural law of conservation, matters
cated, but are profound in describing the axiomatic theory of and energies can neither be reproduced nor destroyed (but they
software engineering. may be transformed). However, information is not conservative
Property 1 (Abstraction): Information is abstract artifacts but cumulative, because information may be created, destroyed,
that are elicited from physical entities in the natural world and reproduced. The cumulativeness of information is the most
or are created for representing relations between these entities significant attribute of information that mankind relies on in
or the entities and abstract mental objects. Information can be evolution.
attributes, status, characteristics, structures, and dynamic pro- Property 4 (Dependency on Cognition): Information should
cesses of real-world entities, as well as relations between them. be recognized and consumed by human brains or other intelli-
New information—may be derived based on existing informa- gent systems by a cognitive process before it can be effectively
tion and their relations in the abstract world [18]. retained, retrieved, and used. According to the OAR model [20],
Therefore, although it can be recorded, transformed, and com- information is represented internally by its relations with exist-
municated, information is the product of the brain and it exists ing information and knowledge in the brain. Without cognition
in the abstract world. The IME model presented in Section II and comprehension, there is no information and knowledge, as
and the object–attribute–relation (OAR) model of internal infor- well as no access and retrieval of them.
mation representation in the brain developed in [20] provide a Property 5 (3-D Behavior Space): Information can be mod-
generic view about the abstractive property of information and eled by four independent factors known as the subject (O),
its relationship with the real-world entities. behavior (B), space (S), and time (T ). That is, information (I)
Property 2 (Generality): According to Property 1 (abstrac- can be determined by a 4-tuple
tion) and the OAR model [20], it can be derived that sources I = (O, B, S, T ) (6.1)
of information are widely general. Information can be elicited
from objects, attributes, and their relations. Any physical en- where behavior B is a set of observable events, actions, and
tity in the universe is the source of information, and any outcomes.
abstract artifact (object) is the crystallization of informa- When the subject O is obvious, the information related to
tion. Therefore, information is formed by a combination be- O, IO , can be simplified as a triple
tween physical entities, abstract objects, and relations between
IO = (B, S, T ). (6.2)
them, i.e.,
1) abstraction of physical entities and their attributes; Therefore, software as instructive information, Is , can be
2) relations between physical entities; modeled in a 3-D behavioral space Ω, i.e.,
3) relations between physical entities and abstract objects;
Is = Ω = (B, S, T ) (6.3)
4) relations between abstract objects.
Hence, in a certain extent, cognitive informatics studies the where B is a finite set of operations.
sources and initiation of information as well as the creation and Property 6 (Sharability): Information can be shared and
perception of information by human cognitive processes. reused by multiple users without loss in quantity and with-
It is realized in cognitive informatics that relations are infor- out degradation in quality. Information may be amplified
mation too. Although the number of the physical entities of the or multiplied by broadcasting. The lossless reuse of exist-
real-world is limited, their potential relations may result in an ing information will usually result in the creation of new
explosive exponential combination, i.e., information.
Property 7 (Dimensionless): Related to Property 1 (abstrac-
n! tion), information has no physical size and dimension. No matter
C kn = (4)
k!(n − k)! how large or small of the physical entities, their conceptual ab-
straction is only one unit. Their abstract representations or the
where n is the total number of objects and k is the number of cognitive visual objects occupy a similar sight frame; only the
average connections between the objects. resolutions may be varying [17].
WANG: INFORMATICS LAWS AND DEDUCTIVE SEMANTICS OF SOFTWARE 165

Property 10 (Multiple Representation Forms): Related to


Property 1 (abstraction) and Property 2 (generality), it is ob-
served that information can be represented in multiple forms,
such as analog (audio, visual), abstract (written languages and
notation systems), and digital.
In the above classification, digitalization in information rep-
resentation is the most generic and fundamental approach. The
cognitive foundation of digitalization is that information is rep-
resented discretely or granularly in the brain with the basic unit
as individual neurons. Therefore, the discrete representability is
the foundation of information representation, storage, and pro-
cessing. It is also the foundation of modern digital multimedia
information engineering.
Fig. 3. Transformability between I-M-E.
Property 11 (Multiple Carrying Media): Parallel to Property
10 (multiple representation forms), information can be carried
by various media, and their combinations, such as electronic,
Property 8 (Weightless): A direct corollary based on Prop- electrical, magnetic, optical, mechanic, hydraulic, written, oral,
erty 7 (dimensionless) is that the weight of information, Wi , is and signs.
always zero, i.e., It is noteworthy that a certain medium may carry one or
more forms of information, and correspondingly, a given form
Wi ≡ 0. (7) of information may be carried by different media.
Property 12 (Multiple Transmission Forms): In addition to
This explains why an empty or full hard disk has the same
this information may be represented in multiple forms (Property
weight; a blank or recorded tape has no difference in weight;
10) and carried by various media (Property 11), its transmission
and a memory chip storing all 0s, all 1s, or any combinations
can be conducted in multiple forms as well. Following are the
of them has the same weight. This property of information can
possible transmission forms of information:
also explain why one can afford to do a Ph.D. without feeling
any change of the weight of the brain, rather than the changes
of its internal configurations. Information passing: 1 to 1
Property 9 (Transformability Between I-M-E): According to Information broadcasting: 1 to n
the IME model [18], the three essences of the world are pred-
icated to be transformable between each other as shown in Information gathering: n to 1
Fig. 3. Information networking: n to m (9)
There are six possible relations between the three essences
in the natural and information worlds. These relations can be
where 1 represents a single information source/receiver, n and
described by the following generic functions f1 to f6 :
m indicate multiple ones, and n and m can be the same.
I = f1 (M ) (8.1) The fast development of the Internet indicates that the fourth
form of information transmission, information networking, is
M = f2 (I) = f1−1 (I)
?
(8.2) the highest form of communications.
Property 13 (Dependency on Media): Information cannot ex-
I = f3 (E) (8.3)
ist without a storage medium. The types of media may be or-
E = f4 (I) = f3−1 (I)
? ganic, physical, chemical, or combinations of these as described
(8.4)
in Property 11. Therefore, in some extent, information may be
E = f5 (M ) (8.5) perceived as a change of status of the storage medium.
M = f6 (E) = f5−1 (E) (8.6) Property 14 (Dependency on Energy): All information pro-
cessing tasks, such as acquisition, storage, retain, retrieve, and
where the question mark denotes an uncertainty if there exists refresh, consume certain energy. There is no system that may
such a reverse function. process information without consuming energy. Therefore, in
Albert Einstein has revealed functions f5 and f6 , the rela- some extent, information may also be perceived as a change of
tionship between matter (m) and energy (E) : E = mC 2 . It is status of energy on a given medium.
a great curiosity to explore what the remaining relationships Property 15 (Wearless and Time Dependency): The logic of
and forms of transformation between I-M-E will be. In a cer- formal information, such as special notation systems, mathe-
tain extent, cognitive informatics is the science to seek possible matics, and philosophies as described at the abstract cognitive
solutions for f1 –f4 . A clue to explore the relations and trans- levels 3–5 in [22], does not wear out. Once the logic of a specific
formability is believed in the understanding of the natural in- piece of information is true, it remains so for eternity. However,
telligence and information processing mechanisms in cognitive the timeliness of informal information is much shorter, i.e., such
informatics. kind of information may be out of date quickly.
166 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART C: APPLICATIONS AND REVIEWS, VOL. 36, NO. 2, MARCH 2006

Property 16 (Conservation of Information and Thermal En- more carefully, and fault-tolerant and security techniques should
tropy): The law of thermodynamics that deals with the natural be always adopted in dealing with information distortion.
tendency of heat can be described as follows [3]. Property 19 (Scarcity): The principle of information scarcity
Theorem 3: The second law of thermodynamics states that states that information when needed is always inadequate, con-
a) entropy of the universe ∆Hu does not change when a re- strained by its availability, awareness, and/or the cost and com-
versible process occurs, i.e., ∆Hu = 0; b) entropy of the uni- plexity to thoroughly search, acquire, and comprehend it.
verse ∆Hu increases when an irreversible process occurs, i.e., Theorem 4: The principle of universal constraints states that
∆Hu > 0. ⵧ both the natural world and the perceived abstract world are
Because entropy can be interpreted in terms of disorder, when constrained by certain known or yet to be known restrictions
an irreversible process occurs and the entropy of the universe and lawsbecause of the limitations of natural resources and/or
increases, the energy available for doing work decreases. human cognitive capability.
There are two types of entropies: thermal and information According to the principle of universal constraints, any theory,
entropy. The former exists in a physical system, and the latter method, or technology has its own limitations and constraints.
exists in an animate system, such as the brain and a human In a certain extent, science and engineering are the search of the
society. The second law of thermodynamics asserts that the maximum extent of general relations between entities, phenom-
thermal entropy in a closed physical system is conservative. ena, and behaviors under a set of constraints.
Hence, an extended form of the second law of thermodynamics Theorem 4 will be found useful in a number of disciplines,
can be stated that in a hybrid system, the sum of the information such as the law of conservation of basic engineering constraints,
entropy Hi and the thermal entropy Ht is a constant, i.e., the principle of generic constraints in systems theory, the princi-
ple of bounded rationality in decision theories, and the principle
kt Ht + ki Hi = ε (10) of resource scarcity in economics.

where kt , ki , and ε are constants for a given system. Equation IV. DEDUCTIVE SEMANTICS OF SOFTWARE
(10) indicates that for the deduction of the thermal entropy of a
The semantic properties of software are formal interpretations
system, the information entropy has to be increased. Therefore,
of software behaviors and constraint laws. Basic semantics of a
the information entropy is also perceived as the negative entropy
programming language can be described by its behavioral equiv-
In a physical system, entropy can be reduced by input of energy
alency to another language, for example, a natural language or a
in order to maintain the order of the system. In neural and social
target language. Semantics can also be described by a set of pre-
systems, the order and the state of organization can be increased
defined executable functions in machine languages. The third
by inputting information.
approach to specify the semantics of a programming language
Property 17 (Quality Attributes of Informatics): On the
is by mathematical models known as the formal semantics, such
basis of the conventional product-based metaphor [15], the
as the operational [10], [14], denotational [2], [12], [13], ax-
quality of software is perceived as a collection of attributes,
iomatic [6], [8], and algebraic [5], [14] semantics.
such as usability, availability, reliability, portability, and main-
Definition 3: The semantics of a program in a given program-
tainability. Quality software is commonly considered as the
ming language is the logical consequences of an execution of
software that contains fewer bugs. However, the concept of
the program that results in the changes of values of a finite set
quality itself has never been properly defined in software
of variables in the underlying computing environment.
engineering.
The mathematical models of the target machines and the se-
To model the quality of software and information, a set
mantic environments in conventional semantics seem to be inad-
of informatics-based quality attributes are introduced such as
equate to deal with the semantics of complex programming re-
completeness, correctness, consistency, properly represented
quirements and to express some important instructions, complex
(no misinterpretation), clearness (no ambiguity), feasibility (can
control structures, and the real-time environments at run-time.
be implemented in technical and economical terms), and verifi-
In order to provide a rigorous mathematical treatment of both
ability (attributes specified can be measured).
the abstract and concrete semantics of software, a new type of
From this new angle, software quality can be defined as the
formal semantics known as deductive semantics, which provides
achievement of the above inherent attributes for software archi-
a systematic semantic deduction methodology, is developed in
tectures, static behaviors, and dynamic behaviors.
this section.
Contrasting the above two approaches toward software qual-
ity, it can be seen that the former is a set of external quality
A. Mathematical Model of Programs
attributes and the latter is a set of internal ones. The internal
quality attributes should be focused and controlled first in soft- Prior to developing a deductive semantic model of software,
ware engineering. Otherwise, it would be too late to examine necessary notations and mathematical models of program and
the external quality attributes, because this may only be carried its supporting platform need to be studied. This section intro-
out after a software system has already been built. duces the big-R notation and the mathematical notion on partial
Property 18 (Susceptible to Distortion): Unlike physical en- differential of sets. Then, hierarchical and compositional model
tities, information is more fragile and vulnerable to distortion, of programs and an abstract logical model of system platforms
decay, and destruction. Therefore, information should be treated are developed.
WANG: INFORMATICS LAWS AND DEDUCTIVE SEMANTICS OF SOFTWARE 167

1) Mathematical Preparations: In order to develop the TABLE II


RTPA META PROCESSES
mathematical models of semantics and semantic environments,
some special notations and operators are introduced to establish
the fundamental expressive power required in semantic denota-
tions and analyses. One of the important notations is the big-
R notation for describing both repetitive behaviors and recur-
ring architectures [16], [21]. The big-R notation was introduced
first in the RTPA [16], intending to provide a unified and ex-
pressive mathematical treatment for iterations and recursions in
computing.
Definition 4: The big-R notation is a mathematical operator
that is used to denote a) a set of repetitive behaviors or (b) a
finite set of recurring architectural constructs of computing, in
the following forms:
RF
expBL=T P (11.1)
RniN=1 P (i) (11.2)
where BL and N are the type suffixes of Boolean and integer
variables, respectively, as defined in RTPA. Other type suffixes
that are used in this paper are string (S), pointer (S), hex-
adecimal (H), time (TM), interrupt (), run-time type (RT),
system type (ST), and the Boolean constants (T) and (F) [16].
Example 1: The architecture of a 2-D array with n × m in-
teger elements, An m , can be denoted by the big-R notation as
follows:
−1 m −1
An m = Rni=0 Rj =0 A[i, j]N. (12)
Because the big-R notation provides a powerful and expres-
2) Compositional Model of Programs: The semantics of a
sive means for denoting iterative and recursive behaviors and
program in a given language can be described and analyzed
architectures of systems or human beings, it is a general mathe-
at various composition levels, such as those of statement, pro-
matical calculus for system modeling in terms of repetitive to do
cess, and system from the bottom-up, according to the hierar-
and recurrent
 to  be, respectively [16], [19], [21]. From this point
chical architecture of the program. It is noteworthy that a state-
of view, and are special cases of the big-R for repetitively
ment is the minimum unit of semantics at the most fundamental
doing additions and multiplications, respectively.
level of programming. If the semantics of all fundamental in-
In deductive semantics, another operator introduced is the
structions (known as the meta processes in RTPA) [16], [22]
partial differential of sets that is used to facilitate the instantia-
and their relational composition rules (known as the process
tion of abstract semantics by concrete ones.
relations in RTPA) in a given language can be defined, se-
Definition 5: A partial differential of a set U on a subset X
mantics of the process and program at the higher levels can
with elements x, x ∈ X ⊆ U , denoted by ∂U/∂x, is a selection
be derived via mathematical deduction. This is the foundation
of interested elements from U as specified in X, i.e.,
of program composition, which will be formally described in
∂U Section IV-B-2.
= X, x ∈ X ⊆ U. (13)
∂x Definition 6: A statement p in a program is an instantiation
The partial differential operation of sets can be easily ex- of a meta instruction of a programming language that executes
tended to double or multiple partial differentials. For example, a basic unit of coherent function and leads to a predictable
behavior.
A set of 16 meta instructions in computing, as shown in
∂2 ∂U ∂U Table II, has been identified and elicited in RTPA known as
U= × = X × Y,
∂x∂y ∂x ∂y the meta processes [16]. Although, existing programming
x∈X ⊆U ∧y ∈Y ⊆U (14) languages may implement a larger set of instructions, the
additional ones are logical combinations of these 16 essential
3
∂ ∂U ∂U ∂U meta processes.
U= × × = X × Y × Z,
∂x∂y∂z ∂x ∂y ∂z A process at the component level is composed of individual
x∈X ⊆U ∧y ∈Y ⊆U ∧z ∈Z ⊆U statements with given rules of composition.
Definition 7: A process P is a composed component in a pro-
(15) gram that forms a logical combination of n meta statements pi
where × is a Cartesian product. and pj , 1 ≤ i < n, 1 < j ≤ n, according to certain composing
168 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART C: APPLICATIONS AND REVIEWS, VOL. 36, NO. 2, MARCH 2006

TABLE III mathematical models of deductive semantics and elicit the fun-
RTPA PROCESS RELATIONS
damental properties of software semantics.
Definition 9: Deductive semantics is a formal software se-
mantics that deduces the semantics of a program in a given
programming language from a generic abstract semantic func-
tion to the concrete semantics, which are embodied onto the
changes of status of a finite set of variables constituting the
semantic environment of computing.
Deductive semantics perceives that the carriers of software
semantics are a finite set of variables declared in a given pro-
gram. Therefore, program semantics can be reduced onto the
changes of values of these variables.
1) Mathematic Model of Deductive Semantics: The seman-
tic environment constituting the behaviors of software is inher-
ently a 3-Dstructure as described in Property 5 (see Section III).
Definition 10: The behavioral space Ω of a program executed
on a certain machine is a finite set of variables operated in a 3-D
state space determined by a 3-tuple, i.e.,
Ω = (B, S, T ) = B × S × T (18)
where B is a finite set of operations, S is a finite set of memory
locations or their logical representations by identifiers of vari-
ables, and T is a finite set of discrete steps of program execution.
According to Definition 10, the variables of a program S
play an important role in semantic analysis, because they are
the objects of software behaviors and the carriers of program
semantics. On the basis of the definition of software behavioral
space, the semantic environment of software can be introduced
as follows.
Definition 11: The semantic environment Θ of a program
on a certain target machine is its run-time behavioral space Ω
relations rij , i.e., projected onto the Cartesian plane determined by T and S, i.e.,
−1
P = Rni=1 (pi rij pj ), j =i+1 ∂2Ω ∂2
Θ= = (B × T × S) = T × S. (19)
= (. . . (((p1 )r12 p2 )r23 p3 ) . . . rn −1,n pn ) (16) ∂t∂s ∂t∂s
where rij is a set of relations or composing rules. As indicated in Definition 11, the semantic environment of
A comprehensive set of these composing rules has been iden- a program is dynamic, because following each execution of a
tified and elicited in RTPA known as process relations [16], [22] statement in the program, Θ, particularly the set of variables S
as provided in Table III. and their values V , may be changed.
Definition 8: A program ℘ is a composition of a finite set of In the semantic analysis, the changed part of the semantic
k processes at the component level according to certain process environment Θ is particularly interesting, because it is the em-
dispatching rules, i.e., bodiment of software semantics. We now develop a generic
semantic function, which can be used to derive a specific and
|
℘ = Rki=1 (@ei → , Pi ) (17) concrete semantic function for a given statement, process, or
program by mathematical deduction.
|
where → denotes a process dispatch according to a predes- Definition 12: A semantic function of a program ℘, fθ (℘),
ignated event @ei , which is an external, a system timing, or is a finite set of values V determined by a Cartesian prod-
interrupt event [16]. uct on a finite set of variables S and a finite set of executing
According to Definitions 7 and 8, a program can be reduced steps T , i.e.,
to the composition of a finite set of processes at the component fθ (℘) = f℘ : T × S → V
level. Then, each of the processes can be further reduced to the
composition of a finite set of statements at the bottom level. = v℘ (t, s), t ∈ T ∧ s ∈ S ∧ v℘ ∈ V
 
s1 s2 · · · sm
B. Deductive Semantic Model of Software  t0 ⊥ ⊥ ··· ⊥ 
 
= .
t1 v11 v12 v1m  (20)
.. 
Deduction is a reasoning process that discovers new knowl-
 .. .. ..
. 
..
edge or derives a specific conclusion based on generic premises . . .
such as abstract rules or principles. We now develop the tn vn 1 vn 1 ··· vnm
WANG: INFORMATICS LAWS AND DEDUCTIVE SEMANTICS OF SOFTWARE 169

where T = {t0 , t1 , . . . , tn }, S = {s1 , s2 , . . . , sm }, and V is a given language can be described and analyzed at various com-
set of values v℘ (ti , sj ), 0 ≤ i ≤ n and 1 ≤ j ≤ m. position levels, such as those of statement, process, and system
In (20), all values of v℘ (ti , sj ) at t0 are undefined for a pro- from the bottom-up.
gram as denoted by the bottom symbol ⊥, i.e., v℘ (0, sj ) = Definition 13: The semantics of a statement p, θ(p), on
⊥, 1 ≤ j ≤ m. However, for a statement or a process, it is usu- a given semantic environment Θ is a double partial differ-
ally true that v℘ (0, sj ) = ⊥ depends on the context of previous ential of the semantic function, fθ (p) = fp : T × S → V =
statement(s) or the initialization of the system. vp (t, s), t ∈ T ∧ s ∈ S ∧ vp ∈ V , on the sets of variables S and
2) Properties of Software Semantics: Observing the formal executing steps T , i.e.,
definitions and mathematical models of deductive semantics de-
∂2 ∂2
veloped in previous sections, a number of common properties θ(p) = fθ (p) = vp (t, s)
of software semantics may be elicited, which are useful for ex- ∂t∂s ∂t∂s
#T (p) #S (p)
plaining the fundamental characteristics of software semantics. = Ri=0 Rj =1 vp (ti , sj )
One of the most interesting characteristics of program se-
#{s ,s2 ,...,sm }
mantics is its invariance against different executing speeds as = R1i=0 Rj =11 vp (ti , sj )
described in the following theorem.  
s1 s2 ··· sm
Theorem 5: The semantics of a program are invariant with
=  t0 v01 v02 ··· v0m  (21)
the changes of executing speed, as long as any absolute time
(t0 , t1 ] v11 v12 ··· v1m
constraint is met. ⵧ
Theorem 5 asserts that different executing speeds or simu- where t denotes the discrete time immediately before and after
lation paces will not alter the semantics of a software system. the execution of p during (t0 , t1 ], and # is the cardinal calculus
This explains why a programmer may simulate the run-time be- that counts the number of elements in a given set, i.e., n =
haviors of a given program executing at a speed of up to 109 #T (p) and m = #S(p).
times faster than that of human beings. It also explains why In Definition 13, the first partial differential selects all related
computers with different system clocks may correctly run the variable S(p) of the statement p from Θ. The second partial
same program and perform the same behavior. differential selects a set of discrete steps of p s execution T (p)
The meta instructions shared by all programming languages from Θ. According to Definition 13, the semantics of a statement
can be classified into three categories: 1) internal operations, can be reduced onto a semantic function that results in a 2-D
such as memory manipulation and assignments; 2) external matrix with the changes of values for all variables over time
operations, such as input/output, event handling, and human- with program execution.
machine interactions; and 3) basic control structures (BCSs) On the basis of Definitions 12 and 13, semantics of individual
[16], [22], such as jump, branch, and iteration constructs as statements can be analyzed using (21) via a deductive process.
shown in Table III. 1) Example 2: Analyze the semantics of Statement 3 in the
Theorem 6: A program is compossible in a given language iff following program entitled sum:
both sufficient sets of meta instructions and BCSs are rigorously
defined in the language. ⵧ void sum:
Theorem 6 indicates that the necessary and sufficient con- {
ditions of program compositionality in a given language are (0) int x, y, z;
that all the meta instructions (Table II) and fundamental BCSs (1) x = 8;
(Table III) must be implemented in the language. In case of non (2) y = 2;
real-time programming languages, the requirement for the four (3) z := x + y;
special BCSs, BCSs #10–#13, may be waived. However, it is }
helpful to be aware of the whole set of software compositional
rules for both ordinary and real-time software systems. According to Definition 13, the semantics of Statement 3 are
It is noteworthy that some of the BCSs as shown in Table III as follows:
are used to be treated as basic instructions rather than com-
∂2 ∂2
positional rules. According to Theorem 5, there is a need to θ(p3 ) = fθ (p3 ) = vp (t, s)
∂t∂s ∂t∂s 3
distinguish the semantic roles of statements (the minimum se-
#S (p 3 )
mantic unit of a language) and BCSs (the compositional rules = R3i=2 Rj =1 vp 3 (ti , sj )
of the language). #{x,y ,z }
= R3i=2 Rj =1 vp 3 (ti , sj )
 
C. Formal Description of Software Behaviors by x y z
Deductive Semantics = t2 8 2 ⊥ . (22)
(t2 , t3 ] 8 2 10
The behavior of a computational statement is a set of ob-
servable actions or changes of status of objects operated by the This example shows how the concrete semantics of a statement
statement. According to the architectural model of programs as can be derived on the basis of the generic and abstract function
described in Section IV-A2, the semantics of a program in a of deductive semantics.
170 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS—PART C: APPLICATIONS AND REVIEWS, VOL. 36, NO. 2, MARCH 2006

According to Definitions 7 and 8, a program or a process is


composed of individual statements with given rules of compo-
sitions. Therefore, the definitions and mathematical models of
semantics at the statement level can be extended onto the higher
levels of program hierarchy.
Definition 14: The semantics of a process P, θ(P ), on a given
semantic environment Θ is a double partial differential of the
semantic function fθ (P ) on the sets of variables S and executing
steps T , i.e.,

∂2 Fig. 4. Semantic diagram of sequential processes.


θ(P ) = fθ (P )
∂t∂s

2
2
n −1 ∂ ∂ A semantic diagram of the sequential process relation as de-
= Rk =1 fθ (Pk ) rk l fθ (Pl ) ,
∂t∂s ∂t∂s fined in (24) is illustrated in Fig. 4 on the semantic environment
Θ, where SP Q is the set of shared or global variables of state-
l =k+1
  ments P and Q.
−1 #T (P ) #S (P )
= Rnk =1 Ri=0 k Rj =1 k vP k (ti , sj ) Definition 14 can be applied to derive the deductive semantics
  of any complex process built by the compositional rules as listed
#T (P ) #S (P ) in Table III. Then, the semantics of a program can be deduced to
rk l Ri=0 l Rj =1 l vP l (ti , sj )
the combination of semantics of a set of processes, each of which
V VG  can be further deduced to the composition of all statements’
p1
 Vp2 VG  semantics as described in Definition 15.
=
 .. .. 
 (23) Definition 15: The semantics of a program ℘, θ(℘), on a
. .
given semantic environment Θ, is a combination of the semantic
Vpn −1 VG
functions of all processes θ(Pk ), 1 ≤ k ≤ n, i.e.,
where Vpk , 1 ≤ k ≤ n − 1, is a set of values of local variables ∂2
#K (℘)
that belongs to processes Pk , and V G is a finite set of values of θ(℘) = Rk =1 fθ (℘)
∂t∂s
global variables.
#K (℘)
Example 3: The semantics of the sequential relations of pro- = Rk =1 θ(Pk )
cesses in RTPA, θ(P → Q), is a double partial differential of  
#K (℘) #T (P ) #S (P )
the semantic function fθ (P → Q) on the sets of variables S and = Rk =1 Ri=0 k Rj =1 k vP k (ti , sj ) (25)
executing times T , i.e.,
where #K(℘) is the number of processes or components in the
∂2 program.
θ(P → Q) = fθ (P → Q) It is noteworthy that (25) will usually result in a very large
∂t∂s
matrix of semantic space, which can be quantitatively predicated
∂2 ∂2
= fθ (P ) → fθ (Q) as follows.
∂t∂s ∂t∂s Definition 16: The semantic space of a program SΘ (℘) is a
#T (P ) #S (P ) product of #S(℘) variables and #T (℘) executing steps, i.e.,
= Ri=0 Rj =1 vP (ti , sj )
#T (Q )
→ Ri=0 Rj =1
#S (Q )
vQ (ti , sj ) SΘ (℘) = #S(℘) • #T (℘)
 

#K (℘)

#K (℘)
#T PQ
#S (P ∪Q ) = #S(℘k ) • #T (℘k ) (26)
= Ri=0 Rj =1 v(ti , sj )
k=1 k=1
 
sP sQ sPQ The semantic space of programs provides a useful measure
 t0 ⊥ ⊥ ⊥ 
=  of software complexity. Because of the tremendous size of the
(t0, t1] V1P − V1P Q semantic space, both program composition and comprehension
(t1, t2] − V2Q V2P Q are innately a hard problem in terms of complexity and cognitive
 
VP VPQ difficulty.
= (24) Deductive semantics and laws of software developed in this
VQ VPQ
section can greatly simplify the description and analysis of the
where P  Q indicates a concatenation of these two semantics of complex software systems in various program-
processes over time, and in the simplified notation ming and specification languages. Deductive semantics can be
of the matrix, VP = v(tP , sP ), 0 ≤ tP ≤ nP , 1 ≤ sP ≤ mP ; used to define both abstract and concrete semantics of large-
VQ = v(tQ , sQ ), 0 ≤ tQ ≤ nQ , 1 ≤ sQ ≤ mQ ; and VP Q = scale software systems, facilitate software comprehension and
v(tP Q , sP Q ), 0 ≤ tP Q ≤ nP Q , 1 ≤ sP Q ≤ mP Q . recognition, support tool development, enable semantics-based
WANG: INFORMATICS LAWS AND DEDUCTIVE SEMANTICS OF SOFTWARE 171

software testing and verification, and explore the semantic com- [14] K. Slonneg and B. Kurts, Formal Syntax and Semantics of Programming
plexity of software systems. Languages. Reading, MA: Addison-Wesley, 1995.
[15] Y. Wang and G. King, Software Engineering Processes: Principles and
Applications. Boca Raton, FL: CRC, 2000, p. 752.
V. CONCLUSION [16] Y. Wang, “The real-time process algebra (RTPA),” Ann. Software Eng.
Intl. J., vol. 14, pp. 235–274, 2002.
The product-based metaphor for software development has [17] , “On cognitive informatics, Keynote Lecture,” in Proc. 1st IEEE Int.
dominated the methodologies of software engineering in the Conf. Cognitive Informatics (ICCI’02), Calgary, AB, Canada, Aug. 2002,
pp. 34–42.
last four decades. However, the failure in explaining the na- [18] , “On cognitive informatics,” Brain Mind: Transdisciplinary J. Neu-
ture of software and in ensuring its quality indicates the need rosci. Neurophil., vol. 4, no. 2, pp. 151–167, 2003.
for new theories and practices. A new informatics metaphor [19] , “Using process algebra to describe human and software system
behaviors,” Brain Mind: Transdisciplinary J. Neurosci. Neurophil., vol. 4,
has been proposed to explain the fundamental characteristics of no. 2, pp. 199–213, 2003.
software. A comprehensive set of informatics, cognitive prop- [20] Y. Wang and Y. Wang, “Cognitive informatics models of the brain,” IEEE
erties, and laws has been identified in this paper, which answers Trans. Syst., Man, Cybern. C, Appl. Rev., vol. 36, no. 2, pp. 203–207, Mar.
2006.
an age-long fundamental question on what constrains software. [21] Y. Wang, “On the big-R notation for describing interactive and recursive
A new approach toward formal semantics known as deductive behaviors,” in Proc 2006 IEEE Int. Conf. Cognitive Informatics (ICCI’
semantics has been developed on the basis of the compositional 06), Beijing, China, Jul. 2006.
[22] , Software Engineering Foundations: A Multidisciplinary Perspec-
model of program and the mathematical model of software se- tive. CRC Software Engineering Series, vol. 2, Boca Raton, FL: CRC
mantics. It has been demonstrated that the semantic properties Press, 2006.
and laws of software can be used to greatly simplify seman- [23] , “On the mathematical laws of software,” in Proc. 18th Canadian
Conf. Electrical and Computer Engineering (CCECE’05), Saskatoon, SK,
tic analyses in software engineering on the basis of deductive Canada, May 1–4, 2005, pp. 1086–1089.
semantics.
The findings of this paper will serve as a coherent part of
foundations in software engineering and computer science. A
wide range of new software notations, processes, quality princi-
ples, verification techniques, and organizational methodologies
in software engineering may be developed based on the infor-
matics and semantic properties and laws of software.

REFERENCES Yingxu Wang (M’97–SM’04) received the B.S. de-


gree in electrical engineering from Shanghai Tiedao
[1] A. V. Aho, R. Sethi, and J. D. Ullman, Compilers: Principles, Techniques, University, Shanghai, China, in 1983, and the Ph.D.
and Tools. Reading, MA: Addison-Wesley, 1985. degree in software engineering from Nottingham
[2] D. Bjorner and C. B. Jones, Formal Specification and Software Develop- Trent University, Nottingham, U.K., in 1997.
ment. Englewood Cliffs, NJ: Prentice-Hall. Since 1994, he has been a Full Professor at
[3] J. D. Cutnell and K. W. Johnson, Physics, 4th ed. New York: Wiley, Lanzhou Tiedao University, Lanzhou, China. In 1995,
1998. he was a Visiting Professor in the Computing Lab-
[4] E. W. Dijkstra, “Guarded commands, nondeterminacy, and the formal oratory, Oxford University, U.K. He is currently a
derivation of programs,” Commun. ACM, vol. 18, no. 8, pp. 453–457, Full Professor of Cognitive Informatics and Software
Aug. 1975. Engineering and the Director of Theoretical and Em-
[5] J. Goguen and G. Malcolm, Algebraic Semantics of Imperative Program- pirical Software Engineering Research Center (TESERC), University of Cal-
ming. Cambridge, MA: MIT Press, 1996. gary, Calgary, AB, Canada, since 2000. He has accomplished a number of EU,
[6] D. Gries, The Science of Programming. New York: Springer-Verlag, Canadian, and industry-funded research projects as Principal Investigator and/or
1981. Coordinator, and has published over 260 papers and six books in software en-
[7] J. Hartmanis, “On computational complexity and the nature of computer gineering and cognitive informatics.
science, 1994 Turing Award Lecture,” Commun. ACM, vol. 37, no. 10, Dr. Wang is a Fellow of WIF, a Senior Member of IEEE with the Societies
pp. 37–43, 1994. of Computer, SMC, and Communications, and a member of ACM, ISO/IEC
[8] C. A. R. Hoare, “An axiomatic basis for computer programming,” Com- JTC1, and the Canadian Advisory Committee (CAC) for ISO. He is the founder
mun. ACM, vol. 12, no. 10, pp. 576–580, Oct. 1969. and Steering Committee Chair of the Annual IEEE International Conference
[9] Communicating Sequential Processes. London, U.K.: Prentice-Hall, on Cognitive Informatics (ICCI). He is the Editor-in-Chief of the International
1985. Journal of Cognitive Informatics and Natural Intelligence (IJCI&NI), Editor-
[10] K. C. Louden, Programming Languages: Principles and Practice. in-Chief of the World Scientific Book Series on Cognitive Informatics, and
Boston: PWS-Kent, 1993. Editor of the CRC Book Series in Software Engineering. He was the Chairman
[11] J. A. McDermid, Ed., Software Engineer’s Reference Book. Oxford, of the Computer Chapter of IEEE Sweden during 1999–2000. He has served
U.K.: Butterworth, 1991. on numerous editorial boards and program committees, and as guest editors for
[12] D. Schmidt, Denotational Semantics: A Methodology for Language De- a number of academic journals. He has won dozens of Research Achievement,
velopment. Dubuque, IA: W. C. Brown, 1988. Best Paper, and Teaching Awards in the last 25 years, particularly the IBC 21st
[13] D. Scott, “Domains for denotational semantics,” in Automata, Lan- Century Award for Achievement in recognition of outstanding contribution in
guages and Programming IX. Berlin, Germany: Springer-Verlag, 1982, the field of Cognitive Informatics and Software Science. He is a Professional
pp. 577–613. Engineer of Canada.

You might also like