conditional expression \LET E2 let x == E1 E2 local definition formulae

Similar documents
Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006


Basic Propositional Logic. Inductive Theory of the Natural Numbers. Conjunction. Equivalence. Negation and Inequivalence. Implication.

Z Support in the HiVe Mathematical Toolkit

Chapter 1 : The language of mathematics.

Propositional Logic, Predicates, and Equivalence

Automata Theory for Presburger Arithmetic Logic

Automata Theory and Formal Grammars: Lecture 1

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

COMP2111 Glossary. Kai Engelhardt. Contents. 1 Symbols. 1 Symbols 1. 2 Hoare Logic 3. 3 Refinement Calculus 5. rational numbers Q, real numbers R.

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

Part IA Numbers and Sets

Mathematical Preliminaries. Sipser pages 1-28

Sets, Logic, Relations, and Functions

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X.

Contents Propositional Logic: Proofs from Axioms and Inference Rules

CSE 1400 Applied Discrete Mathematics Definitions

Outline. Sets. Relations. Functions. Products. Sums 2 / 40

Section 0. Sets and Relations

Contribution of Problems

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3

Axiomatic set theory. Chapter Why axiomatic set theory?

Mid-Semester Quiz Second Semester, 2012

Sets McGraw-Hill Education

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

A Semester Course in Basic Abstract Algebra

Logic, Sets, and Proofs

Notation Index. gcd(a, b) (greatest common divisor) NT-16

Informal Statement Calculus

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Table of mathematical symbols - Wikipedia, the free encyclopedia

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

COMP 633: Parallel Computing Fall 2018 Written Assignment 1: Sample Solutions

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions

Copyright c 2007 Jason Underdown Some rights reserved. statement. sentential connectives. negation. conjunction. disjunction

A B is shaded A B A B

Exclusive Disjunction

Math Fall 2014 Final Exam Solutions

Foundations of Mathematics

Automata and Languages

1.4 Cardinality. Tom Lewis. Fall Term Tom Lewis () 1.4 Cardinality Fall Term / 9

CSE 20 DISCRETE MATH. Winter

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

Proving simple set properties...

1. (B) The union of sets A and B is the set whose elements belong to at least one of A

MODEL ANSWERS TO THE SEVENTH HOMEWORK. (b) We proved in homework six, question 2 (c) that. But we also proved homework six, question 2 (a) that

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Background for Discrete Mathematics

Discrete Mathematics Review

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Informatics 1 - Computation & Logic: Tutorial 3

Lecture 2: Axiomatic semantics

With Question/Answer Animations. Chapter 2

Chapter 0. Introduction: Prerequisites and Preliminaries

Introduction to Proofs

Analysis 1. Lecture Notes 2013/2014. The original version of these Notes was written by. Vitali Liskevich

CSE 20 DISCRETE MATH. Fall

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Relating Abstract Datatypes and Z-Schemata

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS

On Recognizable Languages of Infinite Pictures

Contribution of Problems

Foundations of Mathematics

On Recognizable Languages of Infinite Pictures

Chapter 2 Sets, Relations and Functions

HANDOUT AND SET THEORY. Ariyadi Wijaya

18.S097 Introduction to Proofs IAP 2015 Lecture Notes 1 (1/5/2015)

Rigorous Software Development CSCI-GA

Mathematics Review for Business PhD Students

Introduction to Automata

Spring Based on Partee, ter Meulen, & Wall (1993), Mathematical Methods in Linguistics

CS 455/555: Mathematical preliminaries

CSE 20 DISCRETE MATH WINTER

Relations, Functions, and Sequences

Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD

COT3100 SI Final Exam Review

CHAPTER 0: BACKGROUND (SPRING 2009 DRAFT)

Unifying Theories of Programming

SETS AND FUNCTIONS JOSHUA BALLEW

CHAPTER 1 SETS AND EVENTS

CHAPTER 1. Preliminaries. 1 Set Theory

ABOUT THE CLASS AND NOTES ON SET THEORY

Type equations in linear format

Introduction. Chapter 1

Fuzzy and Rough Sets Part I

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH SPRING

Reading 11 : Relations and Functions

COMP1002 exam study sheet

0 Logical Background. 0.1 Sets

Mathematics Review for Business PhD Students Lecture Notes

