Logic Programming:Functions,relations and equations - Doug DeGroot,Gary Lindstrm