For simplicity of implementation of the program simulator run.lp, it was initially chosen to require while statements to have a matching end_while statement after their body, so the simulator has a discrete instruction on which to return to the loop header. This was especially important when there are multiple nested loops all ending at the same point.
However, the efficiency of the program synthesiser learn.lp suffers from this, because it has to consider the contents of an extra line for each loop added to the program. The efficiency of learn.lp could be improved [citation needed] (while keeping its implementation simple) by removing end_while and accepting a more complex implementation of run.lp
Possible solutions:
Perform a translation behind the scenes that adds end_while statements to the program, as required.
Implement some extra state in run.lp to keep track of which while loop's body we have just exited.
Description:
For simplicity of implementation of the program simulator
run.lp
, it was initially chosen to requirewhile
statements to have a matchingend_while
statement after their body, so the simulator has a discrete instruction on which to return to the loop header. This was especially important when there are multiple nested loops all ending at the same point.However, the efficiency of the program synthesiser
learn.lp
suffers from this, because it has to consider the contents of an extra line for each loop added to the program. The efficiency oflearn.lp
could be improved [citation needed] (while keeping its implementation simple) by removingend_while
and accepting a more complex implementation ofrun.lp
Possible solutions:
end_while
statements to the program, as required.run.lp
to keep track of whichwhile
loop's body we have just exited.