src/Pure/goals.ML
changeset 3707 40856b593501
parent 3669 3384c6f1f095
child 3853 73c074f41749
equal deleted inserted replaced
3706:e57b5902822f 3707:40856b593501
   327 fun by_com tac ((th,ths), pairs) : gstack =
   327 fun by_com tac ((th,ths), pairs) : gstack =
   328   (case  Sequence.pull(tac th)  of
   328   (case  Sequence.pull(tac th)  of
   329      None      => error"by: tactic failed"
   329      None      => error"by: tactic failed"
   330    | Some(th2,ths2) => 
   330    | Some(th2,ths2) => 
   331        (if eq_thm(th,th2) 
   331        (if eq_thm(th,th2) 
   332 	  then writeln "Warning: same as previous level"
   332 	  then warning "Warning: same as previous level"
   333 	  else if eq_thm_sg(th,th2) then ()
   333 	  else if eq_thm_sg(th,th2) then ()
   334 	  else writeln ("Warning: signature of proof state has changed" ^
   334 	  else writeln ("Warning: signature of proof state has changed" ^
   335 		       sign_error (#sign(rep_thm th), #sign(rep_thm th2)));
   335 		       sign_error (#sign(rep_thm th), #sign(rep_thm th2)));
   336        ((th2,ths2)::(th,ths)::pairs)));
   336        ((th2,ths2)::(th,ths)::pairs)));
   337 
   337 
   349   | backtrack ((th,thstr) :: pairs) =
   349   | backtrack ((th,thstr) :: pairs) =
   350      (case Sequence.pull thstr of
   350      (case Sequence.pull thstr of
   351 	  None      => (writeln"Going back a level..."; backtrack pairs)
   351 	  None      => (writeln"Going back a level..."; backtrack pairs)
   352 	| Some(th2,thstr2) =>  
   352 	| Some(th2,thstr2) =>  
   353 	   (if eq_thm(th,th2) 
   353 	   (if eq_thm(th,th2) 
   354 	      then writeln "Warning: same as previous choice at this level"
   354 	      then warning "Warning: same as previous choice at this level"
   355 	      else if eq_thm_sg(th,th2) then ()
   355 	      else if eq_thm_sg(th,th2) then ()
   356 	      else writeln "Warning: signature of proof state has changed";
   356 	      else warning "Warning: signature of proof state has changed";
   357 	    (th2,thstr2)::pairs));
   357 	    (th2,thstr2)::pairs));
   358 
   358 
   359 fun back() = setstate (backtrack (getstate()));
   359 fun back() = setstate (backtrack (getstate()));
   360 
   360 
   361 (*Chop back to previous level of the proof*)
   361 (*Chop back to previous level of the proof*)