# Intelligent Reasoning Rules for Home Energy Management (IRRHEM): Algeria Case Study
## 2 IRRHEM Design and Development
### Intelligent Reasoning of IRRHEM  
Regardless of the tools, their formalisms, or methods of inference, knowledge-based systems, such as expert systems, are based on a clear separation between knowledge and methods of inference [27]. Thus knowledge, instead of being nested in the structure of the program (such as, the \"if... then... else... \" commands of a programming language), is considered as interchangeable data, susceptible to change [28]. It can be corrected, updated, and exploited by programs (inference engines), which simulate reasoning mechanisms and provide the interface with users [29]. Then, in any knowledge-based system or expert system, the following components will be found at the base:  
* The knowledge base is domain-specific and, unlike databases, is not limited to factual knowledge, or data [30]. It brings together all the types of knowledge relevant to the domain considered, namely, the description of objects and their relationships (for example, in the form of ontology), rules to be applied to make a diagnosis or solve a problem, and meta-knowledge making it possible to choose which rules apply. * The system remains at all times, in its working memory, a base of known facts (or instances of ontology). Thanks to it, the inference engine can choose the elements of its knowledge base, for example, the rules to be used effeciently and according to the facts available, and adapted to the problem posed [31]. The fact base grows as the inference engine infers new facts by applying knowledge to the already known facts. * The inference engine is the program that builds reasoning by drawing its materials from the knowledge base and the fact base. By examining the fact base, it detects interesting knowledge that can be applied to certain facts, connects them, and builds a resolution plan. It deduces new facts from those provided at the start or during the interaction by the user. Independent of the domain, the inference engine brings together the reasoning mechanisms that will exploit the knowledge base. * To these three essential components are added the interface modules, which are also independent of the field of knowledge. Thanks to them, the expert can easily access the knowledge base, modify it by correcting unnecessary or erroneous information, or by adding precision. The user can follow the reasoning of the system in a language that is natural to him, ask questions, and ask for explanations, without having to acquire in-depth knowledge of expert systems or computing [32]. IRRHEM is based on intelligent reasoning rules formulated by predicate logic and facts, whereby all the rules are loaded for the accomplishment of the tasks (Figures 5-7). * Rule 1 (R1) is concerned with adjusting the temperature in a specific place at home according to the wishes and the desires of residents. The use of this rule allows the cooling to stop when the temperature becomes less than 28 degrees Celsius. \begin{table}
\begin{tabular}{l l} \hline \hline
**Individual** & **Concept** \\ \hline TV & EquipmentHome \\ Refrigerator & EquipmentHome \\ Living room & Place \\ Breakfast & TaskResident \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Some examples for IRRHEM individuals (instances). Rule 2 (R2) is concerned with adjusting the temperature in a specific place at home according to the residents' desire. The use of this rule allows for the heating system to be stopped when the temperature becomes greater than 29 degrees Celsius. * Rule 3 (R3) is concerned with adjusting the lighting of a specific place inside the home to benefit from the external lighting, and thus turning off the lamps lead to the gain of a large amount of energy. However, by measuring the internal lighting, estimated at (10), and the external lighting, rated at (50), where we notice strong lighting outside, can be used by opening the windows and curtains. * For rule 4 (R4), in many cases, the light bulbs are left on despite the absence of people from the home.