gapt.proofs.lk.transformations.inductionNormalForm.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gapt_3 Show documentation
Show all versions of gapt_3 Show documentation
General Architecture for Proof Theory
The newest version!
package gapt.proofs.lk.transformations
import gapt.proofs.context.Context
import gapt.proofs.lk.LKProof
object inductionNormalForm {
/**
* Transforms a proof to a proof without "unnecessary" induction inferences.
*
* @param proof The proof to which the transformation is applied.
* @param ctx The context with respect to which this proof transformation is computed.
* @return A proof obtained by repeated cut normalization and induction unfolding. The resulting proof does
* not contain inductions that can be unfolded.
*/
def apply(proof: LKProof)(implicit ctx: Context): LKProof = {
var newProof = proof
var continue = false
while ({
{
continue = false
newProof = pushEqualityInferencesToLeaves(newProof)
newProof = cutNormal(newProof)
val inductionUnfolder = new UnfoldInductions
newProof = inductionUnfolder(newProof)
continue = inductionUnfolder.unfoldedInduction
}; continue
}) ()
newProof
}
}