src/Tools/isac/Interpret/script.sml
changeset 42438 31e1aa39b5cb
parent 42394 977788dfed26
child 48760 5e1e45b3ddef
equal deleted inserted replaced
42437:529008b1408e 42438:31e1aa39b5cb
  1655     raise PTREE "no tactics applicable at the end of a calculation"
  1655     raise PTREE "no tactics applicable at the end of a calculation"
  1656   | sel_appl_atomic_tacs pt (p,p_) =
  1656   | sel_appl_atomic_tacs pt (p,p_) =
  1657     if is_spec_pos p_ 
  1657     if is_spec_pos p_ 
  1658     then [get_obj g_tac pt p]
  1658     then [get_obj g_tac pt p]
  1659     else
  1659     else
  1660 	let val pp = par_pblobj pt p
  1660       let
  1661 	    val thy' = (get_obj g_domID pt pp):theory'
  1661         val pp = par_pblobj pt p
  1662 	    val thy = assoc_thy thy'
  1662         val thy' = (get_obj g_domID pt pp):theory'
  1663 	    val metID = get_obj g_metID pt pp
  1663         val thy = assoc_thy thy'
  1664 	    val metID' =if metID = e_metID 
  1664         val metID = get_obj g_metID pt pp
  1665 			then (thd3 o snd3) (get_obj g_origin pt pp)
  1665         val metID' =
  1666 			else metID
  1666           if metID = e_metID 
  1667 	    val {scr=Script sc,srls,erls,rew_ord'=ro,...} = get_met metID'
  1667           then (thd3 o snd3) (get_obj g_origin pt pp)
  1668 	    val ScrState (env,_,a,v,_,_) = get_istate pt (p,p_)
  1668           else metID
  1669 	    val alltacs = (*we expect at least 1 stac in a script*)
  1669         val {scr=Script sc,srls,erls,rew_ord'=ro,...} = get_met metID'
  1670 		map ((stac2tac pt thy) o rep_stacexpr o #2 o
  1670         val ScrState (env,_,a,v,_,_) = get_istate pt (p,p_)
  1671 		     (handle_leaf "selrul" thy' srls env a v)) (stacpbls sc)
  1671         val alltacs = (*we expect at least 1 stac in a script*)
  1672 	    val f = case p_ of
  1672           map ((stac2tac pt thy) o rep_stacexpr o #2 o
  1673 			Frm => get_obj g_form pt p
  1673            (handle_leaf "selrul" thy' srls env a v)) (stacpbls sc)
  1674 		      | Res => (fst o (get_obj g_result pt)) p
  1674         val f =
  1675 	(*WN071231 ? replace atomic_appl_tacs with applicable_in (ineff!) ?*)
  1675           case p_ of
  1676 	in (distinct o flat o 
  1676               Frm => get_obj g_form pt p
  1677 	    (map (atomic_appl_tacs thy ro erls f))) alltacs end;
  1677             | Res => (fst o (get_obj g_result pt)) p
       
  1678           (*WN071231 ? replace atomic_appl_tacs with applicable_in (ineff!) ?*)
       
  1679       in (distinct o flat o (map (atomic_appl_tacs thy ro erls f))) alltacs end;
  1678 	
  1680 	
  1679 
  1681 
  1680 (*
  1682 (*
  1681 end
  1683 end
  1682 open Interpreter;
  1684 open Interpreter;