src/HOL/Prolog/HOHH.thy
author wenzelm
Sun, 15 May 2011 17:45:53 +0200
changeset 43685 5af15f1e2ef6
parent 34961 18b41bba42b5
child 49906 c0eafbd55de3
permissions -rw-r--r--
simplified/unified method_setup/attribute_setup;
     1 (*  Title:    HOL/Prolog/HOHH.thy
     2     Author:   David von Oheimb (based on a lecture on Lambda Prolog by Nadathur)
     3 *)
     4 
     5 header {* Higher-order hereditary Harrop formulas *}
     6 
     7 theory HOHH
     8 imports HOL
     9 uses "prolog.ML"
    10 begin
    11 
    12 method_setup ptac =
    13   {* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD' (Prolog.ptac ctxt thms)) *}
    14   "basic Lambda Prolog interpreter"
    15 
    16 method_setup prolog =
    17   {* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD (Prolog.prolog_tac ctxt thms)) *}
    18   "Lambda Prolog interpreter"
    19 
    20 consts
    21 
    22 (* D-formulas (programs):  D ::= !x. D | D .. D | D :- G | A            *)
    23   Dand        :: "[bool, bool] => bool"         (infixr ".." 28)
    24   Dif        :: "[bool, bool] => bool"         (infixl ":-" 29)
    25 
    26 (* G-formulas (goals):     G ::= A | G & G | G | G | ? x. G
    27                                | True | !x. G | D => G                  *)
    28 (*Dand'         :: "[bool, bool] => bool"         (infixr "," 35)*)
    29   Dimp          :: "[bool, bool] => bool"         (infixr "=>" 27)
    30 
    31 translations
    32 
    33   "D :- G"      =>      "G --> D"
    34   "D1 .. D2"    =>      "D1 & D2"
    35 (*"G1 , G2"     =>      "G1 & G2"*)
    36   "D => G"      =>      "D --> G"
    37 
    38 end