src/Doc/Implementation/Proof.thy
changeset 59902 6afbe5a99139
parent 59567 3ff1dd7ac7f0
child 60642 48dd1cefb4ae
equal deleted inserted replaced
59901:840d03805755 59902:6afbe5a99139
   160 \<close>
   160 \<close>
   161 
   161 
   162 text %mlex \<open>The following example shows how to work with fixed term
   162 text %mlex \<open>The following example shows how to work with fixed term
   163   and type parameters and with type-inference.\<close>
   163   and type parameters and with type-inference.\<close>
   164 
   164 
   165 ML \<open>
   165 ML_val \<open>
   166   (*static compile-time context -- for testing only*)
   166   (*static compile-time context -- for testing only*)
   167   val ctxt0 = @{context};
   167   val ctxt0 = @{context};
   168 
   168 
   169   (*locally fixed parameters -- no type assignment yet*)
   169   (*locally fixed parameters -- no type assignment yet*)
   170   val ([x, y], ctxt1) = ctxt0 |> Variable.add_fixes ["x", "y"];
   170   val ([x, y], ctxt1) = ctxt0 |> Variable.add_fixes ["x", "y"];
   186   literally: @{text "x"} is mapped again to @{text "x"}, and
   186   literally: @{text "x"} is mapped again to @{text "x"}, and
   187   attempting to fix it again in the subsequent context is an error.
   187   attempting to fix it again in the subsequent context is an error.
   188   Alternatively, fixed parameters can be renamed explicitly as
   188   Alternatively, fixed parameters can be renamed explicitly as
   189   follows:\<close>
   189   follows:\<close>
   190 
   190 
   191 ML \<open>
   191 ML_val \<open>
   192   val ctxt0 = @{context};
   192   val ctxt0 = @{context};
   193   val ([x1, x2, x3], ctxt1) =
   193   val ([x1, x2, x3], ctxt1) =
   194     ctxt0 |> Variable.variant_fixes ["x", "x", "x"];
   194     ctxt0 |> Variable.variant_fixes ["x", "x", "x"];
   195 \<close>
   195 \<close>
   196 
   196 
   323   derived by building up a context of assumptions first, and exporting
   323   derived by building up a context of assumptions first, and exporting
   324   some local fact afterwards.  We refer to @{theory Pure} equality
   324   some local fact afterwards.  We refer to @{theory Pure} equality
   325   here for testing purposes.
   325   here for testing purposes.
   326 \<close>
   326 \<close>
   327 
   327 
   328 ML \<open>
   328 ML_val \<open>
   329   (*static compile-time context -- for testing only*)
   329   (*static compile-time context -- for testing only*)
   330   val ctxt0 = @{context};
   330   val ctxt0 = @{context};
   331 
   331 
   332   val ([eq], ctxt1) =
   332   val ([eq], ctxt1) =
   333     ctxt0 |> Assumption.add_assumes [@{cprop "x \<equiv> y"}];
   333     ctxt0 |> Assumption.add_assumes [@{cprop "x \<equiv> y"}];