fact: Definition BookStoreSpec : ADT BookStoreSig := Eval simpl in Def ADT { rep := QueryStructure BookStoreSchema, Def Constructor0 "Init" : rep := empty,, Def Method1 "PlaceOrder" (r : rep) (o : Order) : rep * bool := Insert o into r!sORDERS, Def Method1 "DeleteOrder" (r : rep) (oid : nat) : rep * list Order := Delete o from r!sORDERS where o!sISBN = oid, Def Method1 "AddBook" (r : rep) (b : Book) : rep * bool := Insert b into r!sBOOKS, Def Method1 "DeleteBook" (r : rep) (id : nat) : rep * list Book := Delete book from r!sBOOKS where book!sISBN = id, Def Method1 "GetTitles" (r : rep) (author : string) : rep * list string := titles <- For (b in r!sBOOKS) Where (author = b!sAUTHOR) Return (b!sTITLE); ret (r, titles), Def Method1 "NumOrders" (r : rep) (author : string) : rep * nat := count <- Count (For (o in r!sORDERS) (b in r!sBOOKS) Where (author = b!sAUTHOR) Where (o!sISBN = b!sISBN) Return ()); ret (r, count) }%methDefParsing.
imports: Tutorial