Opleiding Informatica

Foundations of Mathematics

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

Transcription:

Z notation This file is a translation of the German original which can be found at http://www.pst.informatik. uni-muenchen.de/lehre/ws0203/gse/z-notation. The following tables provide an overview of the notation used in Z. The L A TEXinput format is accepted by most Z tools, e.g. Z/Eves or Jaza. However, you need the file zed-csp.sty or z-eves.sty, respectively to compile your latex source file. All inputs must be declared inside a zed environment, i.e. between \begin{zed} and \end{zed}. declarations and definitions [type] [type] basic type id params == expr id params == expr shortcut T ::= c d \ldata U \rdata \begin{axdef} x: T \end{axdef} \begin{gendef}[x] x: X \end{gendef} \begin{schema}{s} x: T \end{schema} T ::= c d U x : T [X] x : X S x : T definition of free types axiomatic definitions generic definitions schema definition S \defs [x:t ] S = [x : T ] schema definition in horizontal notation schema expressions Id, Id!, Id?, Id_n Id, Id!, Id?, Id n decorations (n digit) \Delta S S shortcut for S S \Xi S ΞS shortcut for S S θs = θs \lnot S, S \land T, S \lor T \forall x:t @ S \exists x:t @ S S, S T, S T x : T S x : T S logical schema conjunctions quantifiers (also possible: 1 ) S \hide (x) S \ (x) Hiding, same as x : T S, where T is the type of x in S S \project T S T projection, same as (S T) \ ( x), where x represents all variables in S which are not in T S \semi T S o 9 T sequential composition S \pipe T S>>T pipe-composition \pre S pre S precondition (hiding of output and striked out variables, respectively) 1

expressions \{ x:t @ E \} {x : T E} set comprehension (E optional), e.g. {x : Z x > 5 x x} = {36, 49, 64,...} (\lambda x:t @ E) (λ x : T E) λ-expression, same as {x : T (x, E)} f x f x function application (\mu x:t @ E) (µ x : T E) unique specification (E optional), e.g. (µ x : N 1 x x = x x + x) = 2 \IF \THEN E1 \ELSE E2 if then E1 else E2 conditional expression \LET x==e1 @ E2 let x == E1 E2 local definition formulae x = y, x \neq y x = y, x y (in-)equality x \in S, x \notin S x S, x / S (non-)membership S \subseteq T S T subset S \subset T S T proper subset \lnot negation \land Q Q conjunction \lor Q Q disjunction \implies Q Q implication \iff Q Q equivalence \forall x:t @ x : T universal quantifier \exists x:t @ x : T existential quantifier \exists_1 x:t @ 1 x : T unique existence a \inrel{r} b a R b infix-relation, same as (a, b) R sets \emptyset empty set \{a, b\} {a, b} enumeration of finite sets S \cup T, S \cap T S T, S T union, intersection S \setminus T S \ T complement \power S, \power_1 S S, 1 S power set ( 1 S = S \ ) S \cross T S T cartesian product \bigcup TT TT generalized union, a TT S TT a S \bigcap TT TT generalized intersection, a TT S TT a S 2

pairs and tuples (a, b) (a, b) pair and tuple construction (arbitrary arity) a \mapsto b a b ordered pair ( maplet ), same as (a, b) t.n t.n selection of the nth component, e.g. (a, b, c).2 = b first p first p first component, first(a, b) = a (same as p.1) second p second p second component, second(a, b) = b (same as p.2) relations X \rel Y X Y set of relations, X Y = (X Y) \dom R dom R domain, dom R = { x : X; y : Y x R y x } \ran R ran R range, ran R = { x : X; y : Y x R y y } \id X id X identity relation, id X = (λ x : X x) Q \comp R Q o 9 R composition of relations, Q o 9 R = { x : X; z : Z ( y : Y x Q y y R z) x z } R \circ Q R Q backward composition, R Q = Q o 9 R, (f g) x = f (g x) R \inv R inverse relation, R = { x : X; y : Y x R y y x } A \dres R A R domain restriction, A R = { x : X; y : Y x R y x A x y } A \ndres R A R domain anti-restriction, A R = { x : X; y : Y x R y x / A x y } A \rres R A R range restriction, A R = { x : X; y : Y x R y y B x y } A \nrres R A R range anti-restriction, A R = { x : X; y : Y x R y y / B x y } R \limg A \rimg R( A ) relational mapping, R( A ) = ran(a R) Q \oplus R Q R overwriting, Q R = (dom R Q) R R \plus R + transitive closure, R + = { Q : X X R Q Q o 9 Q Q } R \star R reflexive transitive closure, R = id X R + Rˆ{k} R k relational iteration, R 0 = id X, R k+1 = R o 9 R k, R k = (R ) k functions X \pfun Y X Y partial function, { R : X Y x : X; y 1, y 2 : Y x R y 1 x R y 2 y 1 = y 2 } X \fun Y X Y total function, X Y = { f : X Y dom f = X} X \pinj Y X Y partial injection, { f : X Y x 1, x 2 : dom f f x 1 = f x 2 x 1 = x 2 } X \inj Y X Y total injection, X Y = (X Y) (X Y) X \psurj Y X Y partial surjection, X Y = { f : X Y ran f = B } X \surj Y X Y total surjection, X Y = (X Y) (X Y) X \bij Y X Y bijection, X Y = (X Y) (X Y) 3

