How to Call SWI-Prolog from PHP 5

I have scripts on my Web site that call SWI-Prolog from PHP 5. They run: a game for teaching Prolog, where the players are "intelligent" lorries that survive by buying and selling their freight, and buying petrol with the profit thereby earned; a science-fiction plot generator; and a generator of examples in category theory. A reader saw these last week and asked me why his Prolog-from-PHP script didn't work; so I'm going to explain how to code ones that do. My examples should work, mutatis mutandis, with other Prologs and other languages; and if you program in SWI-Prolog, they'll give you tested code that will get you started straight away.



February 10, 2010
URL:http://www.drdobbs.com/web-development/how-to-call-swi-prolog-from-php-5/228701085

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.