Sign in to follow this  

Forward Chaining Question

This topic is 3853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, anyone know a good way using forward chaining technique to make a default rule that fires if no other rules conditions are met? I know i can do this by listing all the conditions of the other rules in a rule but with not but its a bit messy. Thanks,

Share this post


Link to post
Share on other sites
I'm not sure what you mean by "using forward chaining technique", but if it's in a program then this should be very easy. Use an else or keep a boolean variable that becomes true when any other rule fires and do the last rule only if that variable is still false. You could also just put the "else" rule at the bottom with no conditions if earlier rules will cause the system to stop checking later rules.

Share this post


Link to post
Share on other sites
haha, i posted this at like 3am, allmost forgot about it.. Yeah thats pretty obvious just using a boolean to triger it a rule where the only condition is the boolean, i didnt want to go too specific because this is for an assignment, so was very much just looking for a general idea not an answer, thanks a lot !

Share this post


Link to post
Share on other sites
If it's a set of conditions that changes between one area of your program and another, I'd define a function to test the conditions, otherwise I'd just set a boolean once and check that.

Sounds so simple, I'm wondering if I misunderstood you. Otherwise, get some sleep! :)

Share this post


Link to post
Share on other sites

This topic is 3853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this