A prototype of a RBES for personalized menus generation
Introduction
People have many constraints concerning the food they eat. These constraints can be based on religious believes, be due to food allergies or illnesses, or be derived from personal preferences or dislikes.
For instance, preparing the menus at a hospital can be really complex [1].
Another special situation arises when traveling abroad or simply when eating at a foreign cuisine restaurant: it is not always enough to know the brief description in the restaurant’s menu or the explanation of the waiter.
For example, “calamares en su tinta” (squid in its own ink) is a delicious typical Spanish dish, not well-known abroad. Its brief description would be “squid with boiled rice in its own (black) ink”. But an ingredient (included in a small amount, in order to thicken the sauce) is flour, a fact very important for a celiac.
Another example is meat, sometimes marinated in milk before cooking (to make it tenderer), what is not specified in the menu. This can be very important for people with allergy to milk and for Jewish.
Therefore, we consider that it would be very interesting to develop a knowledge-based system that addressed these problems: it should have information about allergies, other diet requirements (vegetarian, vegan,...) and religious constraints, know absolutely all the ingredients used by the chef when preparing the different dishes and check the situation for each customer. As the knowledge is fixed and the constraints are known, a rule based expert system (RBES) whose underlying logic is classic Boolean matches the task.
The key idea is to develop a RBES as comfortable as possible for both the restaurant and the customer. More precisely, we distinguish:
- •
Fixed data: ingredients or ways of cooking discarded because of believes, allergies or other diet requirements and recipes of the restaurant.
- •
Unfixed data: ingredients out of stock at a certain moment and customer’s data.
The package designed constructs a “personalized restaurant menu” using set operations and knowledge extraction, thanks to an algebraic Groebner bases [2] based inference engine (although other approaches could be used instead).
It has been implemented in the computer algebra system Maple 2016 (using its convenient “Embedded-Components”) and can be run from computers, tablets and the iPad using Maple.
This paper extends talks presented at Applications of Computer Algebra 2015 (ACA 2015) conference [3] and the 5th European Seminar on Computing (ESCO 2016).
Section snippets
Generalities of the system: about the fixed data
Regarding food, we distinguish three kind of items:
- •
ingredients and ways of cooking (note that the ways of cooking the food is considered by the system at the same level as ingredients),
- •
intermediate products, that do not directly appear in the restaurant’s menu (a sauce, like “mayonnaise”, is neither an ingredient nor a final product), and
- •
final products (like “seafood cocktail”), that are the dishes listed in the restaurant’s menu.
The rules derive directly from the “recipes” (that have to be
Fixed data introduction
The connectives than can be used in the rules are
NEG, &AND, &OR, &IMP, &XOR
(in our implementation the unary one is prefix and the binary ones are infix ones).
As said before, the data introduction step is performed just by:
- •
storing rules that describe the forbidden ingredients (for believers, allergic reasons or other diet requirements) in set Rules0,
- •
storing the rules that describe the “recipes” of the intermediate products in set Rules1,
- •
storing the rules that describe the “recipes” of the final
Data introduction by the chef – III
The chef also has to introduce the ingredients out of stock at each moment, if any. This set of ingredients will be stored in variable INS.
Data introduction by the customer
The customer can introduce, if desired:
- •
religion, allergies and other special diets (that will be stored in variable PCO),
- •
forbidden ingredients/ways of cooking (that will be stored in variable FIR),
- •
forbidden intermediate products (that will be stored in variable FIP), and
- •
forbidden final products (that will be stored in variable FFP)
(to forbid an
Description of the processes carried out
We can distinguish three processes within the package, that we have denoted:
- •
Preprocess
- •
Main Process
- •
Postprocess.
The algebraic approach to RBES
(This section can be skipped by readers aware of this approach.)
Let be the Boolean algebra of the propositions that can be constructed using a finite number of propositional variables . Let us consider the Boolean algebra “is a multiple”), where and . Let us define:
φ: () (“is a multiple”) the following way; for propositional variables: and for any : Then, as an immediate
Examples
The prototype Rules0 consists of 140 rules, Rules1 consists of 4 rules and Rules2 consists of 22 rules.
Two examples are included below as illustration. They are carried out interactively in a Maple Worksheet firstly. The execution of both examples through a simple GUI is shown afterwards.
Related works
There are very many works describing computer applications to food and nutrition. For instance [19] focuses on computations regarding nutrition.
In [20] a menu is created using rough sets and the knowledge (information about preferences) stored in large databases available from the Web.
Another example of applications is the location of the restaurant that fits best to the potential customer’s characteristics [21], [22].
A closer work to the one presented here is [23], an ontology-driven system
Conclusions
We have presented a prototype of what is, as far as we know, a new and useful application of RBES.
We do not pretend to have implemented a complete and detailed KBS on the topic, but a possible design and a simple example of development of what could be done (as illustration). More recipes should be included and experts on allergies, and on other diet requirements (vegetarian, vegan,...) as well as on Islamic and Jewish dietary laws should be consulted (this is a prototype proposing an
Acknowledgments
This work was partially supported by the research projects TIN2015-66471-P (Government of Spain) and CASI-CAM S2013/ICE-2845 (Comunidad Autónoma de Madrid); the Research Group ACEIA and by Grant no. TIN2011-28084 of the Science and Innovation Ministry of Spain, co-funded by the European Regional Development Fund (ERDF).
Finally, we thank the anonymous reviewers for their suggestions and comments, which have improved the quality of the paper.
References (23)
Bruno Buchberger’s Ph.D. thesis 1965: an algorithm for finding the basis elementals of the residue class ring of a zero dimensional polynomial ideal
J. Symb. Comput.
(2006)- et al.
A polynomial model for multivalued logics with a touch of algebraic geometry and computer algebra
Math. Comput. Simul.
(1998) Refutational theorem proving using term-rewriting systems
Artif. Intell.
(1985)- et al.
Many-valued logic and Gröbner bases with applications to modal logic
J. Symb. Comput.
(1991) - et al.
An expert system for managing medical appropriateness criteria based on computer algebra techniques
Comput. Math. Appl.
(2001) - et al.
A logic and computer algebra-based expert system for diagnosis of anorexia
Math. Comput. Simul.
(2002) - et al.
A computational system for diagnosis of depressive situations
Exp. Syst. Appl.
(2006) - et al.
A portable knowledge-based system for car breakdown evaluation
Appl. Math. Comput.
(2015) - et al.
Nutrisonic web expert system for meal management and nutrition counseling with nutrient time-series analysis, e-food exchange and easy data transition
Nutr. Res. Pract.
(2008) - Manual de Utilización del Código de Dietas del Hospital Regional Universitario Carlos Haya, Servicio Andaluz de Salud,...
Cited by (8)
A logic-algebraic tool for reasoning with Knowledge-Based Systems
2018, Journal of Logical and Algebraic Methods in ProgrammingCitation Excerpt :The problems where the polynomial interpretation of the formulas (rules, for example) of a KB is used are problems where the formulas have very limited complexity. In this type of program, the number of variables that appear in a rule is very small compared to the total number (see e.g. [28–30]). Therefore the computation of conservative retraction is feasible with our approach.
A novel way to build expert systems with infinite-valued attributes
2024, AIMS MathematicsDiet Recommendation according to Kilocalories and People’s Tastes
2023, Computacion y SistemasTowards a notion of basis for knowledge-based systems—applications
2021, MathematicsDiagnosis in tennis serving technique
2020, AlgorithmsAn Application of Knowledge Engineering to Mathematics Curricula Organization and Formal Verification
2020, Mathematical Problems in Engineering