It is possible to extend the information given by a lattice. Let us consider consider now the so called domain of weight values W used in the QLP (Qualified Logic Programming framework), whose elements are intended to represent proof costs, measured as the weighted depth of proof trees. In essence, W can be seen as lattice (ℕ ∪ {∞}, ≥), where ≥ is the reverse of the usual numerical ordering (with ∞ ≥ d for any d ∈ ℕ) and thus, the bottom elements is ∞ and the top element is 0 (and not vice versa). Moreover, lattice W is just the Dedeking-MacNeille completion of ℕ. Note that in this lattice the arithmetic operation “+” plays the role of a conjunction (it is easy to prove that in this setting such definition of & verifies the properties required).
member(infty).member(X) :- number(X).leq(infty,X).leq(X,Y):-X>=Y.top(0).bot(infty).and_plus(X,infty,infty). and_plus(infty,X,infty).and_plus(X,Y,Z):-Z is X+Y.
member(info(X,W)) :-number(X), 0=<X,X=<1,(W=infty,!; number(W),1=<W).leq(info(X1,W1),info(X2,W2)):-X1 =< X2, (W1=infty,!; number(W2), W2 =< W1).bot(info(0,infty)).top(info(1,1)).pri_add(infty,_,infty).pri_add(_,infty,infty).pri_add(X,Y,Z) :- number(X), number(Y), Z is X+Y.and_prod(info(X,W1),info(Y,W2),info(Z,W3)) :- pri_prod(X,Y,Z), pri_add(W1,W2,W3).
member(info(X,_)) :-number(X),0=<X,X=<1.bot(info(0,_)).top(info(1,_)).leq(info(X1,_),info(X2,_)) :- X1 =< X2.and_prod(info(X1,X2),info(Y1,Y2),info(Z1,Z2)) :-pri_prod(X1,Y1,Z1),pri_app(X2,Y2,Dat1),pri_app(Dat1,’&PROD.’,Z2).%% other connectivespri_app(X,Y,Z) :- name(X,L1), name(Y,L2), append(L1,L2,L3), name(Z,L3).pri_prod(X,Y,Z) :- Z is X * Y.%% other primitives
y(peter) with info(0.4, 'RULE1.').y(mary) with info(0.8, 'RULE2.').h(peter) with info(0.9, 'RULE3.').h(mary) with info(0.3, 'RULE4.').e(peter) with info(0.5, 'RULE5.').e(mary) with info(0.95, 'RULE6.').c(X) <prod (h(X) |prod e(X)) &prod y(X) with info(1, 'RULE7.').
Program P1 with extended information
>> run.[Truth_degree=info(0.72, RULE1.RULE2.RULE3.RULE4.@AVER2.|GODEL.|LUKA.@AVER.&GODEL.&PROD.), X=a]
member(info(X,_)) :-number(X),0=<X,X=<1.bot(info(0,_)).top(info(1,_)).leq(info(X1,_),info(X2,_)) :- X1 =< X2.and_prod(info(X1,X2),info(Y1,Y2),info(Z1,Z2)) :-pri_prod(X1,Y1,Z1,DatPROD),pri_app(X2,Y2,Dat1),pri_app(Dat1,’&PROD.’,Dat2),pri_app(Dat2,DatPROD,Z2).%% other connectivespri_app(X,Y,Z) :- name(X,L1), name(Y,L2), append(L1,L2,L3), name(Z,L3).pri_prod(X,Y,Z,’#PROD.’) :- Z is X * Y.%% other primitives
>> run.[Truth_degree=info(0.72, RULE1.RULE2.RULE3.RULE4.@AVER2.|GODEL.#MAX.|LUKA.#ADD.#MIN.@AVER.#ADD.#DIV.&GODEL.#MIN.&PROD.#PROD.), X=a]
In this fuzzy computed answer we obtain both the truth value (0.72) and substitution (X = a) associated to our goal, but also the sequence of program rules exploited when applying admissible steps as well as the proper fuzzy connectives evaluated during the interpretive phase, also detailing the set of primitive operators (of the form #label) they call.