isac-java/src/java/isac/bridge/ToKernel.scala
author Walther Neuper <wneuper@ist.tugraz.at>
Tue, 18 Dec 2018 08:05:43 +0100
changeset 5235 3ca9690d3e8b
permissions -rw-r--r--
------ connection to new math-engine on Isabelle2018: question 3 to Lars
wneuper@5235
     1
//cp from Hello_PIDE.scala, two unresolved problems
wneuper@5235
     2
wneuper@5235
     3
import info.hupel.isabelle.Platform
wneuper@5235
     4
import info.hupel.isabelle.api._
wneuper@5235
     5
import info.hupel.isabelle.japi._
wneuper@5235
     6
import info.hupel.isabelle.setup._
wneuper@5235
     7
import java.nio.file.Path;
wneuper@5235
     8
wneuper@5235
     9
class ToKernel {
wneuper@5235
    10
wneuper@5235
    11
  //these two will go into a property file:
wneuper@5235
    12
  val path_str = "/home/wneuper/.isabelle/isabisac/heaps/polyml-5.7.1_x86-linux/libisabelle_Isac"
wneuper@5235
    13
  val version_str = "2018"
wneuper@5235
    14
  
wneuper@5235
    15
  val path = java.nio.file.Paths.get(path_str)	
wneuper@5235
    16
  val platform = Platform.guess.getOrElse(sys.error(Setup.UnknownPlatform.explain))
wneuper@5235
    17
  val version = Version.Stable(version_str)
wneuper@5235
    18
    
wneuper@5235
    19
  val setup = Setup(path, platform, version)
wneuper@5235
    20
  val res = Resources.dumpIsabelleResources().right.get
wneuper@5235
    21
  val config = Configuration.simple("Protocol")
wneuper@5235
    22
  val env = setup.makeEnvironment(res, Nil)           //problem with scheduler
wneuper@5235
    23
  
wneuper@5235
    24
  def connect : JSystem = System.create(env, config)  //problem with types
wneuper@5235
    25
}