src/Tools/Metis/PortableIsabelle.sml
author wenzelm
Thu, 01 Apr 2021 19:01:19 +0200
changeset 73528 c337c798f64c
parent 59179 cad8a0012a12
child 78650 47d0c333d155
permissions -rw-r--r--
clarified HTML template (see also 04cb7e02ca38): avoid odd patching of sources;

(*  Title:      Tools/Metis/PortableIsabelle.sml
    Author:     Jasmin Blanchette, TU Muenchen
    Copyright   2010

Isabelle-specific setup for Metis. Based on "src/PortablePolyml.sml".
*)

structure Portable :> Portable =
struct

val ml = "isabelle"

fun pointerEqual (x : 'a, y : 'a) = pointer_eq (x, y)

local
  val lock = Mutex.mutex ();
in
  fun critical e () = Multithreading.synchronized "metis" lock e
end;

val randomWord = Random.nextWord
val randomBool = Random.nextBool
val randomInt = Random.nextInt
val randomReal = Random.nextReal

fun time f x = f x (* dummy *)

end

datatype 'a frag = QUOTE of string | ANTIQUOTE of 'a