|
osdir.com mailing list archive F.A.Q. -since 2001! |
|
|
|
Subject: Prolog-Matlab interface - msg#00042List: lang.swi-prolog.general
by Date: Prev Next Date Index by Thread: Prev Next Thread Index
Hi all,
For those of you in the (probably quite small) intersection of SWI Prolog users and Matlab users and Unix users, I would like to contribute a small library that I and my colleague Christophe Rhodes have been using in our work. It allows instances of Matlab to be started and used from SWI Prolog. In the simplest cases you can use the ===/2 operator much in the same spirit as would use the is/2 operator, except that ===/2 understands Matlab expressions and any of the Matlab functions on your system. There are some complications due to Matlab syntax not quite matching up with Prolog syntax, and some issues to do with converting Matlab types in to Prolog types. As I say, you can indeed call any Matlab function including the ones that create sounds and graphics. Plus, there is a mechanism for making Matlab values persistent in a relatively seamless way, by saving the value in a .mat file with a dynamically generated name in a designated directory. The value is then represented as a locator term which we know to interpret as the value inside the named file. (In our work we use Prolog to plan, manage, and store the results of complex systems of computation, putting these locator terms in a database so we can keep track of which computations were done.) There are more details in the README file in the tarball you can find here: http://www.elec.qmul.ac.uk/digitalmusic/downloads/index.html#plml Feel free to email if you have any problems with building or installation. Now the disclaimer! There are certainly some horrors to be found in the code, and probably many more apparent to more seasoned Prolog hands than myself, so we would welcome any suggestions on how to improve the interface or the implementation. Anyway, I hope the library is of use to some of you. Samer
Thread at a glance:
Previous Message by Date:Re: Syntax of '#include' in XPCE defaultsTom, On Wednesday 16 August 2006 20:24, Tom Conlon wrote: > I'm having trouble with the .xpce/defaults '#include' statement. > > According to the user guide, "default files may include other default > files using the statement #include file" > > -- but I can't figure out what syntax to use when the path to the > file (or the filename) includes a space. > > For instance, this works fine: > > #include /Users/tom/myproject/mydefaults > > -- but this does not: > > #include /Users/tom/my project/mydefaults > > I've tried various combinations of quotes, backslashes, etc, without > success. Just doesn't work. Fixed to use anything upto the end of the line, stripping trailing whitespace though. Now we have to wait for the first one to want newlines in the filename or files starting or ending with spaces :-) All the rest should be fine ... --- Jan Next Message by Date:Re: Prolog-Matlab interfaceThanks guys - I look forward to playing with it! Contrary to your suggestion, I think this might turn out to be quite a popular contribution. Simon Samer Abdallah wrote: Hi all, For those of you in the (probably quite small) intersection of SWI Prolog users and Matlab users and Unix users, I would like to contribute a small library that I and my colleague Christophe Rhodes have been using in our work. It allows instances of Matlab to be started and used from SWI Prolog. In the simplest cases you can use the ===/2 operator much in the same spirit as would use the is/2 operator, except that ===/2 understands Matlab expressions and any of the Matlab functions on your system. There are some complications due to Matlab syntax not quite matching up with Prolog syntax, and some issues to do with converting Matlab types in to Prolog types. As I say, you can indeed call any Matlab function including the ones that create sounds and graphics. Plus, there is a mechanism for making Matlab values persistent in a relatively seamless way, by saving the value in a .mat file with a dynamically generated name in a designated directory. The value is then represented as a locator term which we know to interpret as the value inside the named file. (In our work we use Prolog to plan, manage, and store the results of complex systems of computation, putting these locator terms in a database so we can keep track of which computations were done.) There are more details in the README file in the tarball you can find here: http://www.elec.qmul.ac.uk/digitalmusic/downloads/index.html#plml Feel free to email if you have any problems with building or installation. Now the disclaimer! There are certainly some horrors to be found in the code, and probably many more apparent to more seasoned Prolog hands than myself, so we would welcome any suggestions on how to improve the interface or the implementation. Anyway, I hope the library is of use to some of you. Samer ------------ For further info, please visit http://www.swi-prolog.org/ To unsubscribe, send a plaintext mail with "unsubscribe prolog <e-mail>" in its body to majordomo-FT9nftu9LUxX9el/+yt6TA@xxxxxxxxxxxxxxxx -- Simon Price http://www.ilrt.bris.ac.uk/aboutus/staff?search=ecsnp Previous Message by Thread:Syntax of '#include' in XPCE defaultsHello,I'm having trouble with the .xpce/defaults '#include' statement.According to the user guide, "default files may include other default files using the statement #include file"-- but I can't figure out what syntax to use when the path to the file (or the filename) includes a space. For instance, this works fine:#include /Users/tom/myproject/mydefaults-- but this does not:#include /Users/tom/my project/mydefaultsI've tried various combinations of quotes, backslashes, etc, without success.Any help appreciated!Tom Next Message by Thread:Re: Prolog-Matlab interfaceThanks guys - I look forward to playing with it! Contrary to your suggestion, I think this might turn out to be quite a popular contribution. Simon Samer Abdallah wrote: Hi all, For those of you in the (probably quite small) intersection of SWI Prolog users and Matlab users and Unix users, I would like to contribute a small library that I and my colleague Christophe Rhodes have been using in our work. It allows instances of Matlab to be started and used from SWI Prolog. In the simplest cases you can use the ===/2 operator much in the same spirit as would use the is/2 operator, except that ===/2 understands Matlab expressions and any of the Matlab functions on your system. There are some complications due to Matlab syntax not quite matching up with Prolog syntax, and some issues to do with converting Matlab types in to Prolog types. As I say, you can indeed call any Matlab function including the ones that create sounds and graphics. Plus, there is a mechanism for making Matlab values persistent in a relatively seamless way, by saving the value in a .mat file with a dynamically generated name in a designated directory. The value is then represented as a locator term which we know to interpret as the value inside the named file. (In our work we use Prolog to plan, manage, and store the results of complex systems of computation, putting these locator terms in a database so we can keep track of which computations were done.) There are more details in the README file in the tarball you can find here: http://www.elec.qmul.ac.uk/digitalmusic/downloads/index.html#plml Feel free to email if you have any problems with building or installation. Now the disclaimer! There are certainly some horrors to be found in the code, and probably many more apparent to more seasoned Prolog hands than myself, so we would welcome any suggestions on how to improve the interface or the implementation. Anyway, I hope the library is of use to some of you. Samer ------------ For further info, please visit http://www.swi-prolog.org/ To unsubscribe, send a plaintext mail with "unsubscribe prolog <e-mail>" in its body to majordomo-FT9nftu9LUxX9el/+yt6TA@xxxxxxxxxxxxxxxx -- Simon Price http://www.ilrt.bris.ac.uk/aboutus/staff?search=ecsnp
blog comments powered by Disqus
|
|