sicp-ex-4.64



<< Previous exercise (4.63) | Index | Next exercise (4.65) >>


meteorgan

  
  
  
 first,  query (outranked-by (Bitdiddle Ben) ?who), after unifying the conclusion of rule. we will evaluate (outranked-by ?middle-manager ?boss), this will query (outranked-by ?staff-person ?boss) again, so it will be in infinite loop.  

; We're simply recursivly calling the rule with same inputs over and over again, which simply would result in infinite loop.
; The previous implementation of 'outranked-by' was calling itself recursivly with one of its argument filled with data which makes the 'supervisor' at some point find no result,
; which should (as i understand) stop the recursive call.
; Note : AND implies that when a variable isn't bound the other asssertions should fail.