Elsevier

Applied Mathematics and Computation

Volume 315, 15 December 2017, Pages 615-624
Applied Mathematics and Computation

A prototype of a RBES for personalized menus generation

https://doi.org/10.1016/j.amc.2016.12.023Get rights and content

Abstract

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. 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). Therefore, we consider that it would be very interesting to develop a knowledge-based system that automatically obtained a personalized menu for each customer, according to the precise recipes of the restaurant and taking into account the data given by the customer and the ingredients out of stock (if any). Although there are many knowledge-based systems devoted to diabetic’s meals, diets, food supply chains, etc., we do not know of any comparable system. We have developed a rule based expert system that uses sets and lists for handling data and an algebraic inference engine. It has been implemented in the computer algebra system Maple.

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),

as well as:
  • 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 (C,,,¬,) be the Boolean algebra of the propositions that can be constructed using a finite number of propositional variables P,Q,,R. Let us consider the Boolean algebra (A,+˜,·,1+, “is a multiple”), where A=Z2[p,q,,r]/p2p,q2q,,r2rand p+˜q=p+qp·q. Let us define:

φ: (C,,,¬,) (A,+˜,·,1+,“is a multiple”) the following way; for propositional variables: PpQqRrand for any A,BC: ABa+˜b¬A1+aThen, 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)

  • E. Roanes-Lozano, J.L. Galán-García, G. Aguilera-Venegas, Computer Algebra-based RBES personalized menu generator...
  • Cited by (8)

    View all citing articles on Scopus
    View full text