i'm looking for the best data structure to represent prolog facts and rules bases in python for easy manipulation later , for example :
parent(abraham,ismael).
parent(abraham,isaac).
parent(isaac,iacob).
grandfather(B,N):- parent(B,P),parent(P,N).
is it the nested list like this :
base=[["parent","abraham","ismael"],["parent","abraham","isaac"],["parent","isaac","iacob"]]
or with dictionary :
base={"parent": ("abraham","ismael") ,"parent": ("abraham","isaac"), "parent":("isaac","iacob") }
or is there any best methods of representation that you suggest in this case .
PS: i mean by best : simplest , easiest , flexible way .