MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: prolog like search


siewsk at bp.com wrote:
> I would like to do prolog like searches in Mathematica
> 
> entities={ william , henry , diana , charles }
> Sonof(william,diana);
> Sonof(william,charles);
> Sonof(henry,diana);
> Sonof(henry,charles);
> 
> Married(A,B) := Sonof(S,A) && Sonof(S,B) && A != B;
> 
> PrologSearch(Married,entities)
> 
> returns { Married(diana,charles), Married(charles,diana) }
> 
> Any idea how this could be implemented in Mathematica?
> 
> 

The following notebooks might be a good source of inspiration.

/Logic Programming/ by Renan Cabrera: "This is a notebook that is 
inspired by the computer language Prolog and shows a possible way to 
emulate it with Mathematica." Available at

http://library.wolfram.com/infocenter/MathSource/809/

Regards,
Jean-Marc


  • Prev by Date: Re: Re: Weird result in Mathematica 6
  • Next by Date: Re: Compatibility woes
  • Previous by thread: Re: prolog like search
  • Next by thread: Re: prolog like search