Logic-based Software Program

From GM-RKB
Jump to navigation Jump to search

A Logic-based Software Program is a declarative program that follows a computational logic paradigm.



References

2011

grandparent(X,Y) :- parent(X,Z), parent(Z,Y).
parent(X,Y) :- father(X,Y).
parent(X,Y) :- mother(X,Y).
father(charles, william).
mother(diana, william).
father(philip, charles).
mother(elizabeth, charles).
father(john, diana).
mother(frances, diana).
    • Using resolution we obtain the following answers to the query :-grandparent(X,Y):
X = philip,  Y = william ;
X = john,  Y = william ;
X = elizabeth,  Y = william ;
X = frances,  Y = william.