dataesr/scientific-paragraphs-categorization huggingface dataset:
These proofs will be included in the software artifacts and details will be provided during the demonstration. The above examples illustrated several of the features of RCRS as a reasoning tool, similar to a behavioral type checking and inference engine. Indeed, detecting incompatible connections is akin to catching type errors in programs, and inferring conditions such as the condition on the input in the last example above is akin to type inference. In addition to these capabilities, RCRS can be used to check refinement (and its counterpart, abstraction) between components. We next show how to prove that SqrRoot refines NonDetSqrt and that ReceptiveSqrt refines SqrRoot (NonDetSqrt and ReceptiveSqrt are defined in Section 2). We have: The first line instructs the Analyzer to use simplification rules for relational predicate transformers  [11].
A. 2 The Simulink Translator The RCRS toolset also contains a Translator which takes as input Simulink diagrams (. slx files) and generates RCRS Isabelle theories (. thy files). The Translator is a Python program called simulink2isabelle. We illustrate its use by building a simple Simulink model (Fig. 6a ) and using simulink2isabelle to translate it to RCRS:. /simulink2isabelle. py sqrt_syst. slx -ic The execution of the translator is shown in Fig. 6b , and the generated RCRS Isabelle theory is rendered in Fig. 6c. The option -ic tells the Translator to use a specific algorithm for translating block diagrams to composite RCRS components. Here we pause and introduce another feature of RCRS which we haven't talked about so far, namely, its composition operators. RCRS offers three primitive composition operators: serial (which we have already seen), parallel, and feedback.
A. 3 An Industrial Benchmark We apply the entire toolset on the Toyota Simulink model briefly discussed in Section 6 (part of the model is shown in Fig. 8 ). First we run the translator:. /simulink2isabelle. py afcs. slx -const -type real -iter -sim  The resulting file afcs. thy is quite long and its processing by Isabelle takes about 15 seconds. The Analyzer detects no incompatibilities and computes a simplified top-level atomic component whose description is 8338 characters long (an excerpt is shown in Fig. 9 ). We explain this top-level component, which has a non-trivial automatically generated state condition. Then we run the generated Python simulation code, compare the simulation trajectories with those of Simulink, and find that they are essentially identical.
This paper identifies the requirements for computer-supported food matching, in order to address not only national and European but also international current related needs and represents an integrated research contribution of the FP7 EuroDISH project. The available classification and coding systems and the specific problems of food matching are summarized and a new concept for food matching based on optimization methods and machine-based learning is proposed. To illustrate and test this concept, a study has been conducted in four European countries (i. e. , Germany, The Netherlands, Italy and the UK) using different classification and coding systems. This real case study enabled us to evaluate the new food matching concept and provide further recommendations for future work. In the first stage of the study, we prepared subsets of food consumption data described and classified using different systems, that had already been manually matched with national food composition data.
Once the food matching algorithm was trained using this data, testing was performed on another subset of food consumption data. Experts from different countries validated food matching between consumption and composition data by selecting best matches from the options given by the matching algorithm without seeing the result of the previously made manual match. The evaluation of study results stressed the importance of the role and quality of the food composition database as compared to the selected classification and/or coding systems and the need to continue compiling national food composition data as eating habits and national dishes still vary between countries. Although some countries managed to collect extensive sets of food consumption data, these cannot be easily matched with food composition data if either food consumption or food composition data are not properly classified and described using any classification and coding systems.
To enable the application of food consumption and composition data, countries have gathered food databases where data is described, aggregated and ordered using comprehensive food description and classification systems  [5]. However, as food consumption and composition databases describe and classify (and/or aggregate) data in different ways, it makes food matching between the two databases a difficult task, as also illustrated in the FAO (Food and Agriculture Organization of the United Nations) guidelines for food matching  [6]. In the 1980s, the EU (European Union) started to support coordinated actions aimed at overcoming the lack of internationally comparable data  [7] , both in food consumption and food composition data. The FLAIR-Eurofoods-Enfant-  [8]  and the COST99-coordinated  [9]  actions dealt with both these subjects.
Subsequently, the DG-SANCO (Directorate General for Health and Consumer Affairs) of the European Commission supported the DAFNE (Data Food Networking) initiative, which concerned the creation of a European food consumption dataset based on Household Budget Surveys  [10]. Today, there are two strong umbrella organizations that unify work on food consumption and food composition data in Europe, i. e. , the European Food Safety Authority (EFSA) and the international non-profit association EuroFIR  [11]. EFSA gathers food consumption data for individuals in Europe and uses them for exposure assessment. Food consumption data collected from EU member states are stored in the Comprehensive Food Consumption Database, using a common food classification and coding system for classifying and describing food that makes it easier to compare data from different sources and perform more detailed types of data analysis FoodEx (for more details please refer to Section 2.
1. 1) [12]. The fundamental aim of EuroFIR has been the harmonisation and the standardisation of the work on food composition data in Europe. It has supported the development of the European standard for food composition data  [13] , which facilitates access to and exchange of comparable, high quality food composition data for industry, regulators and researchers across Europe  [14, 15]. As for the food classification and coding system, the EuroFIR member countries use the LanguaL system that is a globally defined automated method for describing, capturing and retrieving food information (for more details please refer to Section 2. 1. 2), with the exception of the German Nutrient Database  [16] ; and since 2012, some member countries have adopted the FoodEx system as well. To link food consumption with food composition data, food matching is required to identify the most appropriate foods in the most appropriate compositional data sources.
Systems for Describing Food Information EFSA recommends that food consumption data across Europe are collected by using the dietary record method for infants and children and the 24-h recall method for adults  [1]. These methods use open-ended food sections, i. e. , the food list is not a priori defined, in order to capture the most detailed food description so allowing for matching consumption data with food composition data  [19, 20]. This is usually performed by using software that collects food consumption data in a structured way asking supplementary information on foods and practices (e. g. , brand name, packaging method, cooking procedures and other specific information, such as fortification). Collected data can then be classified (aggregated) in FoodEx groups using the core food list (level 4 and above) and coded using FoodEx facets and facet descriptors that are terms representing supplementary information describing food production and processing.
More recently, it has been adapted for European nutritional surveillance  [22] [23] [24]  or other national contexts outside Europe  [25, 26]. EFSA has also recently evaluated a sample of data processing software that can be used alone or in a combination with GloboDiet  [27]. Food consumption data and occurrence data are usually merged in the context of a probabilistic assessment of dietary exposure (for example, see the Monte Carlo Risk Assessment software  [28] , developed in the context of the European project "Montecarlo"  [29] ), while for energy and nutrient intake calculations the linkage between food consumption data and food composition tables has a deterministic characterization  [30]. Once food consumption data are collected and classified, the matching of consumed foods with the most appropriate sources of compositional data needs to be performed.
Each food can be allocated to several food group classifications (Facet A Product type-Figure  2 ). At the moment, LanguaL includes 13 classification systems, including Codex Alimentarius [31], European Food Groups, EuroFIR Food Group Classification, GS1 (Global Language of Business) Global Product Classification  [32]  and USDA (U. S. Department of Agriculture) standard reference  [33]. The GloboDiet food groups, used to ease data collection and standardisation across countries, are currently not included. Over 75,000 foods and food products have already been indexed in various countries using the LanguaL system. Further details can be found in the LanguaL thesaurus  [34].
Formalisation of the Food Matching Problem There are two major challenges with food matching. Firstly, not all countries have compiled food composition databases of the same quality and national food composition databases may include different numbers of food items and data for nutrients. Secondly, food composition databases vary in the number of food items that have already been indexed by the available classification and coding systems. Different levels of detail, in which food items are described, can translate into lack of information and matching to incorrect or sub-optimal composition data, e. g. , "bread" is a generic description that may be sufficient in some cases but does not allow identification of additional descriptors that may influence nutritional content, e. g. , white/brown/wholemeal, with/without added ingredients.
• A food consumption datum is described by the English name, food group and subgroups, and a list of facets and descriptors, belonging either to FoodEx or any other (e. g. , GloboDiet) food consumption classification (aggregation) and coding system; Unfortunately, in many cases datasets do not include all the necessary information, which makes searching for food matches inherently less accurate. However, searching can be performed even when not all the information is provided. During the food matching process, an optimal food composition data match needs to be found for each food consumption data. The matching can be done by the English names, food groups and subgroups, and the lists of FoodEx and LanguaL descriptors. If there is no food composition data that fully matches with food consumption data, a set of closely matched but suboptimal food composition data should be provided to be explored by a human expert.
e. , M. O. from The Netherlands, C. K. from Germany, and R. B. from the UK. Through the iterative usage of the algorithm, this knowledge expands and the algorithm becomes more and more efficient in finding optimal solutions. The following pseudo-code presents an idea of computer-supported food matching: Step 1: The human expert provides an input query that classifies a food item from a Food Consumption Database by its English name, food group and subgroups, and describes it by a set of facets and descriptors (e. g. , FoodEx facets and descriptors); Step 2: The algorithm searches for the best matched data from Food Composition Database using food composition descriptors (e. g. , LanguaL descriptors); Step 3: Acquired matches are displayed-perfect matches, which have all components of the input query the same, are displayed at level 0; while less perfect matches are displayed at the next levels, where matches at level 1 are food items that match with the query in all attribute groups except in one, matches at level 2 are food items that match with the query in all attribute groups except in two, etc.
• In the third case, the algorithm was adapted for matching between food composition data described by LanguaL. This kind of matching is useful when one food composition database from a selected country needs to be matched with another food composition database from another country and the matching cannot rely only on English names because these are missing or are improperly selected. In addition to the algorithm, we developed a simple web-based application, where information about food consumption data is provided as an input query, and after running the algorithm, matched food composition data are displayed. As the aim of the study was to identify requirements for efficient food matching, this application was developed for testing purposes only. It was used by human experts to evaluate food matches.
In the following subsections, three different types for matching foods described using different systems (GloboDiet, LanguaL and FoodEx) are provided. In all approaches, the human expert provides an input query that classifies food consumption data with food composition data, which is needed to estimate nutrient intake from food consumption. The algorithm explores the space of optimal solutions and outputs either a perfect food composition data match or a set of candidates, which are described by their codes, English names, basic nutrient values, and facet terms. The best matches at level 0 are food items from the food composition dataset that match with the query in all attribute groups (i. e. , in at least one food name, the group, and all the facets and facet descriptors). If the query does not include the food names, these are not considered for matching and level 0 means matching in all other attribute groups (i.
Matching Food Consumption Data Described by GloboDiet to Food Composition Data Described by LanguaL In this approach, each food consumption data is described by its English name, food group, food subgroups, and/or a set of GloboDiet facets and facet descriptors. Using the food matching algorithm, this information needs to be provided in a form of an input query. An example of such a query is "XCourgette, Xraw, G02, 0499, 0204, 0309", where the first two terms present the English name of the food item from the food consumption database (Courgette, raw), G02 is the GloboDiet group code 02 (Vegetables), and 0499, 0204, 0309 are facets and facet descriptors (Preservation method-fresh, Physical state/form-flesh and Cooking method-fatty-stir fried/sautéed). The symbol "X" annotates the terms describing the food name ("XCourgette" and "Xraw").
Matching Food Consumption Data Described by FoodEx2 to Food Composition Data Described by LanguaL The human expert provides an input query that classifies food consumption data by its English name, food group and subgroups, and describes it by a set of facets and facet descriptors. An example of such a query is "Xmargarine, A039D, F10. A0B8M", where the first term presents the English name of the food item out of the food consumption database (Margarine), A039D is the FoodEx term (Traditional margarine), and F10. A0B8M is the FoodEx facet descriptor (Low sodium/reduced salt) from the FoodEx facet F. 10 (Qualitative-info facet). The symbol "X" annotates the term describing the food name ("Xmargarine"). In Figure  4 , it can be seen that three food items were identified as best matches because all of them match with the name (Margarine), the term A039D, and the facet F10.
Training Stage In the first stage of the evaluation, the EuroDISH partners from Germany, The Netherlands and Italy prepared subsets of food consumption data that had already been manually matched with national food composition data, for training purposes. UK data were not used for training purposes as the national dietary survey in the UK uses manually recorded food diaries (i. e. , paper diaries), which are then reviewed and coded to food composition data by trained experts. The resultant food composition codes are then entered in to the dietary analysis software, and therefore, no electronic datasets are available that include both the food consumption information (as recorded by the subject) and the food composition data. In Table  1 , details about the training datasets from all three countries are provided.
These datasets were prepared considering data from national food consumption surveys. While the German and the Dutch food consumption data were collected using the GloboDiet system, the Italian data were collected by another system (INRAN-DIARIO). Subsets of food composition data for The Netherlands, Italy and the UK were selected from the EuroFIR Information Platform that had already been indexed by LanguaL. As the German Nutrient Database (BLS) was not available in the EuroFIR Platform, a subset of about 1200 of the 14,800 BLS food items coded by LanguaL was prepared for the case study. Details of the training food composition data subsets are presented in Table  2. To enrich the training datasets, we applied FoodEx2 indices of food composition prepared by EuroFIR for EFSA in the project "Updated food composition database for nutrient intake".
Testing Stage After the training stage, the food matching approach was tested on food consumption data prepared by Germany, The Netherlands, Italy and the UK. Firstly, 40-50 foods were selected for each country. Details about the foods for Germany, other than the survey data used in the training dataset, were reported in a recent food consumption survey  [40]. Also for The Netherlands the selected foods were taken from another survey  [41]  than the training dataset. For Germany, The Netherlands and Italy, the selected foods had already been manually matched with food composition data. For the UK, food items were not derived from actual food consumption data as this would have required accessing original, hard copy subject diaries from the National Diet and Nutrition Survey. Instead, a list of foods was drawn up to fulfil the testing exercises categories, and described in the level of detail typically found in volunteer diaries.
In addition, the quality of the selected best match (good similarity, sufficient similarity or poor similarity) and the reason for selecting a match from different options was indicated. The foods selected as best matches were compared with the matches selected previously using the existing country-specific 'manual matching procedures'. In the UK, the matching was undertaken by two researchers of varying experience to test some of the potential limitations that the algorithm may have, particularly as the matching within the UK is based purely on text terms (no facet codes). The results of each match were compiled into one spreadsheet, and both matches were compared to the expected match. The expected match was based on independent agreement of the best available match in the dataset, i. e.
Results In all countries, the matching algorithm provided matches for all foods that were given as input for the matching algorithm. Figure  5  shows the estimated average number of possible matches for quality level 0 (best quality), quality level 1 (one aspect not matched), and quality level 2 (two aspects not matched) in each country, as provided by the algorithm. The provided averages are only estimates since in cases where the algorithm provided many possible matches, only a crude classification of the number was given (e. g. , >50). For the four countries, varying average numbers of matches and different divisions over the three quality levels were observed. Of the 45 foods from the German dataset, 1 food (2%) matched at level 0, and 31 foods (69%) matched at level 2. In the Italian dataset, 22 foods (49%) matched at level 0, and 4 foods (9%) matched at level 1.
In the Dutch dataset, 3 foods (7%) matched at level 0, 6 foods (13%) matched at level 1, and 6 foods (13%) matched at level 2. In the UK dataset, 12 foods (27%) matched at level 0. Matches of level higher than 2 are not presented in the graph. The percentages of selected matches that were judged as good, sufficient and poor quality matches by the human experts within each country are shown in 6. A match was judged as good when it matched in all attributes. A sufficient match was usually between foods matching in the English name and food group/subgroups but having different descriptors, or between a generic food from the food composition database and a more specific food from the food consumption dataset or vice versa. The remaining matches were judged as poor. The percentages refer to matching to the relevant national food composition database only, rather than using all available food composition databases.
In Italy, The Netherlands and the UK the percentage of good matches ranged between 27 and 35%, with a mean value of 29. 7% and standard deviation of 4. 6% (Figure  6 ). For Germany, a higher percentage of good matches was reported (62%). The percentage of poor matches was rather similar across the countries and ranged between 9% and 16%, with a mean value of 12% and standard deviation of 2. 9%. Figure  7  shows the relation between the quality level indicated by the matching tool and the quality of the match judged by the human experts for the selected matches. for foods with good, sufficient and poor match as judged by the human expert for three countries. For UK only level 0 matches were proposed so these are not included in the figure. For the foods that were previously matched using a 'manual' procedure, 62% were matched with the same food from the food composition database in Germany, 64% in Italy and 95% in The Netherlands.
For the UK, an experienced expert matched all but one food to the expected match (98%) (Figure  8 ). The level of human expertise played an important role, at least in the training stage. Within the UK part of the validation, the effect of experience in working with food composition data could be studied. Figure  9  shows the accuracy of matching for the experienced and the inexperienced expert. The experienced expert (researcher) was able to retrieve an equal match (to the independent/expected match) on 48 of 49 occasions using the algorithm (for one food, no good match was available). For the inexperienced researcher, a lack of knowledge of the way foods can be described in the composition dataset, or of the products being tested, resulted in 10 foods not being matched equally. However, 38 of the 49 foods were still equal to the expected match.
Discussion The case study for food matching between consumption and composition data was performed on diverse training and testing datasets from four countries. Some datasets, although extensive, were missing food information (such as food names, groups or descriptors), while others contained either too broad or mutually exclusive information unintentionally generated during the manual coding (e. g. , the food name included the term "raw" and the descriptor "stir-fried"). This was welcomed because the aim of the case study was to identify gaps in data and food description by terms and facets that might influence food matching. While the German and Dutch testing food consumption data were collected and described by GloboDiet and their food composition data were described by LanguaL, the matching of food consumption to composition data was performed by using the approach for matching GloboDiet to LanguaL (as described in Section 2.