Base case grammar simulated intelligence - Improve cut algorithm Cut not necessary, unless already there. Include rest of predicate code - A particular command that creates a choice point that returns - like a new predicate - run using this interpreter each time x used for trace retry and mind reader not grammar base cases - However, the grammar base case has to be differentiated from the code base case so that the algorithm can handle variables properly - It could have to return from the middle of a predicate, so needs the state saving interpreter - Give errors if the base case has singletons - Recognises a base case if it has no more calls - Go through each combination of variables in the base case (including the body) and tests for errors x - The base case's state needs to be saved by state saving interpreter and returned when it cuts open predicate at that point x returns - Cuts - can't go past them - State saving interpreter is part of redo in trace - Rename variables randomly for security Recognise base case (no other calls apart from [] or "" Links to clause arity, (which has a new arity given SI arguments for base case), with a unique code to run the desired clause arity, not other clauses which already have the same arity - Random code