I am a newbee in PyKE, went over the tutorial, installed, ran examples.
Now I am writing rulebase of my own, and encountered a missing hole.
Suppose that I made a fact base consisting of simple facts.
Then made rulebase of FC and BC rules composing from the elementary facts.
How can i make rules of AND and OR conditions?
For example, (A and B) or C or (D and E) in Prolog would be something like this:
P :- (A, B); C; (D, E)
I would appreciate much for such initial help.
Young Park
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a newbee in PyKE, went over the tutorial, installed, ran examples.
Now I am writing rulebase of my own, and encountered a missing hole.
Suppose that I made a fact base consisting of simple facts.
Then made rulebase of FC and BC rules composing from the elementary facts.
How can i make rules of AND and OR conditions?
For example, (A and B) or C or (D and E) in Prolog would be something like this:
P :- (A, B); C; (D, E)
I would appreciate much for such initial help.
Facts are AND-ed be default in Pyke when you list more than one of them in a rule.
Pyke does not have OR-ing within a rule. Instead, you would use multiple rules. Using your Prolog example:
or, in Pyke:
-Bruce
Thank you Bruce.
Then how to implement rules like the following?
P :- A, (B; C), (D; E).
i.e. A and (B or C) and (D or E).
Thank you in advance for your help.
You can do this by creating subgoals:
P :- A, P2, P3.
P2 :- B.
P2 :- C.
P3 :- D.
P3 :- E.
-Bruce
You can, actually, make OR rules, though it's kind of a hack:
Last edit: Angle 2019-06-06