Scheme Invariant 
Author Message
 Scheme Invariant

Here is a Scheme length procedure which returns the length of a list :

(define (length lis)
   (letrec ((loop (lamda(i rest)
        (if (null? rest) i
                (loop (+ i 1) (cdr resr))))))
      (loop 0 lis)))

What is the loop invariant for this procedure ?

How does length's loop invariant help to determine its loop termination
test ?

-- ckkan



Fri, 11 Sep 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Why is Eiffel's loop invariant different from the usual definition of loop invariant?

2. Transformation and invariant properties.

3. Eiffel quiz #1: Class invariant, non-atomic update of multiple objects

4. Eiffel quiz #1: Class invariant, non-atomic update of multiple objects

5. Invariant rule

6. Gfx - scale invariant text?

7. Gfx - scale invariant text?

8. Eiffel quiz #1: Class invariant, non-atomic update of multiple objects

9. does SE check ensure and invariant by default?

10. Urgent! Inheritance and invariant

11. Inheritance and invariant

12. scope of class invariant/s

 

 
Powered by phpBB® Forum Software