-- Apr 5 In-Class Exercise
work tape : PATH (1,4,3)
we need to compute PATH(1,1,2) && PATH(1,4,2)
push (1,1,2) on the work tape
work tape : (1,4,3) (1,1,2)
we need to compute PATH(1,1,1), PATH(1,1,1)
push PATH(1,1,1) on the work tape
work tape : PATH(1,4,3) PATH(1,1,2) PATH(1,1,1)
computation of PATH(1,1,0) returns true
therefore PATH(1,1,2) ==> true
now remove PATH(1,1,2) and push PATH(1,4,2) to the worktape
work tape : PATH(1,4,3) PATH(1,4,2)
computing: PATH(1,1,1) and PATH(1,4,1) push PATH(1,1,1) to work tape
work tape : PATH(1,4,3) PATH(1,1,1)
from above PATH(1,1,1) is true so we remove it and push PATH(1,4,1) tovwork tape
work tape : PATH(1,4,3) PATH(1,4,2) PATH(1,4,1)
computing PATH(1,4,1)
PATH(1,1,0) and PATH(,1,4,0)
PATH(1,1,0) return true and PATH(1,4,0) returns false
now for z'' = 2 we compute PATH(1,2,1) and PATH (2,4,1) push PATH(1,2,0) to the
work tape
work tape : PATH(1,4,3) PATH(1,4,2) PATH(1,2,1)
PATH(1,2,1) from the algorithm will evaluate to true
so we remove PATH(1,2,1) and push PATH(2,4,1) to the work tape
work tape : PATH(1,4,3) PATH(1,4,2) PATH(2,4,1)
to compute PATH(2,4,1) => PATH(2,1,0) and PATH(1,4,0) both of which are false
then we compute PATH(2,2,0) => true and PATH(2,4,0) => false
then we compute PATH(2,3,0) and PATH(3,4,0) both of which are true
which makes PATH(2,4,1) => true
which in turn makes PATH(1,4,2) => true
and so we get PATH(1,4,3) as true
(
Edited: 2017-04-05)
'''work tape''': PATH (1,4,3)
we need to compute PATH(1,1,2) && PATH(1,4,2)
push (1,1,2) on the work tape
'''work tape''': (1,4,3) (1,1,2)
we need to compute PATH(1,1,1), PATH(1,1,1)
push PATH(1,1,1) on the work tape
'''work tape''': PATH(1,4,3) PATH(1,1,2) PATH(1,1,1)
computation of PATH(1,1,0) returns true
therefore PATH(1,1,2) ==> true
now remove PATH(1,1,2) and push PATH(1,4,2) to the worktape
'''work tape''': PATH(1,4,3) PATH(1,4,2)
computing: PATH(1,1,1) and PATH(1,4,1) push PATH(1,1,1) to work tape
'''work tape''': PATH(1,4,3) PATH(1,1,1)
from above PATH(1,1,1) is true so we remove it and push PATH(1,4,1) tovwork tape
'''work tape''': PATH(1,4,3) PATH(1,4,2) PATH(1,4,1)
computing PATH(1,4,1)
PATH(1,1,0) and PATH(,1,4,0)
PATH(1,1,0) return true and PATH(1,4,0) returns false
now for z'' = 2 we compute PATH(1,2,1) and PATH (2,4,1) push PATH(1,2,0) to the
work tape
'''work tape''': PATH(1,4,3) PATH(1,4,2) PATH(1,2,1)
PATH(1,2,1) from the algorithm will evaluate to true
so we remove PATH(1,2,1) and push PATH(2,4,1) to the work tape
'''work tape''': PATH(1,4,3) PATH(1,4,2) PATH(2,4,1)
to compute PATH(2,4,1) => PATH(2,1,0) and PATH(1,4,0) both of which are false
then we compute PATH(2,2,0) => true and PATH(2,4,0) => false
then we compute PATH(2,3,0) and PATH(3,4,0) both of which are true
which makes PATH(2,4,1) => true
which in turn makes PATH(1,4,2) => true
and so we get PATH(1,4,3) as true