Z Reference Card Mike Spivey

Specifications Schema box Name[Params] Declarations Predicates

Axiomatic description Declarations Predicates

Generic definition [Params] Declarations Predicates

\begin{schema}{Name}[Params] Declarations \where Predicates \end{schema}

\begin{axdef} Declarations \where Predicates \end{axdef}

\begin{gendef}[Params] Declarations \where Predicates \end{gendef}

c J. M. Spivey 1992 Copyright

\begin{zed} ... Basic type definition [NAME , DATE ]

[NAME, DATE]

Abbreviation definition DOC == seq CHAR

DOC == \seq CHAR

Constraint n disks < 5

n\_disks < 5

Schema definition Point = b [ x, y : ]

Point \defs [~x, y: \num~]

Free type definition  Ans ::= ok  | error

Ans ::= ok \ldata\num\rdata | error

... \end{zed}

Logic and schema calculus true, false ¬P P ∧Q P ∨Q P ⇒Q P ⇔Q ∀x : T | P • Q ∃x : T | P • Q ∃1 x : T | P • Q

true, false \lnot P P \land Q P \lor Q P \implies Q P \iff Q \forall ... \exists ... \exists_1 ...

Logical constants Negation Conjunction Disjunction Implication Equivalence Universal quantifier Existential quantifier Unique quantifier

Special schema operators S [y1 /x1 , y2 /x2 ] S \ (x1 , x2 ) S1  S2 pre Op Op1  Op2 Op1 >> Op2

S[y_1/x_1, y_2/x_2] S \hide (x_1, x_2) S1 \project S2 \pre Op Op1 \semi Op2 Op1 \pipe Op2

2

Renaming Hiding Projection Pre-condition Sequential composition Piping

Basic expressions x =y x 6= y if P then E1 else E2 θS E .x (µ x : T | P • E ) (let x ==E 1 • E 2)

x = y x \neq y \IF P \THEN E_1 \ELSE E_2 \theta S E.x (\mu x: T | P @ E) (\LET x == E1 @ E2)

Equality Inequality Conditional Expression Theta-expression Selection Mu-expression Let-expression

x \in S x \notin S \{x_1, ..., \{~x: T | P \emptyset S \subseteq S \subset T \power S \power_1 S S \cross T (x, y, z) first~p second~p S \cup T S \cap T S \setminus \bigcup A \bigcap A \finset X \finset_1 X

Membership Non-membership Set display Set comprehension Empty set Subset relation Proper subset relation Power set Non-empty subsets Cartesian product Tuple First of pair Second of pair Set union Set intersection Set difference Generalized union Generalized intersection Finite sets Non-empty finite sets

Sets x ∈S x∈ /S {x1 , . . . , xn } {x : T | P • E } S ⊆T S ⊂T S 1S S ×T (x , y, z ) first p second p S ∪T S ∩T S S\ T TA A X 1X 







x_n\} @ E~\} T

T

3

Relations X Y x 7→ y dom R ran R id X Q R Q ◦R S R R S S R R S R∼ R S Q ⊕R Rk R+ R∗ 











X \rel Y x \mapsto y \dom R \ran R \id X Q \comp R Q \circ R S \dres R R \rres S S \ndres R R \nrres S R \inv R \limg S\rimg Q \oplus R R^{k} R \plus R \star

Binary relations Maplet Domain Range Identity relation Composition Backwards composition Domain restriction Range restriction Domain anti-restriction Range anti-restriction Relational inverse Relational image Overriding Iteration Transitive closure Reflexive–trans. closure

f(x) (\lambda ...) X \pfun Y X \fun Y X \pinj Y X \inj Y X \psurj Y X \surj Y X \bij Y X \ffun Y X \finj Y

Function application Lambda-expression Partial functions Total functions Partial injections Total injections Partial surjections Total surjections Bijections Finite partial functions Finite partial injections

Functions f (x ) (λ x : T | P • E ) X Y X Y X Y X Y X Y X Y X Y X Y X Y 















4

Numbers and arithmetic

+ − ∗ div mod <≤≥> 1

succ m ..n #S min S max S

\nat \num + - * \div \mod < \leq \geq > \nat_1 succ m \upto n \# S min~S max~S

Natural numbers Integers Arithmetic operations Arithmetic comparisons Strictly positive integers Successor function Number range Size of a set Minimum of a set Maximum of a set

\seq X \seq_1 X \iseq X \langle ... \rangle s \cat t rev~s head~s last~s tail~s front~s U \extract S s \filter V squash~f s \prefix t s \suffix t s \inseq t \dcat ss \disjoint SS SS \partition T

Finite sequences Non-empty sequences Injective sequences Sequence display Concatenation Reverse Head of sequence Last element of sequence Tail of sequence All but last element Extraction Filtering Compaction Prefix relation Suffix relation Segment relation Distributed concat. Disjointness Partition relation

Sequences seq X seq1 X iseq X hx1 , . . . , xn i s t rev s head s last s tail s front s U s s  V squash f s prefix t s suffix t s in t /ss disjoint SS SS partition T 





