src/HOL/Prolog/HOHH.thy
author wenzelm
Thu Feb 11 23:00:22 2010 +0100 (2010-02-11)
changeset 35115 446c5063e4fd
parent 34974 18b41bba42b5
child 42814 5af15f1e2ef6
permissions -rw-r--r--
modernized translations;
formal markup of @{syntax_const} and @{const_syntax};
minor tuning;
oheimb@13208
     1
(*  Title:    HOL/Prolog/HOHH.thy
oheimb@13208
     2
    Author:   David von Oheimb (based on a lecture on Lambda Prolog by Nadathur)
oheimb@13208
     3
*)
oheimb@9015
     4
wenzelm@17311
     5
header {* Higher-order hereditary Harrop formulas *}
wenzelm@17311
     6
wenzelm@17311
     7
theory HOHH
wenzelm@17311
     8
imports HOL
wenzelm@21425
     9
uses "prolog.ML"
wenzelm@17311
    10
begin
oheimb@9015
    11
wenzelm@21425
    12
method_setup ptac =
wenzelm@30549
    13
  {* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD' (Prolog.ptac ctxt thms)) *}
wenzelm@21425
    14
  "Basic Lambda Prolog interpreter"
wenzelm@21425
    15
wenzelm@21425
    16
method_setup prolog =
wenzelm@30549
    17
  {* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD (Prolog.prolog_tac ctxt thms)) *}
wenzelm@21425
    18
  "Lambda Prolog interpreter"
wenzelm@21425
    19
oheimb@9015
    20
consts
oheimb@9015
    21
wenzelm@17311
    22
(* D-formulas (programs):  D ::= !x. D | D .. D | D :- G | A            *)
wenzelm@21425
    23
  Dand        :: "[bool, bool] => bool"         (infixr ".." 28)
wenzelm@21425
    24
  Dif        :: "[bool, bool] => bool"         (infixl ":-" 29)
oheimb@9015
    25
wenzelm@17311
    26
(* G-formulas (goals):     G ::= A | G & G | G | G | ? x. G
wenzelm@17311
    27
                               | True | !x. G | D => G                  *)
wenzelm@21425
    28
(*Dand'         :: "[bool, bool] => bool"         (infixr "," 35)*)
wenzelm@21425
    29
  Dimp          :: "[bool, bool] => bool"         (infixr "=>" 27)
oheimb@9015
    30
oheimb@9015
    31
translations
oheimb@9015
    32
wenzelm@17311
    33
  "D :- G"      =>      "G --> D"
wenzelm@17311
    34
  "D1 .. D2"    =>      "D1 & D2"
wenzelm@17311
    35
(*"G1 , G2"     =>      "G1 & G2"*)
wenzelm@17311
    36
  "D => G"      =>      "D --> G"
oheimb@9015
    37
oheimb@9015
    38
end