src/Tools/Compute_Oracle/am.ML
author wenzelm
Tue, 17 Jul 2007 13:19:18 +0200
changeset 23823 441148ca8323
parent 23663 84b5c89b8b49
child 25217 3224db6415ae
permissions -rw-r--r--
added General/print_mode.ML, pure_setup.ML;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23663
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     1
signature ABSTRACT_MACHINE =
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     2
sig
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     3
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     4
datatype term = Var of int | Const of int | App of term * term | Abs of term
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     5
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     6
datatype pattern = PVar | PConst of int * (pattern list)
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     7
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     8
datatype guard = Guard of term * term
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
     9
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    10
type program
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    11
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    12
exception Compile of string;
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    13
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    14
(* The de-Bruijn index 0 occurring on the right hand side refers to the LAST pattern variable, when traversing the pattern from left to right,
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    15
   1 to the second last, and so on. *)
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    16
val compile : (guard list * pattern * term) list -> program
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    17
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    18
val discard : program -> unit
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    19
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    20
exception Run of string;
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    21
val run : program -> term -> term
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    22
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    23
end
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    24
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    25
structure AbstractMachine : ABSTRACT_MACHINE = 
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    26
struct
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    27
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    28
datatype term = Var of int | Const of int | App of term * term | Abs of term
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    29
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    30
datatype pattern = PVar | PConst of int * (pattern list)
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    31
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    32
datatype guard = Guard of term * term
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    33
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    34
type program = unit
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    35
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    36
exception Compile of string;
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    37
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    38
fun compile _ = raise Compile "abstract machine stub"
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    39
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    40
fun discard _ = raise Compile "abstract machine stub"
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    41
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    42
exception Run of string;
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    43
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    44
fun run p t = raise Run "abstract machine stub"
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    45
84b5c89b8b49 new version of computing oracle
obua
parents:
diff changeset
    46
end