src/FOLP/ex/Prolog.thy
author chaieb
Sun, 08 Jul 2007 19:01:32 +0200
changeset 23650 0a6a719d24d5
parent 1477 4c51ab632cda
child 35762 af3ff2ba4c54
permissions -rw-r--r--
Show the use of reflection attribute; fixed comments about the order of absorbing equations : f (C x) = x ; now automaically tried as last;

(*  Title:      FOLP/ex/Prolog.thy
    ID:         $Id$
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    Copyright   1992  University of Cambridge

First-Order Logic: PROLOG examples

Inherits from FOL the class term, the type o, and the coercion Trueprop
*)

Prolog = FOL +
types   'a list
arities list    :: (term)term
consts  Nil     :: "'a list"
        ":"     :: "['a, 'a list]=> 'a list"            (infixr 60)
        app     :: "['a list, 'a list, 'a list] => o"
        rev     :: "['a list, 'a list] => o"
rules   appNil  "app(Nil,ys,ys)"
        appCons "app(xs,ys,zs) ==> app(x:xs, ys, x:zs)"
        revNil  "rev(Nil,Nil)"
        revCons "[| rev(xs,ys);  app(ys, x:Nil, zs) |] ==> rev(x:xs, zs)"
end