




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A formal program specification prepared by dr. Stephen m. Thebaut from the university of florida for a lecture on software testing and verification. It covers the basics of propositions, propositional logic, sets, relations, functions, and predicate calculus. Explanations, examples, and exercises to help students understand these concepts.
Typology: Study notes
1 / 36
This page cannot be seen from the preview
Don't miss anything!





























Prepared by Stephen M. Thebaut, Ph.D.
University of Florida
Software Testing and Verification
Lecture 16
Review of Basics –^ Propositions, propositional logic,predicates, predicate calculus
-^ Sets, Relations, and Functions -^ Specification via pre- and post-conditions -^ Specifications via functions
is a formal language
that allows us to reason aboutpropositions. The alphabet of thislanguage is:
where P, Q, R, … are propositions, andthe other symbols, usually referred to as^ connectives
, provide ways in which
compound propositions can be built fromsimpler ones.
provide a concise way of
giving the meaning of compound formsin a tabular form.Example: construct a truth table to showall possible interpretation for thefollowing sentences:
B, and A
equivalent
if and only if their truth values are thesame under every interpretation. • If A is equivalent to B, we write
Exercise: Use a truth table to show:
and
≡^ interchangeably.
-^ However,
B^ is written down in the full
knowledge that it may denote either true
or^
false
in some interpretation,
whereas
B is an expression of fact
(i.e., the writer thinks it is true).
no
truth
value; it expresses a property or relationusing
variables.
-^ As illustrated above, their freevariables may be
instantiated
with the
names of specific objects, and – They may be
quantified
Quantification introduces twoadditional symbols:
∀^ and
or
domain of interest
may be specified which contains the objectsfor which the quantifier applies. Forexample,
{1,2,…,N} • A[i]>
represents the predicate “the first Nelements of array A are all greater than 0.”
rule of inference
is expressed in the
form:
n C
and is interpreted to mean
2
A)n
set
is any well-defined collection of objects, called members or elements. • The relation of
membership
between a
member, m, and a set, S, is written:
-^ If m is not a member of S, we write:
relation
, r, is a set whose members (if
any) are all ordered pairs. • The set composed of the first member ofeach pair is called the
domain
of r and is
denoted D(r). Members of D(r) arecalled
arguments
of r.
-^ The set composed of the secondmember of each pair is called the rangeof r and is denoted R(r). Members ofR(r) are called
values
of r.