Proving weak termination also provides the right way to terminate - extended version -
Résumé
From an inductive method for proving weak innermost termination of rule-based programs, we automatically infer, for each successful proof, a finite strategy for data evaluation. The proof principle uses an explicit induction on the termination property, to prove that any input data has at least one finite evaluation. For that, we analyse proof trees built from the rewrite system, schematizing the innermost derivations of any ground term. These proof trees are issued from patterns representing sets of ground terms. They are generated using two mechanisms, namely abstraction, introducing variables that represent ground terms in normal form, and narrowing, schematizing rewriting on ground terms. From the proof trees, we can extract for any given ground term, a rewriting strategy to compute one of its normal form, even if the ground term admits infinite rewriting derivations.