expand : (tactic -> void)
If a tactic solves the current goal (returns an empty subgoal list), then its justification is used to prove a corresponding theorem. This theorem is incorporated into the justification of the parent goal and printed. If the subgoal was the last subgoal of the level, the level is removed and the parent goal is proved using its (new) justification. This process is repeated until a level with unproven subgoals is reached. The next goal on the goal stack then becomes the current goal. This goal is printed. If all the subgoals are proved, the resulting proof state consists of the theorem proved by the justifications.
The tactic applied is a validating version of the tactic given. It ensures that the justification of the tactic does provide a proof of the goal from the subgoals generated by the tactic. It will cause failure if this is not so. The tactical VALID performs this validation.
For a description of the subgoal package, see set_goal.
#expand CONJ_TAC;; OK.. evaluation failed no goals to expand #g "(HD[1;2;3] = 1) /\ (TL[1;2;3] = [2;3])";; "(HD[1;2;3] = 1) /\ (TL[1;2;3] = [2;3])" () : void #expand CONJ_TAC;; OK.. 2 subgoals "TL[1;2;3] = [2;3]" "HD[1;2;3] = 1" () : void #expand (REWRITE_TAC[HD]);; OK.. goal proved |- HD[1;2;3] = 1 Previous subproof: "TL[1;2;3] = [2;3]" () : void #expand (REWRITE_TAC[TL]);; OK.. goal proved |- TL[1;2;3] = [2;3] |- (HD[1;2;3] = 1) /\ (TL[1;2;3] = [2;3]) Previous subproof: goal proved () : voidIn the following example an invalid tactic is used. It is invalid because it assumes something that is not on the assumption list of the goal. The justification adds this assumption to the assumption list so the justification would not prove the goal that was set.
#set_goal([],"1=2");; "1 = 2" () : void #expand (REWRITE_TAC[ASSUME "1=2"]);; OK.. evaluation failed Invalid tactic