Hi everyone. I am brand new to ciao. I am trying to get started with a MYCIN style program. The horse_riding example in contrib/mycin/examples looks good. But I get errors relating to modules, exports, etc.
I programmed in prolog years ago, but I am unfamiliar with the ciao module and compilation processes.
Would some kind soul please give me the minimum needed to call horse_riding:winner(X,P) from a. ciao shell b. compiling with ciaoc
Also, I am puzzled that horse_riding seems to be defined as winner/1 bvt the author suggests calling it as winner/2. Is this an error or is the Certainty Factor variabel an implicit 2nd arg?
John O'Gorman ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
John O'Gorman writes:
Also, I am puzzled that horse_riding seems to be defined as winner/1 bvt the author suggests calling it as winner/2. Is this an error or is the Certainty Factor variabel an implicit 2nd arg?
Kind of. The factor is embedded in a meta-interpretation predicate mycin/2. In fact, the author's comment should say horse_riding:mycin(winner(X),P) which is what you have to call. Thus, it is winner/1, but the meta-interpreter handles the "implicit" arg for the factor.
I am trying to get started with a MYCIN style program. The horse_riding example in contrib/mycin/examples looks good. But I get errors relating to modules, exports, etc.
This is because the mycin package has become obsolete wrt last changes in the module system. Since it is a contrib package, and the author could not continue supporting it. I have taken some time to redo it according to the changes mentioned. I will send the updated version to you.
Would some kind soul please give me the minimum needed to call horse_riding:winner(X,P) from a. ciao shell b. compiling with ciaoc
a. You simply load it and make the call. The call is as explained above (i.e., to mycin/2). To load: use_module(horse_riding).
b. ciaoc will build an executable, and this one needs a main entry point. This is provided in a file as a predicate main/0 or main/1. For example, you can make a file winner.pl to look like:
:- use_module(horse_riding).
main([C]):- mycin(winner(C),P), display(P), nl.
compile it, and then run things like:
winner arrow
0.44243199999999994
that gives you the factor for arrow being a winner...!
Hope this helps,
Paco Bueno ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------