src/HOL/Prolog/HOHH.thy
author wenzelm
Mon Nov 20 21:23:12 2006 +0100 (2006-11-20)
changeset 21425 c11ab38b78a7
parent 17311 5b1d47d920ce
child 21588 cd0dc678a205
permissions -rw-r--r--
HOL-Prolog: converted legacy ML scripts;
oheimb@13208
     1
(*  Title:    HOL/Prolog/HOHH.thy
oheimb@13208
     2
    ID:       $Id$
oheimb@13208
     3
    Author:   David von Oheimb (based on a lecture on Lambda Prolog by Nadathur)
oheimb@13208
     4
*)
oheimb@9015
     5
wenzelm@17311
     6
header {* Higher-order hereditary Harrop formulas *}
wenzelm@17311
     7
wenzelm@17311
     8
theory HOHH
wenzelm@17311
     9
imports HOL
wenzelm@21425
    10
uses "prolog.ML"
wenzelm@17311
    11
begin
oheimb@9015
    12
wenzelm@21425
    13
method_setup ptac =
wenzelm@21425
    14
  {* Method.thms_args (Method.SIMPLE_METHOD' HEADGOAL o Prolog.ptac) *}
wenzelm@21425
    15
  "Basic Lambda Prolog interpreter"
wenzelm@21425
    16
wenzelm@21425
    17
method_setup prolog =
wenzelm@21425
    18
  {* Method.thms_args (Method.SIMPLE_METHOD o Prolog.prolog_tac) *}
wenzelm@21425
    19
  "Lambda Prolog interpreter"
wenzelm@21425
    20
oheimb@9015
    21
consts
oheimb@9015
    22
wenzelm@17311
    23
(* D-formulas (programs):  D ::= !x. D | D .. D | D :- G | A            *)
wenzelm@21425
    24
  Dand        :: "[bool, bool] => bool"         (infixr ".." 28)
wenzelm@21425
    25
  Dif        :: "[bool, bool] => bool"         (infixl ":-" 29)
oheimb@9015
    26
wenzelm@17311
    27
(* G-formulas (goals):     G ::= A | G & G | G | G | ? x. G
wenzelm@17311
    28
                               | True | !x. G | D => G                  *)
wenzelm@21425
    29
(*Dand'         :: "[bool, bool] => bool"         (infixr "," 35)*)
wenzelm@21425
    30
  Dimp          :: "[bool, bool] => bool"         (infixr "=>" 27)
oheimb@9015
    31
oheimb@9015
    32
translations
oheimb@9015
    33
wenzelm@17311
    34
  "D :- G"      =>      "G --> D"
wenzelm@17311
    35
  "D1 .. D2"    =>      "D1 & D2"
wenzelm@17311
    36
(*"G1 , G2"     =>      "G1 & G2"*)
wenzelm@17311
    37
  "D => G"      =>      "D --> G"
oheimb@9015
    38
oheimb@9015
    39
end