Konzeption Prototyp Rekursion
Rekursion
1. Type-inference (done)
- implemented in infer_types.pl
- detects stupid errors (list used as a number etc.)
- provides information about argument positions
example:
a([],0).
a(N,[A|Rest]):- N is ...
2. Idiom dection and matching (analyse.pl)
- detection of schemata / idioms, comparision:
construction, deconstruction, same
accumulation, consumption, consumption1
see index.plht (need to load analyse.pl first)
- superficial comparision to see if it looks like a sample solution
- provides additional information about argument position
- idiom detector -> list of idiom terms
- filtering of idiom terms -> only keep the interesting ones (same, list_uncons, list_cons, basecase, recursion, accu, successor, predecessor)
- matching of the filtered terms w/ idiom terms from sample solution
...:- match_bags(IdiomsFromUser, IdiomsFromSample,_IdiomMap,zuordnen_idiom,20), ...
zuordnen_idiom(accu(_,_),accu(_,_))-->[].
- result: possible mappings between predicates, argument positions
3a. Testing
- needs information about argument positions
- carefully selected test cases, random testing
3b. Transformation to Normal Form and subgoal matching
example:
last([E],E). => last(L,E):-L=[E|T],T=[].
- identification of missing / superfluous subgoals (auswertung.pl)
4. Instantiation check
- should not be needed in the presence of testing?
- arithmetic (checkInst)
- "monotonicity" of instantiation, e.g. broken construction of a list (look at the sample solution --- monotonicity constrainst fulfilled in the sample solution should be enforced in the user solution)
5. Syntax check with limited grammar
6. Open issues
*clause order, goal order and termination.
--
YannickVersley --
05 Dec 2003