generate-constraints

11 views
Skip to first unread message

Sterling Williams

unread,
Nov 29, 2011, 6:02:47 PM11/29/11
to byu-cs-330...@googlegroups.com
Is it ok to change the contract of this function so that we can pass the list of constraints around?

Jay McCarthy

unread,
Nov 29, 2011, 7:00:54 PM11/29/11
to byu-cs-330...@googlegroups.com
No.

And what list of constraints do you mean? It returns one... why would you "pass it around"?


On Tue, Nov 29, 2011 at 4:02 PM, Sterling Williams <silve...@gmail.com> wrote:
Is it ok to change the contract of this function so that we can pass the list of constraints around?



--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Sterling Williams

unread,
Nov 29, 2011, 7:18:34 PM11/29/11
to byu-cs-330...@googlegroups.com
Nevermind, that was just a thought we had, but didn't end up going through with it.

Jay McCarthy

unread,
Nov 29, 2011, 8:37:13 PM11/29/11
to byu-cs-330...@googlegroups.com
I'm glad it worked out

Sterling Williams

unread,
Nov 30, 2011, 8:55:30 PM11/30/11
to byu-cs-330...@googlegroups.com
So we're a little stuck on generating the constraints of an app. The app should be the type of whatever the function body returns, but we can't figure out how to find the return type for the function at that point in the program. 

Jay McCarthy

unread,
Nov 30, 2011, 8:57:34 PM11/30/11
to byu-cs-330...@googlegroups.com
You should look at page 277 in the book, it's right there.


On Wed, Nov 30, 2011 at 6:55 PM, Sterling Williams <silve...@gmail.com> wrote:
So we're a little stuck on generating the constraints of an app. The app should be the type of whatever the function body returns, but we can't figure out how to find the return type for the function at that point in the program. 



Alyssa Meservy

unread,
Nov 30, 2011, 11:30:31 PM11/30/11
to byu-cs-330...@googlegroups.com
We're wondering about when generating constraints for the application of the identity function. The function body doesn't resolve to the type of the argument passed in. For example, if we have something like 
(generate-constraints* (parse '((fun (x) 1) 1))) we can resolve that the function body, and thus the application, is of type t-num. But if we have 
(generate-constraints* (parse '((fun (x) x) 1))
should the function body resolve to t-num? If so, what rules would lead to that resolution?

-Alyssa & Sterling

--
--Alyssa Meservy

-"And now, after the many testimonies which have been given of him, this is the testimony, last of all, which we give of him: That he lives!"

Blake Johnson

unread,
Dec 1, 2011, 12:15:48 AM12/1/11
to byu-cs-330...@googlegroups.com
[1]([2](fun (x) x) [3]1)

These are the constraints:

[2] = [3] -> [1]
[2] = x -> x
[3] = num


Blake

Jay McCarthy

unread,
Dec 1, 2011, 12:52:20 AM12/1/11
to byu-cs-330...@googlegroups.com
Yes, and just to be clear. The first constraint is because of [1]. The second because of [2]. The third because of [3]

Jay
Reply all
Reply to author
Forward
0 new messages