Software Design and Implementation, Spring 2015


This site will be maintained for Software Design & Implementation taken in spring semester of 2015 under Prof. David Stotts at UNC-Chapel Hill.


A5:ML ADT specifications

This implements the library ADT as specified by you. Although cko,wait,new,add are canonical functions, cko and wait need protective wrapper fucntions. Hence WAIT and CKO are to be used instead of wait and cko.

WAIT(lib,BOOK,PERSON): if BOOK is not in lib ->error
if given BOOK is in lib, but all copies are checked out, PERSON is added to waitlist
if given BOOK is in lib, and atleast 1 copy is available, BOOK is checked out to PERSON

CKO(lib,BOOK,PERSON): if BOOK is not in lib ->error
if given BOOK is in lib, but all copies are checked out, PERSON is added to waitlist
if given BOOK is in lib, and atleast 1 copy is available, BOOK is checked out to PERSON

  1. Library

A6:Higher order curried function

  1. HOF curried function