Discuss how you use the ideas given in queue lhs file


Problem

I. Discuss how you use the ideas given in queue.lhs file and the property testing examples you learned in class in your implementation. For example, you may wish to describe how you apply the property testing method learned in the functional programming framework (via quickCheck) to associate and/or to convert from the given code queue.lhs to the code (procedural language) you implemented.[JAVA]

> type QueueI a = ([a],[a])
> emptyI = ([],[])
> addI x (f,b) = flipQ (f,x:b)
> isEmptyI (f,b) = null f
> frontI (x:f,b) = x
> removeI (x:f,b) = flipQ (f,b)
> flipQ ([],b) = (reverse b,[])
> flipQ q = q
> retrieve :: QueueI Integer -> [Integer]
> retrieve (f,b) = f ++ reverse b
> invariant :: QueueI Integer -> Bool
> invariant (f,b) = not (null f) || null b

Above is queue.lhs

II. In class, we performed property testing (in the functional programming framework) to verify an implementation of the queue data type. Describe and discuss how to adopt this approach of property testing to other procedural programming tasks.[JAVA]

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Discuss how you use the ideas given in queue lhs file
Reference No:- TGS03277179

Expected delivery within 24 Hours