In this homework you will explore how to write recursive
Theseus plans. Recursion is used in Theseus as means for achieving
loop-like control flow. Expressing loops in dataflow systems often requires
a lot of ugly synchronization; however, looping with recursion
results in shorter, elegant dataflow plans that do not require
the same type of synchronization.
For example, given the following input set of restaurants and their health ratings.
RELATION restaurants: place char, rating number Burger King|81 Taco Bell|72 McDonalds|51 Subway|77 California Pizza Kitchen|95 Baja Fresh|90 Berris|92 Natalee|96 Edies|45 Chin Chin|89 Islands|84 Il Fornaio|87 Cheesecacke Factory|82 McCormick and Schmicks|85 Youngsusan|91 Lawrys|92 Wolfgang Pucks|81 Spago|90 Alto Palato|94 Ruths Chris Steak House|92 Chart House|93 Benihanas|88 Panda Express|67You want the following result:
Youngsusan, 91 Ruths Chris Steak House, 92 Alto Palato, 94 Lawrys, 92 California Pizza Kitchen, 95 Berris, 92 Natalee, 96 Chart House, 93To do this, you are going to use recursion. The pseudo-code for what you want to do is shown below; your challenge is to translate it into a dataflow plan that runs in Theseus.
Your plan should have one input (that takes a restaurant list) and one output (the ones that average above 90). It should somehow call itself recursively to solve the problem presented above.
Pseudo-code
| What to turn in |
| Questions and comments |