Functions

front s U s s V squash f s prefix t s suffix t s in t /ss disjoint SS SS partition T

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















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

Application Lambda-expression Partial functions Total functions Partial injections Total injections Partial surjections Total surjections Bijections Finite functions Finite injections







+ − ∗ 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 Operations Comparisons Integers > 0 Successor function Number range Size of a set Minimum of a set Maximum of a set

All but last element Extraction Filtering Compaction Prefix relation Suffix relation Segment relation Distributed concat. Disjointness Partition relation

\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 element Infix count operator Bag scaling Bag membership Sub-bag relation Bag union Bag difference Items in a sequence

Z Reference Card Mike Spivey The Spivey Partnership

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

Numbers and arithmetic

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







f uzz flags Usage: fuzz [ -aqstv] [ -p prelude] [ file . . . ]

Sequences seq X seq1 X iseq X hx1 , . . . , xn i s t rev s head s last s tail s

\seq X \seq_1 X \iseq X \langle \rangle s \cat t rev~s head~s last~s tail~s

5

Finite sequences Sequences 6= hi Injective sequences Sequence display Concatenation Reverse Head of sequence Last element Tail of sequence

-a -p predude -q -d -s -t -v

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

6

c J. M. Spivey 1992 Copyright

Specifications Schema box Name[Params] Declarations Predicates

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

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

Generic definition [Params] Declarations Predicates

{x1 , . . . , xn } { x :T | P • E }

Logic and schema calculus

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

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 quant. Unique quantifier

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

S[y1/x1, y2/x2] S \hide (x1, x2) S \project T \pre Op Op1 \semi Op2 Op1 \pipe Op2

Renaming Hiding Projection Pre-condition Sequential comp. Piping

Basic expressions \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 : ]

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

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

Membership Non-membership

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

Free type definition  Ans ::= ok | error Ans ::= ok \ldata\num\rdata | error

... \end{zed}

2

Sets x ∈S x∈ /S

3

S ⊆T S ⊂T   S 1S S ×T (x , y, z ) first p second p S ∪T S ∩T S \T S TA  A  X 1X

\{x_1,...,x_n\} \{~x:T | P @ E~\} \emptyset S \subseteq T 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 T \bigcup A \bigcap A \finset X \finset_1 X

Set display Set comprehension Empty set Subset relation Proper subset Power set Non-empty subsets Cartesian product Tuple First of pair Second of pair Set union Set intersection Set difference Generalized union Gen. intersection Finite sets  Finite sets 6=

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 comp. Domain restriction Range restriction Domain anti-res. Range anti-restrict. Relational inverse Relational image Overriding Iteration Transitive closure Refl.–trans. closure

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∗

4

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.

68KB Sizes 5 Downloads 312 Views

Recommend Documents

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 §.

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.

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.