# What algorithm can I use for a rule based system? [closed]

I'm doing research for a system that is based on rules. The goal of the system is to fire when some of the rules are true.

Explanation (requirements/working of the algorithm):
The algorithm will run in the background of an app. There will be a lot of data available about the user. The algorithm will apply the defined Business Rules to the data. When an X amount of the rules result in true, the algorithm should fire. The goal of the algorithm is to fire when the user shows any possible problems (based on data / the business rules that result in true).

IF a user is in the app between 2-5AM more than 5 times in 2 weeks THEN the user is not sleeping at the correct times.
IF a user moved house twice THEN a user moves house a lot

The Business Rules are in the If condition(s) then action format. The condition can be of any type. It would be really nice if it will be "easy" to add new forms of conditions in the future and the algorithm can handle such changes.

I'm looking for an algorithm that can be of use for the goal described above. Preferably without the use of Machine Learning. So I'm looking for an up-to-date/newer version of an Expert System.

When I did research, almost every time I came back to an Expert System. I think it perfectly fits my requirements. However I can't find anything recent on Expert Systems. It looks like it is outdated, as mentioned in this post, four years ago.

I saw something like an Recommendation System in this post. Still I don't think this will solve my problem because it focuses on recommendations...

Does anyone else have ideas for an algorithm?

EDIT: Tried to add useful information

• It's not really clear to me what this algorithm is supposed to do. You've not given any precise description of it. At the most basic level, when you say "an algorithm that can be of use", do you mean "An algorithm that will determine which rules to fire in each possible state of the system"? If so, that's going to depend very much on how the rules are written and how powerful they are. – David Richerby Apr 19 '18 at 16:05
• Sorry, I updated my answer. I hope it is more clear now. @DavidRicherby – 476rick Apr 20 '18 at 9:01
• Not really, unfortunately. So the rules are of the form If condition then action but it’s not clear what form the conditions can take. Your example conditions seem to involve some fairly complex functions of the state, e.g. implicit events (user logged in at a certain time), counting etc. – David Richerby Apr 20 '18 at 10:09
• As I added in the question, it would be nice if it is possible that the algorithm can handle many different types of conditions. @DavidRicherby – 476rick Apr 20 '18 at 11:04