13208
|
1 |
(* Title: HOL/Prolog/HOHH.thy
|
|
2 |
Author: David von Oheimb (based on a lecture on Lambda Prolog by Nadathur)
|
|
3 |
*)
|
9015
|
4 |
|
17311
|
5 |
header {* Higher-order hereditary Harrop formulas *}
|
|
6 |
|
|
7 |
theory HOHH
|
|
8 |
imports HOL
|
|
9 |
begin
|
9015
|
10 |
|
48891
|
11 |
ML_file "prolog.ML"
|
|
12 |
|
21425
|
13 |
method_setup ptac =
|
30549
|
14 |
{* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD' (Prolog.ptac ctxt thms)) *}
|
42814
|
15 |
"basic Lambda Prolog interpreter"
|
21425
|
16 |
|
|
17 |
method_setup prolog =
|
30549
|
18 |
{* Attrib.thms >> (fn thms => fn ctxt => SIMPLE_METHOD (Prolog.prolog_tac ctxt thms)) *}
|
21425
|
19 |
"Lambda Prolog interpreter"
|
|
20 |
|
9015
|
21 |
consts
|
|
22 |
|
17311
|
23 |
(* D-formulas (programs): D ::= !x. D | D .. D | D :- G | A *)
|
21425
|
24 |
Dand :: "[bool, bool] => bool" (infixr ".." 28)
|
|
25 |
Dif :: "[bool, bool] => bool" (infixl ":-" 29)
|
9015
|
26 |
|
17311
|
27 |
(* G-formulas (goals): G ::= A | G & G | G | G | ? x. G
|
|
28 |
| True | !x. G | D => G *)
|
21425
|
29 |
(*Dand' :: "[bool, bool] => bool" (infixr "," 35)*)
|
|
30 |
Dimp :: "[bool, bool] => bool" (infixr "=>" 27)
|
9015
|
31 |
|
|
32 |
translations
|
|
33 |
|
17311
|
34 |
"D :- G" => "G --> D"
|
|
35 |
"D1 .. D2" => "D1 & D2"
|
|
36 |
(*"G1 , G2" => "G1 & G2"*)
|
|
37 |
"D => G" => "D --> G"
|
9015
|
38 |
|
|
39 |
end
|