Hi, I'm currently working with Jess to implement a boolean expression
reduction application. All is going well but now I am stuck with those
parenthesis. The thing is, i've built my rules like so :

(defrule some-rule
  ?some-rule <- (expression ?x ?op ?z)
=>
 action)

Which are supposed to work ( and they do! ) with facts entered like this
(assert ( expression A AND B)).

Problem is, if i want to incorporate rules to simulate say distributivity,
then, if i keep the same structure i have now, i would get:

(assert (expression A OR (A AND B)))
(defrule some-rule
 ?some-rule <- (expression ?x ?op1 (?y ?op2 ?z))
=>
action)

but (?y ?op2 ?z) would not match with anything and is even interpreted as
being a function call. I am considering integrating another token in the
assert and rule to change it to

(assert (expression A OR (sub-exp A AND B)))
(defrule some-rule
 ?some-rule <- (expression ?x ?op1 (sub-exp ?y ?op2 ?z))
=>
action)

so it can be interpreted as being a fact and not a function call. What i am
wondering is if it couldn't be done in another way? I find this "sub-exp"
addition to be quite annoying ( in my application's context ) and will
require me to add some processing time which i would like to bypass.


Anyone can help me?



Daniel Carrier



---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to