;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;  MDH - updated 071117; MDH  2006 - extraction of realizers from 
;;;  a proof of the Induction Axiom for Purely Existential formulas 
;;;  The IA is proved, as usual, in terms of the Induction Rule (IR)
;;;  The particular realizers are feasible and we can display them
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(load "~/minlog/init.scm")
(set! COMMENT-FLAG #f)
(libload "nat.scm")
(mload "../modules/diatup.scm")
(mload "../examples/diatup/IndAxiom/IndAxSrc.scm")
(av "A" (py "nat => nat => boole"))
(define IndAcnst  (all-formulas-to-ind-aconst (pf "all n ex m (A n m)")))
(define vatmp (time (DIA-IndAx-extract 'light IndAcnst)))
(define untup (tmpair-to-tuple (vatmpair-to-tmpair vatmp)))
(define tmlst (tmtuple-to-tmlist untup))
(length tmlst)
(define LDet1 (car tmlst))
(define LDet2 (cadr tmlst))
(define LDet3 (caddr tmlst))
(type-to-string (term-to-type LDet1))
(string-length (term-to-string LDet1))
(type-to-string (term-to-type LDet2))
(string-length (term-to-string LDet2))
(type-to-string (term-to-type LDet3))
(string-length (term-to-string LDet3))

(set! UNFOLDING-FLAG #t)
(define NLDet1 (nt LDet1))
(string-length (term-to-string NLDet1))
(define NLDet2 (nt LDet2))
(string-length (term-to-string NLDet2))
(define NLDet3 (nt LDet3))
(string-length (term-to-string NLDet3))
;;;  ; (set! COMMENT-FLAG #t)
;;;  ; (pp NLDet1)
;;;  ; (pp NLDet2)
;;;  ; (pp NLDet3)