5

What is the Herbrand universe, Herbrand Base and Herbrand Model of binary tree:

binary_tree(empty). 
binary_tree(tree(Left,Element,Right)) :- 
     binary_tree(Left), 
     binary_tree(Right). 
Ali Ismayilov
  • 1,707
  • 3
  • 22
  • 37

1 Answers1

8

The Herbrand universe are the ground terms of a given signature. Many Prolog systems have a predicate ground/1 which you can use to check whether a term is actually ground. The definition of ground/1 is that it doesn't contain variables:

?- ground(empty).
Yes
?- ground(tree(X,Y,Z)).
No

The Herbrand base are the ground prime formulas of a given signature. A prime formula is a predicate or an equality. You can also use ground/1 to check whether a prime formula is ground:

?- ground(a = X).
No
?- ground(a = b).
Yes
?- ground(binary_tree(X)).
No
?- ground(binary_tree(tree(empty,n,empty))).
Yes

A Herbrand model is a model where the universe is a Herbrand universe. Viewed as a diagram a Herbrand model is a subset of a Herbrand base. A theory might have none, one or many Herbrand models.

Horn Clauses always have a Herbrand model, in particular the full Herbrand model which is the Herbrand base itself, is always a model. Horn Clauses together with the Clark Equational Theory also have a unique minimal Herbrand model. Which is the fixpoint of the Herbrand program operator. Certain properties of the program operator allow to state that the fixpoint can be reached at stage omega.

But working with Herbrand models is clumsy, since they are not sorted. Many sorted signatures and corresponding ground models are more handy. For simplicity and to avoid many sorted logic in the present case we could assume that your program reads, i.e. that the tree elements are peano numbers:

binary_tree(empty). 
binary_tree(tree(Left,Element,Right)) :- 
    binary_tree(Left),
    tree_element(Element), 
    binary_tree(Right).
tree_element(n).
tree_element(s(X)) :-
    tree_element(X).

Then your binary tree definition would lead to the following recurrence relation:

T_0 = {}
T_n+1 = {binary_tree(empty)} u {binary_tree(tree(s,e,t)) | 
       binary_tree(s) in T_n, 
       tree_element(e) in T_n, 
       binary_tree(t) in T_n } u 
        {tree_element(n)} u {tree_element(s(e)) |
       tree_element(e) in T_n} u T_n

The unique minimal Herbrand model would then be T = union_n T_n which is the least fixpoint of the above recurrence relation. Looks like nothing has been said.

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
  • Maybe there is not an Herbrand model, because of singleton Element? I'm unable to enumerate the ground terms... – CapelliC Jul 16 '12 at 21:38
  • Stictly speaking, in first order logic, the universe has to be non-empty. So at least one constant needs to be assumed. –  Jul 16 '12 at 22:02
  • so, what is the Herbrand Universe here? HU={element} Am I right? – Ali Ismayilov Jul 17 '12 at 07:32
  • 1
    Unsorted with the signatur empty/0, n/0, s/1, tree/3 we have HU = {empty, n, s(empty), s(n), tree(empty,empty,empty), tree(n,empty,empty), etc..} –  Jul 17 '12 at 10:24