src/HOLCF/sprod3.thy
author paulson
Fri, 08 Dec 1995 10:39:52 +0100
changeset 1394 a1d2735f5ade
parent 243 c22b85994e17
permissions -rw-r--r--
New function read_cterms is a combination of read_def_cterm and read_cterm. It reads and simultaneously type-checks a list of strings. cterm_of no longer catches exception TYPE; instead it must be caught later on and a message printed using Sign.exn_type_msg. More informative messages can be printed this way.

(*  Title: 	HOLCF/sprod3.thy
    ID:         $Id$
    Author: 	Franz Regensburger
    Copyright   1993 Technische Universitaet Muenchen

Class instance of  ** for class pcpo
*)

Sprod3 = Sprod2 +

arities "**" :: (pcpo,pcpo)pcpo			(* Witness sprod2.ML *)

consts  
	"@spair"     :: "'a => 'b => ('a**'b)" ("_##_" [101,100] 100)
	"cop @spair" :: "'a -> 'b -> ('a**'b)" ("spair")
					(* continuous strict pairing *)
	sfst         :: "('a**'b)->'a"
	ssnd         :: "('a**'b)->'b"
	ssplit       :: "('a->'b->'c)->('a**'b)->'c"

rules 

inst_sprod_pcpo	"UU::'a**'b = Ispair(UU,UU)"
spair_def	"spair  == (LAM x y.Ispair(x,y))"
sfst_def	"sfst   == (LAM p.Isfst(p))"
ssnd_def	"ssnd   == (LAM p.Issnd(p))"	
ssplit_def	"ssplit == (LAM f. strictify[LAM p.f[sfst[p]][ssnd[p]]])"

end

ML

(* ----------------------------------------------------------------------*)
(* parse translations for the above mixfix                               *)
(* ----------------------------------------------------------------------*)

val parse_translation = [("@spair",mk_cinfixtr "@spair")];