| A simple example of collecting the costs of a business trip | | You can run this agent from a browser, using the Internet Business Logic system at www.reengineeringllc.com | | Please note that the system can provide detailed English explanations | | You can also use the same system to write your own agents, in the same style, and to run them sum some-cost : for the item some-item the cost is some-cost = a-total ---------------------------------------------------------------------- the cost of the business trip is altogether $ that-total the expense for business use of a car is some-mileage-cost ---------------------------------------------------------- for the item car mileage the cost is that-mileage-cost the cost of the tolls is some-tolls-cost ------------------------------------------------ for the item tolls the cost is that-tolls-cost the cost of staying at some-name hotel for some-number nights is some-hotel-cost -------------------------------------------------------------------------------- for the item hotel the cost is that-hotel-cost the car some-make some-year initial odometer some-number miles was driven some-distance miles the rate per mile for business use of a car is some-amount that-distance * that-amount = some-mileage-cost ----------------------------------------------------------------------------------------------- the expense for business use of a car is that-mileage-cost sum an-amount : toll some-number is for $ some-amount = some-total ------------------------------------------------------------------ the cost of the tolls is that-total for the item meals the cost is this-cost ========================================== 127.35 toll this-number is for $ this-amount ===================================== 1 5 2 3 3 2 4 6.45 5 2 6 3 7 6.4 the rate per mile for business use of a car is this-amount =========================================================== 0.50 the car this-make this-year initial odometer this-number miles was driven this-distance miles ============================================================================================= Toyota 2003 138407 720 the cost of staying at this-name hotel for this-number nights is this-cost ========================================================================== Quality Inn College Park 3 267.36