5

Bags bag X x1 , . . . , xn count B x B ]x n ⊗B x B B vC B ]C B C items s 





\bag X \lbag ... \rbag count~B~x B \bcount x n \otimes B x \inbag B B \subbageq C B \uplus C B \uminus C items~s

Bags Bag display Count of an element Infix count operator Bag scaling Bag membership Sub-bag relation Bag union Bag difference Items in a sequence

f uzz flags Usage: fuzz [ -aqstv] [ -p prelude] [ file . . . ] -a -p predude -q -d -s -t -v

Don’t use type abbreviations Use prelude in place of the standard one Assume implicit quantifiers for undeclared variables Dependency analysis Syntax check only Report types of global definitions Echo formal text as it is parsed

6

Z Reference Card - Mike Spivey

R+. R \plus. Transitive closure. R∗. R \star. Reflexive–trans. closure. Functions f (x) f(x). Function application. (λ x : T | P • E). (\lambda ...) Lambda-expression. X §.

71KB Sizes 7 Downloads 224 Views

Recommend Documents

Z Reference Card - Mike Spivey
Free type definition. Ans ::= ok ¡. £ ¢ ... Domain. ranR. \ran R. Range id X. \id X. Identity relation. Q ¥ R. Q \comp R. Composition ... Domain anti-restriction. R § S.

Z Reference Card - Mike Spivey's
Domain. ranR. \ran R. Range id X. \id X. Identity relation. Q £ R. Q \comp R. Composition. Q ◦ R. Q \circ R. Backwards comp. S ¨ R. S \dres R. Domain restriction.

NetBSD reference card - GitHub
To monitor various informations of your NetBSD box you ... ifconfig_if assigns an IP or other on that network in- ... pkg_admin fetch-pkg-vulnerabilities download.

Log4j Quick Reference Card - GitHub
log4j.appender.socket.port=10005 log4j.appender.socket.locationInfo=true log4j.logger.com.my.app=DEBUG. Level. Description. ALL. Output of all messages.

Javascript Quick Reference Card - Cheat-Sheets.org
Code Structure var ... //Global variable ... //your code here. }] aName='ExplainThat!'; ..... pathname – the path to the document on the host protocol – the protocol ...

OpenCL Quick Reference Card - Khronos Group
for high-performance compute servers, desktop ... cl_int clReleaseProgram (cl_program program) ... cl_int clGetProgramBuildInfo (cl_program program,.

CSS 2.1 Quick Reference Card - Cheat-Sheets.org
Class Selectors:.name – applies to HTML document ... HTML element type such as h1, p, a etc. Selector ... When defining two or more nearly similar rules do this.

Xcode 7 Visual Reference Card - GitHub
Previous Tab. Run. ⌘ R Run. ⌘ U Test. ⌘ I. Profile. ⇧ ⌘ B Analyze. ⌘ . Stop. ⌘ < Edit Scheme. Debug. ⌘ Y Deactivate Breakpoints. ⌃ ⌘ Y Pause. F6 Step Over.

mike mike xxl.pdf
First 39 magic mike xxl 39 trailer is live abc news. Magic mike xxl review roundup channing tatumischarming, but. Review magic mike xxl is not as good as magic ...

OpenGL 4.1 API Quick Reference Card - Khronos Group
d - double (64 bits). OpenGL®is the only cross-platform graphics API that enables developers of software for. PC, workstation, and supercomputing hardware to ...

OpenGL 4.00 API Quick Reference Card - Khronos Group
Mar 9, 2010 - GL commands are formed from a return type, a name, and optionally up to 4 characters. (or character pairs) from the Command ..... Pixel Transfer Modes [3.7.3, 6.1.3] ...... value: ORDER, COEFF, DOMAIN. Selection [5.2].

pdf-1274\tarascon-rapid-reference-card-complications-of-cirrhosis ...
... apps below to open or edit this item. pdf-1274\tarascon-rapid-reference-card-complications ... nd-management-of-ascites-by-md-drjoseph-esherick.pdf.

OpenVG 1.1 API Quick Reference Card - Page 1 - Khronos Group
startAngle and angleExtent parameters are given in degrees, ... c(csrc, cdst, αsrc, αdst); Pre-mult alpha form c'(αsrc * csrc, αdst * cdst, αsrc, αdst) = c'(c'src, c'dst, ...

read ePub QuickBooks Pro 2018 Quick Reference Training Card ...
Oct 2, 2017 - Reference Training Card - Laminated Tutorial. Guide Cheat Sheet (Instructions and ... and Vendors; Managing. List Items; Sales Tax;. Inventory ...

OpenGL 4.1 API Quick Reference Card - Khronos Group
OpenGL®is the only cross-platform graphics API that enables developers of software ... For brevity, the OpenGL documentation and this reference may omit the ...

Microsoft Excel 2016 Functions & Formulas Quick Reference Card ...
Click the button below to register a free account and download the file ... laminated card/guide provides explanations and context for many powerful Excel 2016.