(* * This a very simple specification for a Database objects and related * operations. To run it through the spec checker, use the following UNIX * command: * * % ~gfisher/440/bin/rsl db-v2.rsl * * NOTE: THIS VERSION HAS SEMANTIC ERRORS, AS THE CHECKER WILL INDICATE. * *) object Database components: Record*; description: (* A database is an object that contains zero or more Records *); end Database; object Record components: Name and Age and Address; description: (* A Record contains Name, Age, and Address components. *); end Record; operation AddRecord inputs: Database, Record; outputs: Database; description: (* AddRecord is a database operation that inserts a new record * into a Database, producing a new database *); end AddRecord; operation DeleteRecord inputs: Database, Name; outputs: Database; description: (* DelRecord is a database operation that deletes a record by name * from a Database, producing a new database *); end DeleteRecord; operation ChangeRecord inputs: Database, Name, Age, Address; outputs: Database; description: (* ChangeRecord is a database operation that changes the Age and * Address in a record of a given Name, producing a new Database. *); end ChangeRecord;