numbers \num Z integers \nat N natural numbers, N = { n : Z n 0 } \nat_1 N 1 positive natural numbers, N 1 = N \ {0} +, -, * +,, arithmetic operations (Z Z Z) \div, \mod div, mod division, modulo (Z (Z \ {0}) Z) <, \leq, >, \geq <,, >, arithmetic comparisons (Z Z) succ succ successor (N N) a \upto b a.. b intervals, a.. b = { n : Z a n n b } min S, max S min S, max S minimum/maximum element of a set of number (if ex.) min S = (µ m : S ( n : S m n)) finite sets \finset S F S set of the finite subsets of S, F S = { s : S n : N f : 1.. n S ran f = S } \finset_1 S F 1 S non-empty finite subsets, F 1 S = F S \ \# S #S cardinality of a finite set, #S = (µ n : N ( f : 1.. n S ran f = S)) X \ffun Y X Y finite partial function, X Y = { f : X Y dom f F X } X \finj Y X Y finite partial injection, X Y = (X Y) (X Y) multisets \bag S bag S multiset over S, bag S = (S N 1 ) \lbag a, a, b\rbag [[a, a, b]] enumeration of finite subsets, same as {a 2, b 1} B \bcount x B x frequency of x in B, B x = (λ x : S 0) B n \otimes B n B scaling, n B = (λ x : dom B x n (B x)) x \inbag B x in B membership in a multiset, x in B x dom B A \subbageq B A B sub-multiset relation, A B x : S A x B x A \uplus B A B multiset union, (A B) x = A x + B x A \uminus B A B multiset complement, (A B) x = max {0, A x B x} items s items s multiset of the elements of a sequence, (items s) x = #(s {x}) 4

finite sequences \seq S seq S set of the finite sequences of S, seq S = { s : N S n : N dom s = 1.. n } \seq_1 S seq 1 S non-empty sequence, seq 1 S = { s : seq S #s > 0 } \iseq S iseq S duplicate-free sequence, iseq S = (seq S) (N S) \langle a, a, b \rangle a, a, b enumeration of a finite sequence, same as { 1 a, 2 a, 3 b } s \cat t s t concatenation, s t = s { n : dom t (n + #s) t(n) } rev s rev s inversion, rev s = (λ n : dom s s(#s n + 1)) head s head s first element, head s = s(1) tail s tail s remainder of the sequence, tail s = (λ n : 1.. #s 1 s(n + 1)) last s last s last element, last s = s(#s) front s front s sequence without the last element, front s = (1.. #s 1) s squash f squash f compactification, (µ g : 1.. #f dom f g o 9 succ o 9 g ( < )) o 9 f A \extract s A s extraction of the elemente using indexes in A, A s = squash (A s) s \filter A s A subsequence of the elements of s which are contained in A, s A = squash (s A) s \prefix t s prefix t prefix relation, s prefix t v : seq S s v = t s \suffix t s suffix t suffix relation, s suffix t v : seq S v s = t s \inseq t s in t subsequence, s in t u, v : seq S u s v = t \dcat s / s concatenation of all sequences in s, / =, #s > 1 / s = (head s) ( / tail s) 5