I have to implement an expert system in CLIPS that uses a grammar that can generate:
- I saw a tutorial.
- I went in a library.
- In library a tutorial I saw.
I receive an input from a user - let's suppose it it the first sentence - and I have to print a message like: YES G1 G4 G3 G8, if I can parse the input with my system or NO, otherwise.
In order to achieve this, I found a model system, implemented like:
(deffacts facts
(rule G1 S i B)
(rule G2 S in E)
(rule G3 B a C)
(rule G4 B saw B)
(rule G5 B went S)
(rule G6 B saw #)
(rule G7 B #)
(rule G8 C tutorial #)
(rule G9 D i B)
(rule G10 E a library B)
(rules S)
)
Now, I don't know how to implement the rules and I'm looking for some help.
Thank you!