MathGroup Archive 2007

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

Search the Archive

Re: prolog like search

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76648] Re: prolog like search
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 25 May 2007 06:33:03 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f33rbj$mod$1@smc.vnet.net>

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