Directory path: /home/oo1/oo1home/mt1/le_demos/tax_example/
Created on: Tue Aug 25 20:10:07 2015
HAMILTON TECHNOLOGIES INC. Collector Version: 6.1; Copyright 1991-2015.
This system has been defined in USL, automatically analyzed, automatically generatated/resource allocated (RAT)ed to C code, and automatically documented in HTML using the 001 Toolsuite.
Interface: DB:taxDB=Do_All_Taxes(DB0:taxDB)
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: set:Any=ForALL(set0:Any)
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: c1:Any=isSetOK_1(c0:Any)
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: fred_with_tax:PERSON=Compute_Tax(fred:PERSON)
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.Create (K) or Delete (D) a TaxDB object:
Query the state of a TaxDB object:
Conversions to work with TaxDB as an OMap object:
Access a TaxDB child object:
Access the TaxDB container of an OMap child object:
Get a TaxDB child object from its OMap place:
Put a TaxDB child object into its OMap place:
Create (K) or Delete (D) a PERSON object:
Query the state of a PERSON object:
Conversions to work with PERSON as an OMap object:
Access a PERSON child object:
Get a PERSON child object from its OMap place:
Put a PERSON child object into its OMap place:
Create (K) or Delete (D) a Employees object:
Query the state of a Employees object:
Conversions to work with Employees as an OMap object:
Access a Employees child object:
Access the Employees container of an OMap child object:
Get a Employees child object from its OMap place:
Put a Employees child object into its OMap place:
Primitive Operations specific to OSetOf Employees used in this system:
Create (K) or Delete (D) a Friends object:
Query the state of a Friends object:
Conversions to work with Friends as an OMap object:
Access a Friends child object:
Access the Friends container of an OMap child object:
Get a Friends child object from its OMap place:
Put a Friends child object into its OMap place:
Primitive Operations specific to OSetOf Friends used in this system:
do_all_taxes uses DB0 (which is of type taxDB) to produce DB (which is of type taxDB). Following is a list of the types of objects being used by this FMap:
Interface: DB:taxDB=Do_All_Taxes(DB0:taxDB)
Move to rate, taxrate, of taxDB, DB0. Move to employees, emps0, of taxDB, DB0. ForEmployees checks emps0, a employees, to see if it is REJECT, an empty OMap PLACE or an EMPTY set. If not, the first employee is located; then, all the employees of employees are processed by Compute_Tax.anEMP:PERSON=Compute_Tax(anEMP0:PERSON,taxrate:rat)
When all employees of employees emps0 have been processed, the completed EMPs is returned as the output of ForEmployees.
Compute_Tax will compute the tax of anEMP0, a PERSON, with a given rate, a taxrate. The resulting tax is used to update anEMP0 who will now be anEMP. Go upto the taxDB, DB1, containing EMPs. Move to friends, friends0, of taxDB, DB1. ForFriends checks friends0, a friends, to see if it is REJECT, an empty OMap PLACE or an EMPTY set. If not, the first friend is located; then, all the friends of friends are processed by Compute_Tax.aFRIEND:PERSON=Compute_Tax(aFRIEND0:PERSON,taxrate:rat)
When all friends of friends friends0 have been processed, the completed friends is returned as the output of ForFriends.
Compute_Tax will compute the tax of aFRIEND0, a PERSON, with a given rate, a taxrate. The resulting tax is used to update aFRIEND0 who will now be aFRIEND. Go upto the taxDB, DB, containing friends.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.
()
forall uses set0 (which is of type Any) and P (which is of type Any) to produce set (which is of type Any). All objects in this FMap are of type Any.
Interface: set:Any=ForALL(set0:Any)
ForALL checks set0, a set, to see if it is REJECT, a PLACE or EMPTY. If any of these conditions exist for set0; then it is simply returned as set. If not, the following function is called:set:Any=process_set_elements(set0:Any,P:Any)
Locate element 1 of set0 which will now become set1 with a new currency. The function REPEAT is to be repeated. The decision, REPEAT, chooses one of the following alternatives based on the result of atnull:set: process_an_element or clone1:any.If atnull:set (of REPEAT) returns FALSE, then process_an_element is done as follows. Function, moveto:element:set, uses inputs: set1 to produce: element (of type Any).
Plugin Interface: e1:Any=DoFunction(element:Any)
Function, upto:set:element, uses inputs: e1 to produce: set2 (of type Any). Function, next:set, uses inputs: R and set2 to produce: setn (of type Any). Repeat the ancestor function REPEAT with the following input changes: replace set1 with setn and P with P.If atnull:set (of REPEAT) returns TRUE, then clone1:any is done as follows. set is assigned to be the same object as set1.
c1:Any=F(c0:Any,1:Any)
()
issetok_1 uses c0 (which is of type Any) and 1 (which is of type Any) to produce c1 (which is of type Any). All objects in this FMap are of type Any.
Interface: c1:Any=isSetOK_1(c0:Any)
The decision, isSetOK_1, chooses one of the following alternatives based on the result of is:REJECT:SET: NULL_or_NOT or clone1:any.If is:REJECT:SET (of isSetOK_1) returns FALSE, then NULL_or_NOT is done as follows. The decision, NULL_or_NOT, chooses one of the following alternatives based on the result of is:PLACE:SET: EMPTY_or_NOT or clone1:any.If is:PLACE:SET (of NULL_or_NOT) returns FALSE, then EMPTY_or_NOT is done as follows. The decision, EMPTY_or_NOT, chooses one of the following alternatives based on the result of is:EMPTY:SET: F or clone1:any.If is:EMPTY:SET (of EMPTY_or_NOT) returns FALSE, then F is done as follows.
Plugin Interface: c1:Any=F(c0:Any)
If is:EMPTY:SET (of EMPTY_or_NOT) returns TRUE, then clone1:any is done as follows. c1 is assigned to be the same object as c0. If is:PLACE:SET (of NULL_or_NOT) returns TRUE, then clone1:any is done as follows. c1 is assigned to be the same object as c0. If is:REJECT:SET (of isSetOK_1) returns TRUE, then clone1:any is done as follows. c1 is assigned to be the same object as c0.compute_tax uses fred (which is of type PERSON) and rate (which is of type rat) to produce fred_with_tax (which is of type PERSON). Following is a list of the types of objects being used by this FMap:
Interface: fred_with_tax:PERSON=Compute_Tax(fred:PERSON)
Move to income, i, of PERSON, fred. Multiply i and rate to get tax. Put tax (a rat) into fred (a PERSON) to produce fred_with_tax.