Distributive Categories http cis k hosei ac jpyukita
Distributive Categories http: //cis. k. hosei. ac. jp/~yukita/
Products and Sums • Products are concerned with operations on the data. • Sums are concerned with control. – Decisions on which operation to perform • How do they interact when both products and sums are involved? 2
The Distributive Law 3
4
Axiom 1 [abstracted from Rule (i)] • The arrow d is an isomorphism. • Rule (i) is not automatic in categories other than Sets. 5
Axiom 2 [abstracted from Rule (ii)] 6
7
Def. Distributive Categories 8
Ex. 3 Category 2 X is distributive. 9
10
11
In Sets 12
The & function 13
Sets as a Distributive Category • Using – sums – products – composition – distributive law – and some additional primitive functions, • we can construct various functions. 14
Some Primitives in the category of Sets 15
Divide 16
Ex. 5. Realization of testx>0 17
18
Imperative Programming 19
Construction of factorial as an imperative program 20
Implementation of factorial in a distributive category 21
Construction of f 0 22
Construction of h and f 0 23
Def. Imperative program 24
Ex. 11. while t(y) is true do … 25
Implementation of Ex. 11 26
Ex. 12. A Circuit with Feedback x nor u v nor y 27
28
Ex. 13. Flow chart 29
30
Term Paper • Implement the function in example 13. • Use only – add – multiply – constants – constructions in a distributive category. 31
- Slides: 31