Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Prolog/Inference Engines

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

This article needs attention from experts! By default Prolog does a top-down logic inference. Example: clever(joe). handsome(joe). hasgirlfriend(X):- clever(X),handsome(X). We run this as "hasgirlfriend(X)." to get the people who have a girlfriend. Bi-directional inference: clever(joe). handsome(joe). rule([handsome(joe),clever(joe)],(hasgirlfriend(joe))). run:- call(rule(X,Y)),findall(A,(member(A,X),call(A)),L), length(X,Rulelength), length(L,Rulelength), assert(Y),print(Y). We run this as "run.". We don't have to directly ask who has a girlfriend, it gives us all results that can be implied. The benefit of bidirectional inferencing is the speed gain.