As I'm trying to begin this assignment I'm having a difficult time decomposing some of the statements in the intro paragraphs of the prolog assignment.
I'm trying to get a grasp on =succeed and =fail.
Okay, so =succeed and =fail are prolog-expressions, which is a function of the form:
failure-continuation -> success-continuation.
The success continuation they return is:
some_arg -> [void OR success-continuation]
And the failure function they take as an argument is of the form:
some_arg -> [fail OR success-continuation]
So I tried to just write a generic failure-continuation:
(define fk (λ (x) 'fail)
it takes something it ignores and in this case just fails.
And I thought I'd try it out with the =succeed and =fail prolog-expressions.
So for the following:
(=succeed fk) ;L1
((=succeed fk) "done") ;L2
(=fail fk) ;L3
My thoughts on what these statements should do was:
L1 should return a procedure (a success-continuation).
L2 should not return anything (it is calling the success-continuation returned on L1 that should "succeed only once").
L3 should call the failure continuation, fk, and in this case it prints out the symbol 'fail.
Is that anywhere close to correct?
Thanks,
Andrew