Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 151593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:28:27+00:00 2026-05-11T09:28:27+00:00

I am trying to construct a rule-based system for interpreting data. However, I am

  • 0

I am trying to construct a rule-based system for interpreting data. However, I am having issues deciding on a way to construct the logic for storing and interpreting rules.

Currently, there is a database structure that quite complex, but will deal with all aspects of storing the rule data. The idea is that the system will be able to mimic the way that MS Outlook allows a user to add rules.

My problems are as follows:

  1. What pattern should I be using to store these rules inside objects?
  2. Should I use eval() or proper object orientation to execute the rules?

And example rule might be:

Dog must have collar in area park

Where each element (dog, must have, collar, in area, park) is a separate piece of logic to be interpreted.

Any general advice to the above questions is much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:28:28+00:00Added an answer on May 11, 2026 at 9:28 am

    I’ve never implemented a system like you describe in a ‘real world’ context, but I have played with them a considerable amount as hobby projects. My preferred approach is to use some kind of logic language like Prolog to make assertions and check them. You’d have assertions for where the park is, what it means to have something, what a dog is, and then you’d make a rule pretty much exactly like your example in parentheses at the bottom of your post. I’m sorry my Prolog is too rusty to give you a useful example… I’ve been playing with home-grown inference languages too long.

    There are Prolog interpreters available for embedding in most languages, though I’m not sure about PHP5. You could throw together something simple that does forward-chaining inference on rule data structures of your own creation in fairly short order, if you can’t find a Prolog interpreter. You may be interested in these notes on automated inference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 170k
  • Answers 170k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your question is not entirely clear -- and I am… May 12, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer That actually sounds pretty good to me. The only thing… May 12, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer Simplest is #inspect --------------------------------------------------------- Object#inspect obj.inspect => string ------------------------------------------------------------------------ Returns… May 12, 2026 at 2:07 pm

Related Questions

I am trying to construct a way to keep certain hard drive partitions/usb drives
I am trying to construct a TreeView from a Menu. My Code is like
I am trying to construct a page layout, where the left column has a
I am trying to construct a DateTime in C# one step at a time,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.