Re: SWI - passing variable value across rules
- From: "Advait" <advait_raut@xxxxxxxxxxxxxx>
- Date: 22 May 2006 11:56:09 -0700
I would like to say something--------
Muthukumar. U. wrote,
choice2(sechoice(X)) never seems to get translated to choice2(yes) or choice2(no).
1. Facts and rules themselves cannot be get converted into other
structure.
2. Prolog is based on first order logic.
I can suggest following program
%%% Knowledge Base %%%%%%%
%
%
%
%
%%% End of KB %%%%%%%%
go:-
writeq('Please provide a file name'),
read(File),
assertz(file(File)),
isrelatedto(File,Name),
writeq(Name),writeq('Want more? Type yes or no'),read(Choice),
writeq('Want to add new facts? Type yes or no'),read(Choice2),
choice(Choice),
choice2(Choice2).
%%%%%%%%%%%%%%%%%%%
choice(yes):-
isrelatedto(file(File),Name),
choice2(sechoice(X)).
choice(no).
%%%%%%%%%%%%%%%%%%%
choice2(yes):-
writeq('Please enter file name'),
read(Newfile),writeq('Please enter connected to entity'),
read(Connectedto),assertz(isrelatedto2(Newfile,Connectedto)).
choice2(no):-
writeq('Thank you for using the system').
Muthukumar. U. , Don't forget to add
***isrelatedto(file(filename),data)**** in your database.
The knowledge base you have given in the program is not enough
explanatory.
It would be better to explain if you could describe interface of your
program.
--------------------
yours,
Advait
.
- Follow-Ups:
- Re: SWI - passing variable value across rules
- From: muthu_u
- Re: SWI - passing variable value across rules
- References:
- SWI - passing variable value across rules
- From: muthu_u
- SWI - passing variable value across rules
- Prev by Date: Re: Bug detected in buggy GNU-Prolog
- Next by Date: Re: SWI - passing variable value across rules
- Previous by thread: Re: SWI - passing variable value across rules
- Next by thread: Re: SWI - passing variable value across rules
- Index(es):
Relevant Pages
|
|