30 11 19 find types append interpretbody bc - reverse order recursive multi-predicate - enter non base case (bc) first ^ ^ multi-predicates x one (possibly recursive) type V when "got specific part" if calls an earlier predicate later, copy it to earlier - don't call same predicate again (remember its type) decompose, build unwrap [[a]] unwrap [a] unwrap a string a wrap [a] wrap [[a]] big state machine - bc last do all bottom predicates before upper single point to multiple clauses to multiple base cases go up until find initial values x start at start * cycles - do all non bc before bc predicates have to be done logically forward "recursive" types - find types from all predicates in order, not finding bcs to plug into types, where recursive clauses have t->t, bc have t1->t2 checks needed types against list of known types for whole alg brackets(brackets(var(madeup))) to insert after wrap line:first item,(line or end) - list line:first item,bracket((line or end)) - recursive type line or end - separate top levels, not one inside other to make simpler - may not need recursive (based on predicate recursion) types, makes bug checking easier - 2 algs: one finds types of preds, other checks types of alg x need pred types to check types of alg The whole type needs to match (no more, no less) to have same type - construct type and then see if it is already there. - check types at call, interpret statement, outputs after returning from interpretbody Reverse type using extra variables computed at putvar stage. - bracket() form for types from unwrap, wrap (no [])