From tfm%computer-lab.cambridge.ac.uk Thu, 1 Jun 89
Date: Thu, 1 Jun 89 22:55:46 BST
From: Tom Melham <tfm%computer-lab.cambridge.ac.uk>
To: info-hol%clover.ucdavis.edu
Subject: Re: recently mentioned problem with STRIP_ASSUME_TAC.
Status: RO

RE: Roger Jones' recently reported bug.
=======================================

I think I can help with this one.  The problem Roger mentioned looked vaguely
familiar, so I had a look in my "bugs" archive.  Sure enough, I found
something that's relevant.  In fact, as it happens, I spotted this bug a while
ago (in 1987, actually) developed a preliminary fix for it.  I then forgot to
install it!  Sorry about that.



The problem is due to a bug in X_CHOOSE_THEN, which just throws away the
assumptions of its input theorem.  Here is the original code (defined in
tacont.ml):

let X_CHOOSE_THEN y ttac xth :tactic =
    let x,body = dest_exists (concl xth) ? failwith `X_CHOOSE_THEN` in
    \(asl,w).
        let gl,prf = ttac (ASSUME (subst [y,x] body)) (asl,w) in
        gl, (CHOOSE (y, xth)) o prf;;

Here is the bug fix I developed, but forgot to install:



let X_CHOOSE_THEN y ttac xth :tactic =
    let x,body = dest_exists (concl xth) ? failwith `X_CHOOSE_THEN` in
    \(asl,w).
        let th = itlist ADD_ASSUM (hyp xth) (ASSUME (subst [y,x] body)) in
        let gl,prf = ttac th (asl,w) in
        gl, (CHOOSE (y, xth)) o prf;;

I think this is right.  I'll have another careful look at it, and (if it's ok)
we'll install it in the next release.  Meanwhile, to patch your system, just
replace X_CHOOSE_THEN as shown above.  Let me know if there are any problems.

Oh yes... after installing the patch, you'll have to recompile.  No need for a
total rebuild; the makefile should take care of the dependencies.

Tom









