SE424: Worksheet 1- Semantic Algebras

1. Given the algebras of natural numbers and truth values (from lecture notes), simplify the following expressions, showing all steps in your simplification.
• ((six equals (two plus one)) ® one [] minus(three minus one)) plus two
• (two equals (true ® one [] two )) and true
• not (false) ® not(true) [] not (true)

1. Complete the definition of the algebra for the payroll domain (page 3 of section 3 lecture notes) by defining these operations:
• Update-payrate: Rat x payroll ® payroll
• Update-hours: Rat x payroll ® payroll

Use the completed algebra to define a payroll stating that:

• Jane Doe has been assigned on payroll
• She is moved to the night shift
• She works 38 hours that week
1. Use the algebra of dynamic array (with curried operators) and the algebra of payroll records to derive an algebra describing databases of payroll records. A database indexes employees by identity numbers. Operations should include ones for :
• Adding a new employee to a database
• Updating an employees statistics
• Producing a list of employee paychecks for all the employees of the database.
1. Given the Domain Unit (lectures notes page 2 section 3) define an algebra for finite lists D* where Unit represents list of length zero, D represents a list of one element, DxD represents a list of length zero, D represents a list of one element and operations cons: D x D* ® D*, hd: D* ® D, tl: D* ® D*, null: D* ® Tr are defined.