TMAP

OPERATIONS and STRUCTURES

1 do_all_taxes.

do_all_taxes will access the tax rate from the database (db0) and for each person in the employees database calculate and update their tax entry. This process will be repeated for the friends database. The final result will be returned to the central database as DB.

Interface: DB:taxDB=Do_All_Taxes(DB0:taxDB)

(do_all_taxes.c)

1.1 forall.

forall checks set0, a set, to see if it is REJECT, an empty OMap PLACE or an EMPTY set. If not, the first element is located; then, all the elements of set are processed by DoFunction.

e1:Any=DoFunction(element:Any,P:Any)

When all elements of set set0 have been processed, the completed set is returned as the output of ForALL.

Interface: set:Any=ForALL(set0:Any)

()

1.1.1 isSetOK_1.

issetok_1 checks c0, a set, to see if it is REJECT, a PLACE or EMPTY. If any of these conditions exist for c0; then it is simply returned as c1. If not, the following function is called:

c1:Any=F(c0:Any,1:Any)

Interface: c1:Any=isSetOK_1(c0:Any)

()

1.2 compute_tax.

compute_tax will compute the tax of fred, a PERSON, with a given rate, a rate. The resulting tax is used to update fred who will now be fred_with_tax.

Interface: fred_with_tax:PERSON=Compute_Tax(fred:PERSON)

(compute_tax.c )

C-CODE APPENDICES:

1 do_all_taxes.c

do_all_taxes.c

1.1 forall.c

1.1.1 isSetOK_1.c

1.2 compute_tax.c

compute_tax.c