RU2659492C1 - Unification unit with parallel comparison of terms - Google Patents

Unification unit with parallel comparison of terms Download PDF

Info

Publication number
RU2659492C1
RU2659492C1 RU2017129495A RU2017129495A RU2659492C1 RU 2659492 C1 RU2659492 C1 RU 2659492C1 RU 2017129495 A RU2017129495 A RU 2017129495A RU 2017129495 A RU2017129495 A RU 2017129495A RU 2659492 C1 RU2659492 C1 RU 2659492C1
Authority
RU
Russia
Prior art keywords
node
matching
variable
inputs
outputs
Prior art date
Application number
RU2017129495A
Other languages
Russian (ru)
Inventor
Василий Юрьевич Мельцов
Алексей Сергеевич Куваев
Вячеслав Сергеевич Русов
Original Assignee
Федеральное государственное бюджетное образовательное учреждение высшего образования "Вятский государственный университет" (ВятГУ)
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Федеральное государственное бюджетное образовательное учреждение высшего образования "Вятский государственный университет" (ВятГУ) filed Critical Федеральное государственное бюджетное образовательное учреждение высшего образования "Вятский государственный университет" (ВятГУ)
Priority to RU2017129495A priority Critical patent/RU2659492C1/en
Application granted granted Critical
Publication of RU2659492C1 publication Critical patent/RU2659492C1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models

Abstract

FIELD: computer engineering.
SUBSTANCE: invention relates to computer engineering. Technical result is provided by a unit of unification with parallel comparison of terms containing internal working memory, inputs connected to an input data bus, and the output of the dispatch node, and the outputs are connected to the input of the variable matching node, the input of the predicate name matching node and the inputs of the term comparison nodes, the input control node is connected to the input control bus, the output of the variable matching node, the output of the predicate name matching node and the outputs of the term comparison nodes, the dispatching node, the inputs connected to the outputs of the term comparison nodes, and the outputs are connected to the input of the internal working memory and the inputs of the term comparison nodes, the node for mapping predicate names to the input is connected to the output of the internal working memory, and the output is connected to the input of the control node, the term comparison nodes whose inputs are connected to the outputs of the internal working memory and the outputs of the dispatching node, and the outputs are connected to the inputs of the control node, the inputs of the variable matching node and the inputs of the dispatching node, the variable-input matching unit connected to the outputs of the term-matching nodes and the output of the internal working memory.
EFFECT: shortening the time for unification of predicates.
1 cl, 9 dwg

Description

Изобретение относится к вычислительной технике, а именно к устройствам обработки символьной информации, и направлено на увеличение производительности и расширение функциональных возможностей процессоров логического вывода и систем, основанных на знаниях, реализующих любой метод логического вывода.The invention relates to computer technology, and in particular to devices for processing symbolic information, and is aimed at increasing the productivity and expanding the functionality of logical inference processors and systems based on knowledge that implements any method of logical inference.

Изобретение может быть использовано при проектировании и разработке специализированных процессоров логического вывода или как самостоятельное устройство для проведения исследований по анализу эффективности различных методов параллельной унификации.The invention can be used in the design and development of specialized inference processors or as an independent device for conducting research on the analysis of the effectiveness of various methods of parallel unification.

В настоящее время в сфере компьютерных систем и технологий особенно актуальными становятся системы, решающие задачи обработки знаний. Представление знаний о выбранной предметной области является, как правило, достаточно трудоемкой задачей для интерпретации на ЭВМ, поэтому для работы с такой информацией необходимы новые семантические подходы к извлечению, представлению, хранению и обработке информации. К задачам интеллектуальной обработки данных и знаний относятся: управление крупными предприятиями, транспортная логистика, бизнес-аналитика, медицинская и техническая диагностика, логическое прогнозирование и т.д. Количество вышеуказанных задач неуклонно растет, а вычислительный аспект в них уходит на второй план. Именно поэтому были созданы специальные языки логического программирования, а также появился спрос на различного рода экспертные системы и системы поддержки принятия решений. Главная проблема в том, что при реализации на ЭВМ языки логического программирования используются неэффективно, так как они предназначены для обработки символьной информации, а написанные на них программы переводятся в набор микрокоманд для выполнения на серийных универсальных процессорах, предназначенных, в первую очередь, для обработки числовых данных.Currently, in the field of computer systems and technologies, systems that solve knowledge processing tasks are becoming especially relevant. Presentation of knowledge about the selected subject area is, as a rule, a rather laborious task for interpretation on a computer, therefore, to work with such information, new semantic approaches to the extraction, presentation, storage and processing of information are necessary. The tasks of intellectual data and knowledge processing include: management of large enterprises, transport logistics, business analytics, medical and technical diagnostics, logical forecasting, etc. The number of the above tasks is growing steadily, and the computational aspect in them is being relegated to the background. That is why special logical programming languages were created, and there was also a demand for various kinds of expert systems and decision support systems. The main problem is that when implemented on computers, logical programming languages are used inefficiently, since they are designed to process symbolic information, and the programs written on them are translated into a set of microcommands for execution on serial universal processors, designed primarily for processing numerical data.

Решением перечисленных проблем может стать аппаратная поддержка специализированных машин логического вывода, составляющих основу любой интеллектуальный системы обработки знаний.The solution to these problems can be hardware support of specialized inference machines, which form the basis of any intelligent knowledge processing system.

В процессе логического вывода одной из самых частых операций над символьными данными является операция унификации предикатов. Известны обобщенная структура абстрактной машины логического вывода, а также форматы и структуры данных [Meltsov V.Yu. High-performance systems of deductive i nference: Monograph. -Yelm, WA, USA: Science Book Publishing House, 2014. - 216 p., с. 101, 124-132].In the process of inference, one of the most common operations on symbolic data is the operation of unification of predicates. The generalized structure of an abstract logical inference machine is known, as well as data formats and structures [Meltsov V.Yu. High-performance systems of deductive i nference: Monograph. Yelm, WA, USA: Science Book Publishing House, 2014 .-- 216 p., P. 101, 124-132].

Из источника [Вишняков, В.А., Аппаратно-программные средства процессоров логического вывода [Текст] / В.А. Вишняков, Д.Ю. Буланже, О.В. Герман. - М.: Радио и связь, 1991. - 264 с., с. 136-139] известен процессор унификации, который реализует следующие этапы унификации: этап проверки равенства имен унифицируемых структур, этап вычисления аргумента унифицируемых структур, этап перехода к следующим обрабатываемым аргументам, этап дереференсирования переменной, этап дереференсирования аргумента, этапы записи в стеки, операции чтения из унифицируемого стека, создание подстановок. Данный процессор унификации имеет следующие элементы: блок регистров общего назначения, который включает в себя: регистры унифицируемых аргументов, регистры хранения максимального верхнего значения глобального, локального и трейлового стеков, регистры хранения текущих адресов в стеках, регистры хранения векторов переменных, входящих в скелетоны унифицируемых структур, регистр хранения указателя унифицируемого стека, регистр хранения указателя пары унифицируемых аргументов, регистр адреса тегированного значения, считанного из памяти в регистры унифицируемых аргументов. Также в указанный процессор унификации входят: компараторы, сумматор, регистр состояния, ПЗУ, входные буферные регистры, устройство управления, входная и выходная шины данных, входная шина адреса, входная шина команд, шина стробирования записи и шина состояния. Данное устройство имеет следующие недостатки. Во-первых, значительное время унификации из-за последовательного сопоставления термов. Во-вторых, обрабатываемые данные каждый раз сохраняются во внешнюю для блока унификации память, что значительно увеличивает время унификации при необходимости повторного обращения к ним в процессе унификации. В-третьих, применение сжатых форматов данных, типа молекула, хотя и несколько уменьшает объем требуемой для хранения памяти, однако вызывает необходимость каждый раз распаковывать структуру при унификации подобных термов, что усложняет конструкцию процессора. В-четвертых, операция деференсирования переменных проводится каждый раз в процессе сопоставления двух аргументов-переменных, что приводит к необходимости проводить ее неоднократно для одной и той же глобальной переменной и, соответственно, значительному увеличению времени унификации.From the source [Vishnyakov, V.A., Hardware and software of logical inference processors [Text] / V.A. Vishnyakov, D.Yu. Boulanger, O.V. Hermann. - M .: Radio and communications, 1991 .-- 264 p., P. 136-139] a unification processor is known that implements the following unification stages: the stage of checking the equality of names of unified structures, the stage of calculating the argument of unified structures, the stage of transition to the next processed arguments, the stage of dereference of a variable, the stage of dereference of an argument, the stages of writing to stacks, the read operations from unified stack; creating lookups. This unification processor has the following elements: a block of general purpose registers, which includes: registers of unified arguments, storage registers for the maximum upper value of the global, local and trail stacks, registers for storing current addresses in stacks, registers for storing vectors of variables included in the skeletons of unified structures , a register for storing a pointer to a unified stack, a register for storing a pointer to a pair of unified arguments, an address register for a tagged value read from memory and registers unifitsiruemyh arguments. Also, the specified unification processor includes: comparators, adder, status register, ROM, input buffer registers, control device, input and output data buses, input address bus, input command bus, write gating bus and status bus. This device has the following disadvantages. Firstly, a considerable time of unification due to the consistent comparison of terms. Secondly, the processed data is stored each time in the external memory for the unification unit, which significantly increases the unification time if it is necessary to access it again in the unification process. Thirdly, the use of compressed data formats, such as a molecule, although it slightly reduces the amount of memory required for storage, however, it makes it necessary to unpack the structure each time when unifying such terms, which complicates the design of the processor. Fourthly, the operation of variable desensing is carried out each time in the process of comparing two arguments-variables, which leads to the need to carry out it repeatedly for the same global variable and, accordingly, a significant increase in unification time.

Из источника [RU №158945 (Ul), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] известен блок унификации с последовательным сопоставлением термов. Данный блок унификации содержит: устройство управления, рабочую память, мультиплексоры для выбора источника загрузки операнда в регистры, регистры для хранения операндов, счетчики управления адресами первого и второго портов блока рабочей памяти, дешифраторы тэгов операндов, компаратор для сравнения имен термов, счетчик управления адресом памяти подстановок, память подстановок, регистр восстановления значения счетчика, компаратор для сравнения значения адреса памяти подстановок и сохраненного адреса. Данный блок унификации имеет следующие недостатки. Во-первых, значительное время унификации из-за последовательного сопоставления термов. Во-вторых, для учета возможной замены термапеременной, выполненной при сопоставлении предыдущих аргументов, требуется наличие дополнительной аппаратуры (регистр, счетчик, дешифратор) и значительное время на поиск имеющихся подстановок и восстановление значения счетчика адреса. В-третьих, отсутствует возможность учета подстановок, сделанных до выполняемой в настоящий момент команды унификации.From the source [RU No. 158945 (Ul), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification unit with sequential matching of terms] a unit of unification with sequential matching of terms is known. This unification block contains: a control device, working memory, multiplexers for selecting the source of loading the operand into registers, registers for storing operands, address management counters for the first and second ports of the working memory block, operand tag decoders, a comparator for comparing term names, a memory address management counter lookups, lookup memory, counter recovery counter register, comparator for comparing lookup memory address values and stored address. This unit of unification has the following disadvantages. Firstly, a considerable time of unification due to the consistent comparison of terms. Secondly, in order to take into account the possible replacement of the thermal variable made by comparing the previous arguments, additional hardware (register, counter, decoder) and considerable time are required to search for existing substitutions and restore the address counter value. Thirdly, there is no possibility of accounting for the permutations made before the currently unified command.

Из источника [Заявка на изобретение №2016120823 от 26.05.2016. МПК G06N 5/04. Блок унификации с параллельным сопоставлением термов. Авторы: Мельцов В.Ю., Куваев А.С., Чистяков Г.А., Шипицына А.А.] известен блок унификации с параллельным сопоставлением термов. Данный блок содержит: внутреннюю рабочую память, узел управления, узел диспетчеризации, узел сопоставления имен предикатов, узлы сопоставления термов, узел формирования подстановок. Данный блок унификации имеет следующий недостаток: отсутствует возможность корректной унификации предикатов, если в одном из предикатов есть более двух пар одноименных свободных переменных, конкретизируемых в процессе сопоставления разными константами. Свободная (или неконкретизированная) переменная - это переменная, которая еще не получила значения. Переменная, которая получила какое-то значение и оказалась связанной с определенным объектом, называется связанной или конкретизированной. Пример, демонстрирующий подобную ситуацию, приведен на фигуре 8 (в устройстве [Заявка на изобретение №2016120823 от 26.05.2016. МПК G06N 5/04. Блок унификации с параллельным сопоставлением термов. Авторы: Мельцов В.Ю., Куваев А.С., Чистяков Г.А., Шипицына А.А.] нет возможности выполнить несколько шагов 2 на третьем этапе). Следует отметить, что все более широкое применение методов параллельного логического вывода в таких областях, как управление крупными предприятиями, медицинская и техническая диагностика, многокритериальное логическое прогнозирование, приводит к необходимости использовать предикаты с 15-20 и более аргументами, при этом вероятность появления описанной выше ситуации заметно возрастает.From the source [Application for invention No. 2016120823 from 05.26.2016. IPC G06N 5/04. Unification block with parallel term matching. Authors: Meltsov V.Yu., Kuvaev AS, Chistyakov GA, Shipitsyna AA] A unit of unification with parallel matching of terms is known. This block contains: internal working memory, control node, dispatch node, predicate name matching node, term matching nodes, permutation formation node. This unit of unification has the following drawback: there is no possibility of correct unification of predicates if one of the predicates has more than two pairs of the same free variables specified in the process of matching with different constants. A free (or non-specific) variable is a variable that has not yet received a value. A variable that has received some value and turned out to be associated with a particular object is called related or concretized. An example demonstrating a similar situation is shown in figure 8 (in the device [Application for invention No. 2016120823 dated 05/26/2016. IPC G06N 5/04. Unification unit with parallel term comparison. Authors: Meltsov V.Yu., Kuvaev AS , Chistyakov GA, Shipitsyna AA] there is no way to perform several steps 2 in the third stage). It should be noted that the increasing use of parallel inference methods in areas such as the management of large enterprises, medical and technical diagnostics, multi-criteria logical forecasting, makes it necessary to use predicates with 15-20 or more arguments, while the probability of the situation described above increases markedly.

Техническим результатом, достигаемым при использовании предлагаемого изобретения, является сокращение времени унификации предикатов с большой арностью, а также добавление опции унификации пары предикатов, если в одном из них имеется более двух пар одноименных свободных переменных, конкретизируемых в процессе сопоставления разными константами. Данный результат достигается за счет разработки и включения в состав блока унификации набора отдельных, функционально законченных узлов сопоставления термов и узла согласования переменных, необходимого для согласования конкретизируемых переменных и формирования итоговых подстановок.The technical result achieved by using the present invention is to reduce the time of unification of predicates with great arity, as well as to add the option of unifying a pair of predicates, if one of them has more than two pairs of the same free variables, specified in the process of comparison with different constants. This result is achieved through the development and inclusion in the unification block of a set of separate, functionally complete nodes for comparing terms and a node for matching variables, which is necessary for matching concrete variables and generating final substitutions.

Введение нескольких узлов сопоставления позволяет выполнять сопоставление всех термов параллельно и снизить влияние арности предикатов на продолжительность операции унификации. Реализована функциональная возможность изменения количества узлов сопоставления с учетом особенностей данных, имеющихся в базе знаний машины логического вывода (арности предикатов, количества предикатов в исходных посылках и т.д.). Благодаря регулярной структуре устройство можно легко реализовать на основе программируемой логической интегральной схемы (ПЛИС) или заказной СБИС.The introduction of several comparison nodes allows you to compare all terms in parallel and reduce the influence of predicate arity on the duration of the unification operation. The functionality has been implemented to change the number of matching nodes, taking into account the features of the data available in the knowledge base of the inference machine (arity of predicates, number of predicates in the initial premises, etc.). Due to the regular structure, the device can be easily implemented on the basis of a programmable logic integrated circuit (FPGA) or custom VLSI.

Технической задачей, на решение которой направлено изобретение, является разработка устройства, значительно сокращающего время унификации предикатов по сравнению с последовательными устройствами за счет параллельной реализации операции сопоставления всех пар термов, а также обладающего возможностью (ресурсами) унифицировать предикаты, когда в одном из предикатов есть более двух пар одноименных свободных переменных, конкретизируемых в процессе сопоставления разными константами. Представленные положения обеспечиваются применением специальных форматов унифицируемых предикатов и их аргументов, введением в состав блока унификации специализированных совместно работающих узлов сопоставления термов, а также узла согласования переменных. Особенностью представления обрабатываемых данных является использование тэгов: 1111 - предикат, 0001 - константа, 0010 - переменная исходного правила (исходной посылки-дизъюнкта), 0011 - переменная выводимого правила (целевого утверждения, запроса), а также уникальных номеров (адресов) таблицы символов для однозначной идентификации обрабатываемых термов. Поле тэгов взято размерностью 4 бита для дальнейшего расширения количества сопоставляемых типов данных, например, за счет введения функторов и списков. Таблица имен хранится во внешней общей памяти.The technical problem to which the invention is directed is the development of a device that significantly reduces the time for predicate unification compared to serial devices due to the parallel implementation of the operation of matching all pairs of terms, as well as the ability (resources) to unify predicates when there are more than one predicate two pairs of the same free variables, specified in the process of comparison by different constants. The presented provisions are ensured by the use of special formats for unified predicates and their arguments, the introduction of specialized jointly working units for comparing terms, and also the unit for matching variables into the unit of unification. The peculiarity of the representation of the processed data is the use of tags: 1111 - predicate, 0001 - constant, 0010 - variable of the source rule (the original premise-clause), 0011 - variable of the displayed rule (target statement, request), as well as unique numbers (addresses) of the symbol table for unambiguous identification of processed terms. The tag field is taken with a dimension of 4 bits to further expand the number of data types being compared, for example, by introducing functors and lists. The name table is stored in external shared memory.

Структурная схема блока унификации с параллельным сопоставлением термов показана на фигуре 1. Устройство содержит:A block diagram of a unification unit with parallel term matching is shown in Figure 1. The device comprises:

1 - внутренняя рабочая память блока унификации (ВРП);1 - internal working memory of the unification unit (GRP);

2 - однонаправленная линия связи для загрузки унифицируемых предикатов из внешней памяти по входной шине данных;2 - unidirectional communication line for loading unified predicates from external memory via the input data bus;

3 - однонаправленная линия связи с внешним устройством управления для запуска операции унификации по входной шине управления;3 - unidirectional communication line with an external control device to start the unification operation on the input control bus;

4 - узел управления (УУ);4 - control unit (UE);

5 - узел диспетчеризации (УД);5 - scheduling node (UD);

6 - однонаправленная линия связи для управления чтением из внутренней рабочей памяти;6 - unidirectional communication line for controlling reading from the internal working memory;

7 - однонаправленная линия связи для передачи имен предикатов;7 - unidirectional communication line for transmitting predicate names;

8 - узел сопоставления имен предикатов;8 - predicate name matching node;

9 - однонаправленная линия связи для передачи результатов сопоставления имен предикатов;9 - unidirectional communication line for transmitting the results of matching predicate names;

10 - однонаправленная линия связи для передачи термов;10 - unidirectional communication line for transmitting terms;

11 - однонаправленная линия связи для передачи термов;11 - unidirectional communication line for transmitting terms;

12 - первый узел сопоставления термов (УСТ);12 - the first node of the comparison of terms (TSI);

13 - последний УСТ;13 - last TSI;

14 - однонаправленная линия связи для передачи переменных;14 - unidirectional communication line for transmitting variables;

15 - узел согласования переменных (УСП);15 - node coordination of variables (USP);

16 - двунаправленная линия связи для управления УСТ;16 - bidirectional communication line for the management of TSI;

17 - двунаправленная линия связи для управления УСТ;17 - bidirectional communication line for the management of TSI;

18 - однонаправленная линия связи для передачи результатов сопоставления термов;18 - unidirectional communication line for transmitting the results of the comparison of terms;

19 - однонаправленная линия связи для передачи результатов сопоставления термов;19 is a unidirectional communication line for transmitting the results of the comparison of terms;

20 - однонаправленная линия связи для передачи подстановок из УСТ;20 - unidirectional communication line for transmitting substitutions from TSI;

21 - однонаправленная линия связи для передачи подстановок из УСТ;21 - unidirectional communication line for transmitting substitutions from TSI;

22 - однонаправленная линия связи для передачи результата операции согласования переменных в узел управления;22 - unidirectional communication line for transmitting the result of the operation of matching variables in the control node;

23 - однонаправленная линия связи для выдачи результата унификации на выходную шину управления;23 - unidirectional communication line for outputting the result of unification to the output control bus;

24 - однонаправленная линия связи для выдачи результирующих подстановок на выходную шину данных.24 - unidirectional communication line for issuing the resulting substitutions on the output data bus.

В блоке унификации предусмотрена возможность изменения количества узлов сопоставления термов, что позволяет реализовать параллельное сопоставление всех термов и за счет этого значительно снизить время, затрачиваемое на унификацию предикатов по сравнению с устройством [RU №158945 (U1), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов].In the unification block, it is possible to change the number of terms matching nodes, which allows parallel matching of all terms and thereby significantly reduces the time spent on standardizing predicates compared to the device [RU No. 158945 (U1), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification block with sequential matching of terms].

Узел сопоставления имен предикатов выделен в отдельный специализированный элемент, поскольку его структура значительно проще, чем УСТ, и отсутствует необходимость формирования подстановок переменных.The predicate name matching node is selected as a separate specialized element, since its structure is much simpler than TSI, and there is no need to form variable substitutions.

Внутренняя структура узла согласования переменных (15) приведена на фигуре 2. Он содержит:The internal structure of the variable matching node (15) is shown in figure 2. It contains:

20 - однонаправленная линия связи для передачи подстановок из УСТ;20 - unidirectional communication line for transmitting substitutions from TSI;

21 - однонаправленная линия связи для передачи подстановок из УСТ; 21 - unidirectional communication line for transmitting substitutions from TSI;

14 - однонаправленная линия связи для передачи переменных;14 - unidirectional communication line for transmitting variables;

25 - узел проверки согласованности переменных (УПС);25 - node consistency check variables (UPS);

26 - двунаправленная линия связи для передачи конкретизаций согласуемых переменных;26 is a bi-directional communication line for transmitting instantiations of negotiable variables;

27 - двунаправленная линия связи для передачи конкретизации: согласуемых переменных;27 is a bi-directional communication line for conveying instantiation: negotiable variables;

28 - узел хранения подстановок (УХП);28 - site storage substitutions (UHP);

29 - однонаправленная линия связи для передачи результата согласования пары переменных;29 - unidirectional communication line for transmitting the result of matching a pair of variables;

30 - однонаправленная линия связи для передачи результата согласования пары переменных;30 - unidirectional communication line for transmitting the result of matching a pair of variables;

40 - узел формирования ошибки при согласовании всех переменных (УФО);40 - node generating errors in the coordination of all variables (UFO);

22 - однонаправленная линия связи для передачи результата операции согласования переменных в узел управления;22 - unidirectional communication line for transmitting the result of the operation of matching variables in the control node;

24 - однонаправленная линия связи для выдачи результирующих подстановок на выходную шину данных.24 - unidirectional communication line for issuing the resulting substitutions on the output data bus.

Узел проверки согласованности переменных представляет собой многокаскадную комбинационную схемы сравнения констант, конкретизирующих одноименные переменные исходного и выводимого правила. Число каскадов определяется по формуле n/2-1, где n - максимально допустимая арность предикатов.The node for checking the consistency of variables is a multistage combinational circuit for comparing constants that specify the variables of the same name of the original and output rules. The number of cascades is determined by the formula n / 2-1, where n is the maximum permissible arity of predicates.

Узел хранения подстановок на основе ассоциативной памяти необходим не только для хранения подстановок, получаемых в процессе выполнения текущей команды унификации, но и для хранения подстановок, полученных ранее при обработке предыдущих команд унификации предикатов выбранного дизъюнкта-посылки (исходного правила) и целевого заключения (выводимого правила). Это позволяет проводить операцию унификации всех термов с учетом ранее принятых замен (конкретизаций) переменных, не тратя на дереференсирование и согласование переменных дополнительное время, весьма значительное, если конкретизации переменных хранятся во внешней памяти.The associative memory-based substitution storage node is necessary not only for storing the substitutions received during the execution of the current unification command, but also for storing the substitutions received earlier in the processing of the previous unification commands for the predicates of the selected clause sending (source rule) and the target conclusion (deduced rule ) This allows us to carry out the operation of unification of all terms taking into account previously accepted replacements (concretizations) of variables, without spending extra time on dereference and coordination of variables, which is very significant if the concretization of variables is stored in external memory.

Узел формирования ошибки формирует сигнал о неуспешном завершении процедуры согласования переменных, если для оной и той же переменной хотя бы один раз встречаются различные значения констант, конкретизирующие эту переменную.The error generating unit generates a signal about the unsuccessful completion of the variable matching procedure if for the same variable at least once there are different constant values specifying this variable.

Описание работы блока унификаций двух предикатов В качестве аргументов (атрибутов, термов) предикатов могут выступать переменные (неконкретизированные переменные), поименованные константы (атомы) и числовые константы. Имена констант всегда начинаются с заглавной буквы, а имена переменных - с прописной. Предикатное имя - все буквы заглавные.Description of the operation of the unit of unification of two predicates Variables (non-specific variables), named constants (atoms), and numerical constants can serve as arguments (attributes, terms) of predicates. Constant names always begin with an uppercase letter, and variable names with an uppercase one. The predicate name is all uppercase letters.

Рассмотрим пример организации таблицы имен (фигура 3) и внутренней рабочей памяти (фигура 4) для команды унификации двух предикатов АВТОМОБИЛЬ (Лада веста, х, у, z, z, Красный, х) и АВТОМОБИЛЬ (u, v, 43, к785не, к875не, Красный, Иванов). Предикат АВТОМОБИЛЬ имеет семь термов: модель автомобиля, фамилия владельца, код региона регистрации автомобиля, передний государственный регистрационный номер, задний государственный регистрационный номер, цвет автомобиля и фамилия водителя (за рулем в настоящий момент времени). В данном примере первый предикат характеризует автомобиль Лада Веста серебристого цвета, а владелец, код региона и государственные номера задаются переменными х, у и z соответственно, которые могут уточняться в дальнейшем. Для второго предиката известны: код региона, номера и цвет автомобиля, фамилия водителя, а владелец и модель автомобиля не определены - переменные u и v могут уточняться в дальнейшем (

Figure 00000001
- переменная выводимого правила). С учетом введенных тэгов (см. выше), структура первого предиката будет занимать первые пять ячеек рабочей памяти (фигура 4, ячейки с адреса 000 по 007), второй предикат - ячейки с 008 по 015. По правилам, введенным в теории логического программирования, предикаты с одинаковым именем, всегда должны иметь одинаковую арность (количество термов).Consider an example of organizing a name table (figure 3) and internal working memory (figure 4) for the unification command for the two predicates CAR (Lada Vesta, x, y, z, z, Red, x) and CAR (u, v, 43, к785ne, k875ne, Red, Ivanov). The predicate CAR has seven terms: car model, name of owner, code of the region of registration of the car, front state registration number, rear state registration number, color of the car and surname of the driver (currently driving). In this example, the first predicate characterizes the silver Lada Vesta car, and the owner, region code and state numbers are set by the variables x, y and z, respectively, which can be specified in the future. For the second predicate, the following are known: the region code, the number and color of the car, the name of the driver, and the owner and model of the car are not defined - the variables u and v can be specified later (
Figure 00000001
- variable of the displayed rule). Based on the entered tags (see above), the structure of the first predicate will occupy the first five cells of working memory (Figure 4, cells from addresses 000 to 007), the second predicate will occupy cells from 008 to 015. According to the rules introduced in the theory of logical programming, predicates with the same name must always have the same arity (number of terms).

Рассмотрим пример организации таблицы подстановок в УСП (фигура 5). Сначала (столбцы 3 и 4) указывается тэг и номер заменяемой переменной, а в конце (столбцы 5 и 6) - новое значение переменной.Consider an example of organizing a lookup table in the USP (figure 5). At first (columns 3 and 4) the tag and number of the variable to be replaced are indicated, and at the end (columns 5 and 6) - the new value of the variable.

Алгоритм выполнения операции, параллельной унификации термов двух предикатов на заявляемом устройстве, состоит из следующих этапов (см. фигуру 1).The algorithm for performing an operation parallel to the unification of the terms of two predicates on the claimed device consists of the following steps (see figure 1).

Этап 0. Во внутреннюю рабочую память 1 по линии связи 2 загружаются два предиката - сложноструктурированные группы тэгированных данных. По линии связи 3 в узел управления 4 поступает сигнал о начале выполнения операции унификации.Stage 0. Two predicates are loaded into the internal working memory 1 via the communication line 2 - complex-structured groups of tagged data. On the communication line 3 to the control unit 4 receives a signal about the start of the operation of unification.

Этап 1. Узел диспетчеризации 5 по линии связи 6 посылает команду на чтение из внутренней рабочей памяти 1:Stage 1. Node scheduling 5 on the communication line 6 sends a command to read from the internal working memory 1:

- имен предикатов по линии связи 7 в узел сопоставления имен предикатов 8;- names of predicates on the communication line 7 to the node matching the names of predicates 8;

- термов предикатов (первый, второй, третий, ... и т.д.) попарно по линиям связи 10 и 11 в узлы сопоставления термов 12 и 13 соответственно.- predicate terms (first, second, third, ..., etc.) in pairs along the communication lines 10 and 11 to the nodes of the comparison of terms 12 and 13, respectively.

Этап 2. На узлах сопоставления 8, 12-13 производится параллельная асинхронная процедура сопоставления указанных аргументов.Stage 2. On the matching nodes 8, 12-13, a parallel asynchronous procedure for matching the specified arguments is performed.

Если имена предикатов не совпадают, то из узла сопоставления 8 по линии связи 9 в узел управления 4 поступает сигнал - «0». В противном случае поступает сигнал «1».If the names of the predicates do not match, then from the mapping node 8 via the communication line 9 to the control node 4 receives a signal - "0". Otherwise, the signal "1".

При сопоставлении термов возможны следующие ситуации:When matching terms, the following situations are possible:

- если унифицируется пара «константа-константа» и имена констант не совпадают, то из узла сопоставления 12 (13) по линии связи 18 (19) в узел управления 4 поступает сигнал «0». В противном случае поступает сигнал «1»;- if a pair of "constant-constant" is unified and the names of the constants do not match, then from the mapping node 12 (13) via the communication line 18 (19) to the control node 4 receives the signal "0". Otherwise, the signal "1";

- если унифицируется пара «переменная-константа» (или «константа-переменная»), то из узла сопоставления 12 (13) по линии связи 18 (19) в узел управления 4 поступает сигнал «1», а в узел сопоставления переменных 15 по линии связи 20 (21) - сформированная при сопоставлении термов подстановка переменной;- if the variable-constant pair (or “constant-variable”) is unified, then from the mapping node 12 (13) via the communication line 18 (19), the signal “1” arrives at the control node 4, and the variable matching node 15 receives communication lines 20 (21) - a variable substitution formed when matching terms;

- если унифицируется пара «переменная-переменная», причем одна из них является переменной выводимого правила, то из узла сопоставления 12 (13) по линии связи 18 (19) в узел управления 4 поступает сигнал «1», а в узел сопоставления переменных 15 по линии связи 20 (21) - сформированная при сопоставлении термов подстановка (переменная выводимого правила является «заменяемой переменной»).- if the pair “variable-variable” is unified, and one of them is a variable of the displayed rule, then from the mapping node 12 (13) via the communication line 18 (19) the signal “1” is sent to the control node 4, and to the variable matching node 15 on the communication line 20 (21) - a substitution formed during the comparison of terms (the variable of the displayed rule is a “replaceable variable”).

Пример организации таблицы подстановок после второго этапа унификации вышеуказанных предикатов АВТОМОБИЛЬ приведен на фигуре 5.An example of the organization of the lookup table after the second stage of unification of the above predicates CAR is shown in figure 5.

Если в результате сопоставления имен предикатов или какой-либо пары термов в узел управления 4 поступил хотя бы один «0», то операция унификации останавливается и по линии связи 23 выдается сигнал («0») о неуспешном завершении операции.If, as a result of matching the names of predicates or any pair of terms, at least one “0” is received in the control unit 4, then the unification operation is stopped and a signal (“0”) is issued on the communication line 23 indicating the operation was unsuccessful.

Этап 3. Если в результате сопоставления имен предикатов и всех пар термов в узел управления 4 поступили сигналы «1», то в узле сопоставления переменных 15 производится процедура согласования конкретизированных переменных, состоящая из следующих шагов:Stage 3. If, as a result of matching the names of predicates and all pairs of terms, the signals “1” are received in the control node 4, then the procedure for matching the specified variables is performed in the variable matching node 15, consisting of the following steps:

- шаг 1. Сравниваются все конкретизации одноименных переменных константами (см. фигура 5, столбцы «Заменяемая переменная» и «Новое значение»). Если в столбце «Новое значение» хотя бы один раз встречаются различные значения констант для оной и той же переменной, то в узел управления 4 по линии связи 22 подается сигнал «0» о неуспешном завершении процедуры согласования переменных. Если все записи конкретизируются одной и той же константой, то в ассоциативной памяти подстановок остается только одна (первая) запись о замене этой переменной соответствующей константой, а остальные записи удаляются.- step 1. All instantiations of the variables of the same name are compared with constants (see figure 5, the columns "Replaceable variable" and "New value"). If in the column "New value" at least once there are different constant values for the same variable, then to the control unit 4 via communication line 22 a signal "0" is sent about the failure of the variable matching procedure. If all records are instantiated with the same constant, then in the associative memory of the substitutions there is only one (first) record about replacing this variable with the corresponding constant, and the rest of the records are deleted.

- шаг 2. Во всех парах «переменная-переменная» аргументы - переменные заменяются на имеющиеся в других записях конкретизации соответствующими константами. Причем, если в паре заменяется на константу только переменная выводимого правила (столбец «Заменяемая переменная»), а переменная исходного правила нет (столбец «Новое значение»), то ячейки (содержимое ячеек) в столбцах «Заменяемая переменная» и «Новое значение» такой записи меняются местами.- step 2. In all the “variable-variable” pairs, the arguments - the variables are replaced with the corresponding constants in the other concretization entries. Moreover, if in the pair only the variable of the displayed rule is replaced with a constant (the column “Replaceable variable”), and the variable of the original rule is not (the column “New value”), then the cells (the contents of the cells) in the columns “Replaceable variable” and “New value” such records are reversed.

Если для какой-либо записи в столбцах «Заменяемая переменная» и «Новое значение» встречаются две константы с различными значениями (именами), то в узел управления 4 по линии связи 22 подается сигнал «0» о неуспешном завершении процедуры согласования переменных. Записи с двумя одинаковыми константами удаляются для уменьшения объема информации, хранимой в таблице подстановок.If for any record in the columns “Replaceable Variable” and “New Value” there are two constants with different values (names), then a signal “0” is sent to control node 4 via communication line 22 about the unsuccessful completion of the variable matching procedure. Records with two identical constants are deleted to reduce the amount of information stored in the lookup table.

В процессе унификации предикатов с большим числом пар одноименных переменных может потребоваться выполнить несколько подобных шагов. Худший случай, т.е. наибольшее количество шагов 2 на третьем этапе согласования двух n-местных предикатов, можно получить при наличии в одном предикате n/2 пар одноименных свободных переменных, а в другом предикате (n/2-l) пар одноименных свободных переменных. Число шагов 2 в этом случае будет равно (n/2-l).In the process of unifying predicates with a large number of pairs of variables of the same name, it may be necessary to perform several similar steps. Worst case, i.e. the greatest number of steps 2 at the third stage of matching two n-local predicates can be obtained if there are n / 2 pairs of homonymous free variables in one predicate and (n / 2-l) pairs of homogeneous free variables in the other predicate. The number of steps 2 in this case will be equal to (n / 2-l).

- шаг 3. Сравниваются все конкретизации одноименных переменных константами (см. фигура 5, столбцы «Заменяемая переменная» и «Новое значение»). Если в столбце «Новое значение» хотя бы один раз встречаются различные значения констант, то в узел управления 4 по линии связи 22 подается сигнал «0» о неуспешном завершении процедуры согласования переменных. Если все записи конкретизируются одной и той же константой, то в ассоциативной памяти подстановок остается только одна (первая) запись о замене этой переменной соответствующей константой, а остальные записи удаляются, а в узел управления 4 по линии связи 22 подается сигнал «1» об успешном завершении процедуры согласования переменных.- step 3. All instantiations of the variables of the same name are compared with constants (see figure 5, the columns “Replaceable variable” and “New value”). If in the column "New value" at least once there are different values of constants, then to the control unit 4 via communication line 22 a signal "0" is sent about the unsuccessful completion of the procedure for matching variables. If all records are specified by the same constant, then in the associative memory of the substitutions there is only one (first) record about replacing this variable with the corresponding constant, and the rest of the records are deleted, and a signal “1” is sent to control node 4 via communication line 22 about successful completion of the variable matching procedure.

Этап 4. Если процедура согласования конкретизированных переменных завершилась неуспешно (из узла согласования переменных 15 по линии связи 22 поступил сигнал «0»), то узел управления 4 по линии связи 23 выдает сигнал «0», означающий невозможность унификации анализируемой пары предикатов. Если процедура согласования конкретизированных переменных завершилась успешно (из узла согласования переменных 15 по линии связи 22 поступил сигнал «1»), то узел управления 4 по линии связи 23 выдает сигнал «1», означающий успешное окончание операции унификации пары предикатов. При этом из узла согласования переменных 15 по линии связи 24 выдаются замены всех переменных, полученные при унификации указанной пары предикатов.Stage 4. If the procedure for reconciling the specified variables failed (a signal “0” was received from the node for coordinating the variables 15 via the communication line 22), then the control unit 4 sends a “0” signal via the communication line 23, which means that it is impossible to unify the analyzed pair of predicates. If the procedure for reconciling the specified variables was completed successfully (the signal “1” was received from the node for reconciling the variables 15 via the communication line 22), the control unit 4 via the communication line 23 issues a “1” signal, which indicates the successful completion of the unification operation of the pair of predicates. In this case, from the coordination node of the variables 15 via the communication line 24, replacements are made of all variables obtained by unifying the specified pair of predicates.

Пример 1 (фиг. 6) демонстрирует случай успешного завершения процедуры согласования переменных - все пары отмечены (1), и унификации предикатов в целом. В узел управления 4 из узла формирования подстановок посылается сигнал «1». Конкретизации переменных (подстановки) получены на этапе 3, шаг 1.Example 1 (Fig. 6) demonstrates the case of successful completion of the procedure for matching variables - all pairs are marked (1), and the unification of predicates as a whole. Signal “1” is sent to control unit 4 from the substitution formation unit. Concretization of variables (substitutions) were obtained at stage 3, step 1.

Пример 2 (фиг. 7) демонстрирует случай неуспешного завершения процедуры согласования переменных на третьем шаге третьего этапа и унификации предикатов в целом. Шаг 2 третьего этапа достаточно выполнить однократно.Example 2 (Fig. 7) demonstrates the case of unsuccessful completion of the procedure for matching variables in the third step of the third stage and the unification of predicates in general. Step 2 of the third stage is enough to perform once.

Пример 3 (фиг .8) демонстрирует случай неуспешного завершения процедуры согласования переменных на третьем шаге третьего этапа и унификации предикатов в целом. Однако второй шаг третьего этапа при этом необходимо выполнить дважды, что алгоритмом функционирования (и ресурсами) устройства [4] не предусмотрено.Example 3 (Fig. 8) demonstrates the case of unsuccessful completion of the procedure of matching variables in the third step of the third stage and the unification of predicates in general. However, the second step of the third stage must be performed twice, which is not provided by the functioning algorithm (and resources) of the device [4].

Пример 4 (фиг. 9) демонстрирует случай неуспешного завершения процедуры согласования переменных на третьем шаге третьего этапа. Однако второй шаг третьего этапа при этом необходимо выполнить трижды, что алгоритмом функционирования (и ресурсами) устройства [4] также не предусмотрено.Example 4 (Fig. 9) demonstrates the case of an unsuccessful completion of the variable matching procedure in the third step of the third stage. However, the second step of the third stage must be performed three times, which is also not provided for by the functioning algorithm (and resources) of the device [4].

Минимальное повышение производительности заявляемым устройством можно оценить следующим образом. Будем считать, что унифицируемые предикаты загружены во внутреннюю память заранее и отсчет времени ведется с момента поступления сигнала запуска (т.е. без учета этапа 0). Время выполнения этапов 1, 2, 4, а также каждого шага этапа 3 (потребуется только в том случае, если в сопоставляемой паре термов имеется хотя бы одна переменная) будем называть тактом работы устройства.The minimum performance increase of the claimed device can be estimated as follows. We assume that the unified predicates are loaded into the internal memory in advance and the time is counted from the moment the trigger signal arrives (i.e., without taking stage 0 into account). The execution time of steps 1, 2, 4, as well as each step of step 3 (it will be required only if there is at least one variable in the pair of terms to be compared) will be called the device operation cycle.

Для сравнения возьмем устройства [RU №158945 (Ul), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] и [4]. Этапы 1, 2 и 4 на них выполняются также за один такт каждый. В устройстве [RU №158945 (U1), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] для поиска и возможного согласования (дереференсирования) переменной в памяти подстановок потребуется 6 тактов (в случае необходимости согласования) или 4 такта (в случае отсутствия в памяти подстановок предыдущих конкретизаций анализируемой переменной). Таким образом, минимально возможное время унификации будет 3 такта - если в унифицируемой паре предикатов в качестве самых первых термов используются константы с разными именами (значениями). В устройстве [4] и заявляемом устройстве это время также равно 3 тактам.For comparison, take the device [RU No. 158945 (Ul), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification block with sequential comparison of terms] and [4]. Steps 1, 2, and 4 on them are also performed in one cycle each. In the device [RU No. 158945 (U1), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification unit with sequential comparison of terms] to search for and possibly coordinate (de-reference) a variable in the substitution memory, 6 cycles (if necessary, matching) or 4 cycles (if there are no substitutions in the memory for previous instantiations of the analyzed variable) will be required. Thus, the minimum possible unification time will be 3 cycles - if constants with different names (values) are used as the very first terms in the unified pair of predicates. In the device [4] and the claimed device, this time is also equal to 3 clock cycles.

В устройстве [RU №158945 (U1), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] унификация для примера 1 (фиг. 6) выполнится за 45 тактов: считывание имен предикатов (1 такт); сопоставление имен предикатов (1 такт); считывание первой пары аргументов (1 такт); сопоставление первой пары аргументов (1 такт); считывание второй пары аргументов (1 такт); сопоставление второй пары аргументов (1 такт); попытка согласования переменной v (4 такта); попытка согласования переменной х (4 такта); считывание третьей пары аргументов (1 такт); сопоставление третьей пары аргументов (1 такт); попытка согласования переменной у (4 такта); считывание четвертой пары аргументов (1 такт); сопоставление четвертой пары аргументов - (1 такт); попытка согласования переменной z (4 такта); считывание пятой пары аргументов (1 такт); сопоставление пятой пары аргументов (1 такт); согласование переменной z - (6 тактов); считывание шестой пары аргументов (1 такт); сопоставление шестой пары аргументов (1 такт); считывание седьмой пары аргументов (1 такт); сопоставление седьмой пары аргументов (1 такт); согласование переменной х (6 тактов); выдача результатов (1 такт).In the device [RU No. 158945 (U1), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification unit with sequential comparison of terms] unification for example 1 (Fig. 6) will be performed in 45 cycles: reading predicate names (1 cycle); matching predicate names (1 measure); reading the first pair of arguments (1 clock); matching the first pair of arguments (1 clock); reading the second pair of arguments (1 clock); matching the second pair of arguments (1 clock); attempt to match the variable v (4 measures); attempt to reconcile variable x (4 measures); reading the third pair of arguments (1 clock); matching the third pair of arguments (1 clock); an attempt to coordinate the variable y (4 measures); reading the fourth pair of arguments (1 clock); comparison of the fourth pair of arguments - (1 clock cycle); attempt to match the variable z (4 measures); reading the fifth pair of arguments (1 clock); matching the fifth pair of arguments (1 clock); matching the variable z - (6 measures); reading the sixth pair of arguments (1 clock); matching the sixth pair of arguments (1 clock); reading the seventh pair of arguments (1 clock); matching the seventh pair of arguments (1 clock); coordination of the variable x (6 measures); delivery of results (1 step).

В устройстве [Заявка на изобретение №2016120823 от 26.05.2016. МПК G06N 5/04. Блок унификации с параллельным сопоставлением термов. Авторы: Мельцов В.Ю., Куваев А.С., Чистяков Г.А., Шипицына А.А.] - за 4 такта (Этап 1; Этап 2; Этап3_шаг 1; Этап 4).In the device [Application for invention No. 2016120823 dated 05/26/2016. IPC G06N 5/04. Unification block with parallel term matching. Authors: Meltsov V.Yu., Kuvaev AS, Chistyakov GA, Shipitsyna AA] - for 4 measures (Stage 1; Stage 2; Stage 3_step 1; Stage 4).

В заявляемом устройстве - также за 4 такта (Этап 1; Этап 2; Этап 3_шаг1; Этап 4).In the inventive device - also for 4 cycles (Stage 1; Stage 2; Stage 3_step1; Stage 4).

В устройстве [RU №158945 (U1), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] унификация для примера 2 (фиг. 7) выполнится за 32 такта: считывание имен предикатов (1 такт); сопоставление имен предикатов (1 такт); считывание первой пары аргументов (1 такт); сопоставление первой пары аргументов (1 такт); считывание второй пары аргументов (1 такт); попытка согласования переменной х (4 такта); попытка согласования переменной t (4 такта); считывание третьей пары аргументов (1 такт); сопоставление третьей пары аргументов (1 такт); попытка согласования переменной х (4 такта); попытка согласования переменной s (4 такта); считывание четвертой пары аргументов (1 такт); сопоставление четвертой пары аргументов (1 такт); согласование переменной s (6 тактов); выдача результатов (1 такт).In the device [RU No. 158945 (U1), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification unit with sequential comparison of terms] unification for example 2 (Fig. 7) will be performed in 32 measures: reading the names of predicates (1 measure); matching predicate names (1 measure); reading the first pair of arguments (1 clock); matching the first pair of arguments (1 clock); reading the second pair of arguments (1 clock); attempt to reconcile variable x (4 measures); attempt to match the variable t (4 measures); reading the third pair of arguments (1 clock); matching the third pair of arguments (1 clock); attempt to reconcile variable x (4 measures); attempt to match the variable s (4 measures); reading the fourth pair of arguments (1 clock); matching the fourth pair of arguments (1 clock); matching s variable (6 measures); delivery of results (1 step).

В устройстве [Заявка на изобретение №2016120823 от 26.05.2016. МПК G06N 5/04. Блок унификации с параллельным сопоставлением термов. Авторы: Мельцов В.Ю., Куваев А.С., Чистяков Г.А., Шипицына А.А.] - за 6 тактов (Этап 1; Этап 2; Этап 3_шаг 1; Этап 3_шаг 2; Этап 3_шаг 3; Этап 4).In the device [Application for invention No. 2016120823 dated 05/26/2016. IPC G06N 5/04. Unification block with parallel term matching. Authors: Meltsov V.Yu., Kuvaev A.S., Chistyakov G.A., Shipitsyna A.A.] - for 6 cycles (Stage 1; Stage 2; Stage 3_step 1; Stage 3_step 2; Stage 3_step 3; Stage four).

В заявляемом устройстве - также за 6 тактов (Этап 1; Этап 2; Этап 3_шаг 1; Этап 3_шаг 2; Этап 3_шаг 3; Этап 4).In the inventive device, also for 6 clock cycles (Stage 1; Stage 2; Stage 3_step 1; Stage 3_step 2; Stage 3_step 3; Stage 4).

В устройстве [RU №158945 (Ul), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] унификация для примера 3 (фиг. 8) выполнится за 52 такта: считывание имен предикатов (1 такт); сопоставление имен предикатов (1 такт); считывание первой пары аргументов (1 такт); сопоставление первой пары аргументов (1 такт); считывание второй пары аргументов (1 такт); попытка согласования переменной х (4 такта); попытка согласования переменной t (4 такта); считывание третьей пары аргументов (1 такт); сопоставление третьей пары аргументов (1 такт); попытка согласования переменной х (4 такта); попытка согласования переменной u (4 такта); считывание четвертой пары аргументов (1 такт); сопоставление четвертой пары аргументов (1 такт); попытка согласования переменной у (4 такта); попытка согласования переменной u (4 такта); считывание пятой пары аргументов (1 такт); сопоставление пятой пары аргументов (1 такт); попытка согласования переменной у (4 такта); попытка согласования переменной s (4 такта); считывание шестой пары аргументов (1 такт); сопоставление шестой пары аргументов (1 такт); согласования переменной s (6 тактов); выдача результатов (1 такт).In the device [RU No. 158945 (Ul), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification unit with sequential comparison of terms] unification for example 3 (Fig. 8) will be performed in 52 measures: reading the names of predicates (1 measure); matching predicate names (1 measure); reading the first pair of arguments (1 clock); matching the first pair of arguments (1 clock); reading the second pair of arguments (1 clock); attempt to reconcile variable x (4 measures); attempt to match the variable t (4 measures); reading the third pair of arguments (1 clock); matching the third pair of arguments (1 clock); attempt to reconcile variable x (4 measures); attempt to reconcile the variable u (4 measures); reading the fourth pair of arguments (1 clock); matching the fourth pair of arguments (1 clock); an attempt to reconcile the variable y (4 measures); attempt to reconcile the variable u (4 measures); reading the fifth pair of arguments (1 clock); matching the fifth pair of arguments (1 clock); an attempt to reconcile the variable y (4 measures); attempt to match the variable s (4 measures); reading the sixth pair of arguments (1 clock); matching the sixth pair of arguments (1 clock); matching s variable (6 measures); delivery of results (1 step).

В устройстве [Заявка на изобретение №2016120823 от 26.05.2016. МПК G06N 5/04. Блок унификации с параллельным сопоставлением термов. Авторы: Мельцов В.Ю., Куваев А.С., Чистяков Г.А., Шипицына А.А.] - отсутствует возможность полного согласования переменных и, соответственно, корректной унификации предикатов.In the device [Application for invention No. 2016120823 dated 05/26/2016. IPC G06N 5/04. Unification block with parallel term matching. Authors: Meltsov V.Yu., Kuvaev AS, Chistyakov GA, Shipitsyna AA] - there is no possibility of complete coordination of variables and, accordingly, correct unification of predicates.

В заявляемом устройстве - за 7 тактов (Этап 1; Этап 2; Этап 3_шаг 1; Этап 3_шаг 2.1; Этап 3_шаг 2.2; Этап 3_шаг 2.3; Этап 3_шаг 3; Этап 4).In the inventive device - for 7 clock cycles (Stage 1; Stage 2; Stage 3_step 1; Stage 3_step 2.1; Stage 3_step 2.2; Stage 3_step 2.3; Stage 3_step 3; Stage 4).

В устройстве [RU №158945 (U1), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] унификация для примера 4 (фиг.9) выполнится за 72 такта: считывание имен предикатов (1 такт); сопоставление имен предикатов (1 такт); считывание первой пары аргументов (1 такт); сопоставление первой пары аргументов (1 такт); считывание второй пары аргументов (1 такт); попытка согласования переменной х (4 такта); попытка согласования переменной t (4 такта); считывание третьей пары аргументов (1 такт); сопоставление третьей пары аргументов (1 такт); попытка согласования переменной х (4 такта); попытка согласования переменной u (4 такта); считывание четвертой пары аргументов (1 такт); сопоставление четвертой пары аргументов (1 такт); попытка согласования переменной z (4 такта); попытка согласования переменной u (4 такта); считывание пятой пары аргументов (1 такт); сопоставление пятой пары аргументов (1 такт); попытка согласования переменной z (4 такта); попытка согласования переменной v (4 такта); считывание шестой пары аргументов (1 такт); сопоставление шестой пары аргументов (1 такт); по пытка согласования переменной у (4 такта); попытка согласования переменной v (4 такта); считывание седьмой пары аргументов (1 такт); сопоставление седьмой пары аргументов (1 такт); попытка согласования переменной у (4 такта); попытка согласования переменной s (4 такта); считывание восьмой пары аргументов (1 такт); сопоставление восьмой пары аргументов (1 такт); согласование переменной s (6 тактов); выдача результатов (1 такт).In the device [RU No. 158945 (U1), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification unit with sequential comparison of terms] unification for example 4 (Fig. 9) will be performed in 72 measures: reading predicate names (1 measure); matching predicate names (1 measure); reading the first pair of arguments (1 clock); matching the first pair of arguments (1 clock); reading the second pair of arguments (1 clock); attempt to reconcile variable x (4 measures); attempt to match the variable t (4 measures); reading the third pair of arguments (1 clock); matching the third pair of arguments (1 clock); attempt to reconcile variable x (4 measures); attempt to reconcile the variable u (4 measures); reading the fourth pair of arguments (1 clock); matching the fourth pair of arguments (1 clock); attempt to match the variable z (4 measures); attempt to reconcile the variable u (4 measures); reading the fifth pair of arguments (1 clock); matching the fifth pair of arguments (1 clock); attempt to match the variable z (4 measures); attempt to match the variable v (4 measures); reading the sixth pair of arguments (1 clock); matching the sixth pair of arguments (1 clock); Attempting to match the variable y (4 measures); attempt to match the variable v (4 measures); reading the seventh pair of arguments (1 clock); matching the seventh pair of arguments (1 clock); an attempt to reconcile the variable y (4 measures); attempt to match the variable s (4 measures); reading the eighth pair of arguments (1 clock); matching the eighth pair of arguments (1 clock); matching s variable (6 measures); delivery of results (1 step).

В устройстве [Заявка на изобретение №2016120823 от 26.05.2016. МПК G06N 5/04. Блок унификации с параллельным сопоставлением термов. Авторы: Мельцов В.Ю., Куваев А.С., Чистяков Г.А., Шипицына А.А.] - отсутствует возможность полного согласования переменных и, соответственно, корректной унификации предикатов.In the device [Application for invention No. 2016120823 dated 05/26/2016. IPC G06N 5/04. Unification block with parallel term matching. Authors: Meltsov V.Yu., Kuvaev AS, Chistyakov GA, Shipitsyna AA] - there is no possibility of complete coordination of variables and, accordingly, correct unification of predicates.

В заявляемом устройстве - за 8 тактов (Этап 1; Этап 2; Этап 3_шаг 1; Этап 3_шаг 2.1; Этап 3_шаг 2.2; Этап 3_шаг 2.3; Этап 3_шаг 3; Этап 4).In the inventive device - for 8 clock cycles (Stage 1; Stage 2; Stage 3_step 1; Stage 3_step 2.1; Stage 3_step 2.2; Stage 3_step 2.3; Stage 3_step 3; Stage 4).

Все сравнения приведены для случая, когда предыдущие подстановки переменных находятся во внутренней памяти блока унификации. Для заявляемого устройства это условие выполняется всегда. Для устройства [RU №158945 (U1), G06N 5/04. Заявка: 2015120634/08, 29.05.2015; опубл. 20.01.2016. Блок унификации с последовательным сопоставлением термов] во внутренней памяти хранятся только подстановки, выполненные при унификации текущей пары предикатов обрабатываемых правил-дизъюнктов. Остальные конкретизации хранятся во внешней памяти.All comparisons are given for the case when the previous variable substitutions are in the internal memory of the unification block. For the inventive device, this condition is always satisfied. For the device [RU No. 158945 (U1), G06N 5/04. Application: 2015120634/08, 05/29/2015; publ. 01/20/2016. Unification unit with sequential matching of terms] in the internal memory, only the substitutions performed during the unification of the current pair of predicates of the processed clause rules are stored. The remaining instantiations are stored in external memory.

С учетом вышесказанного можно утверждать, что заявляемое устройство многократно снижает время унификации по сравнению с последовательными устройствами, что позволит достичь значительного превосходства по производительности разрабатываемых на его основе специализированных процессоров логического вывода над существующими аналогами. Кроме того, в заявляемом устройстве возможно сопоставление пар предикатов, даже если в одном из предикатов есть более двух пар одноименных свободных переменных, конкретизируемых в процессе сопоставления разными константами, что отличает его от устройства [Заявка на изобретение №2016120823 от 26.05.2016. МПК G06N 5/04. Блок унификации с параллельным сопоставлением термов. Авторы: Мельцов В.Ю., Куваев А.С., Чистяков Г.А., Шипицына А.А.].Based on the foregoing, it can be argued that the inventive device significantly reduces the time of unification compared to serial devices, which will allow to achieve significant superiority in performance of specialized logical output processors developed on its basis over existing analogs. In addition, in the claimed device it is possible to compare pairs of predicates, even if in one of the predicates there are more than two pairs of the same free variables, specified in the process of comparison by different constants, which distinguishes it from the device [Application for invention No. 2016120823 from 05.26.2016. IPC G06N 5/04. Unification block with parallel term matching. Authors: Meltsov V.Yu., Kuvaev A.S., Chistyakov G.A., Shipitsyna A.A.].

Предварительные оценки аппаратной реализации заявляемого устройства на бюджетной ПЛИС Altera Cyclone III свидетельствуют о свободном размещении на кристалле более 100 узлов сопоставления в одном блоке унификации, что дает возможность параллельного сопоставления всех аргументов обрабатываемых предикатов одновременно.Preliminary estimates of the hardware implementation of the claimed device on the budget Altera Cyclone III FPGA indicate the free placement of more than 100 matching nodes on a chip in one unification block, which makes it possible to parallelly compare all arguments of processed predicates at the same time.

Claims (1)

Блок унификации с параллельным сопоставлением термов, содержащий внутреннюю рабочую память, входы которой соединены с входной шиной данных и выходом узла диспетчеризации, а выходы соединены с входом узла сопоставления переменных, входом узла сопоставления имен предикатов и входами узлов сопоставления термов, узел управления, входы которого соединены с входной шиной управления, выходом узла сопоставления переменных, выходом узла сопоставления имен предикатов и выходами узлов сопоставления термов, узел диспетчеризации, входы которого соединены с выходами узлов сопоставления термов, а выходы соединены с входом внутренней рабочей памяти и входами узлов сопоставления термов, узел сопоставления имен предикатов, вход которого соединен с выходом внутренней рабочей памяти, а выход соединен с входом узла управления, узлы сопоставления термов, входы которых соединены с выходами внутренней рабочей памяти и выходами узла диспетчеризации, а выходы соединены с входами узла управления, входами узла согласования переменных и входами узла диспетчеризации, отличающийся тем, что дополнительно содержит узел согласования переменных, входы которого соединены с выходами узлов сопоставления термов и выходом внутренней рабочей памяти, а выходы соединены с входом узла управления и выходной шиной данных.A unification unit with parallel term matching containing internal working memory, the inputs of which are connected to the input data bus and the output of the dispatch node, and the outputs are connected to the input of the variable mapping node, the input of the predicate name matching node and the inputs of the term matching nodes, the control node whose inputs are connected with an input control bus, the output of the variable mapping node, the output of the predicate name matching node and the outputs of the term matching nodes, the dispatch node, whose inputs are connected to the outputs of the term matching nodes, and the outputs are connected to the input of the internal working memory and the inputs of the term matching nodes, the predicate name matching node, the input of which is connected to the output of the internal working memory, and the output is connected to the input of the control node, the term matching nodes, the inputs of which are connected with the outputs of the internal working memory and the outputs of the scheduling node, and the outputs are connected to the inputs of the control node, the inputs of the variable matching node and the inputs of the scheduling node, characterized in that up to olnitelno comprises variable matching unit having inputs connected to outputs of terms and the output matching internal working memory nodes and outputs connected to control input node and an output data bus.
RU2017129495A 2017-08-18 2017-08-18 Unification unit with parallel comparison of terms RU2659492C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2017129495A RU2659492C1 (en) 2017-08-18 2017-08-18 Unification unit with parallel comparison of terms

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2017129495A RU2659492C1 (en) 2017-08-18 2017-08-18 Unification unit with parallel comparison of terms

Publications (1)

Publication Number Publication Date
RU2659492C1 true RU2659492C1 (en) 2018-07-02

Family

ID=62815413

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2017129495A RU2659492C1 (en) 2017-08-18 2017-08-18 Unification unit with parallel comparison of terms

Country Status (1)

Country Link
RU (1) RU2659492C1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2723852C1 (en) * 2019-12-12 2020-06-17 Тимофей Иванович Кожокин Electrode with shank for contact spot welding

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040103013A1 (en) * 2002-11-25 2004-05-27 Joel Jameson Optimal scenario forecasting, risk sharing, and risk trading
WO2005055073A1 (en) * 2003-11-27 2005-06-16 Qinetiq Limited Automated anomaly detection
RU158945U1 (en) * 2015-05-29 2016-01-20 Федеральное государственное бюджетное образовательное учреждение высшего образования "Вятский государственный университет" UNIFICATION UNIT WITH SERIAL COMPARISON OF TERMS
RU2612597C1 (en) * 2013-06-28 2017-03-09 Интел Корпорейшн Processors, methods, systems and commands with packed data elements predication

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040103013A1 (en) * 2002-11-25 2004-05-27 Joel Jameson Optimal scenario forecasting, risk sharing, and risk trading
US20080027774A1 (en) * 2002-11-25 2008-01-31 Joel Jameson Optimal Scenario Forecasting, Risk Sharing, and Risk Trading
WO2005055073A1 (en) * 2003-11-27 2005-06-16 Qinetiq Limited Automated anomaly detection
RU2612597C1 (en) * 2013-06-28 2017-03-09 Интел Корпорейшн Processors, methods, systems and commands with packed data elements predication
RU158945U1 (en) * 2015-05-29 2016-01-20 Федеральное государственное бюджетное образовательное учреждение высшего образования "Вятский государственный университет" UNIFICATION UNIT WITH SERIAL COMPARISON OF TERMS

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2723852C1 (en) * 2019-12-12 2020-06-17 Тимофей Иванович Кожокин Electrode with shank for contact spot welding

Similar Documents

Publication Publication Date Title
EP3667496B1 (en) Distributed computing system, data transmission method and device in distributed computing system
US9619430B2 (en) Active non-volatile memory post-processing
CN104364775A (en) Special memory access path with segment-offset addressing
CN103999036A (en) Method and system using exceptions for code specialization in a computer architecture that supports transactions
US20110302394A1 (en) System and method for processing regular expressions using simd and parallel streams
US20070260826A1 (en) Compare, swap and store facility with no external serialization
JP2022513382A (en) Methods, devices and computer storage media for achieving function jumps
US8788766B2 (en) Software-accessible hardware support for determining set membership
US20200142669A1 (en) Controlling storage accesses for merge operations
RU2659492C1 (en) Unification unit with parallel comparison of terms
JPS6236577B2 (en)
US11200203B1 (en) Accessing files stored in a firmware volume from a pre-boot application
CN110706108B (en) Method and apparatus for concurrently executing transactions in a blockchain
CN111522730A (en) Program testing method and device, computer device and computer readable medium
JP4254954B2 (en) Data processing device
CN114816772B (en) Debugging method, debugging system and computing device for application running based on compatible layer
Biswas Heterogeneous Data Structure “r-Atrain”
RU2631158C1 (en) Unification unit with parallel therm matching
RU158945U1 (en) UNIFICATION UNIT WITH SERIAL COMPARISON OF TERMS
EP3113038B1 (en) A data handling method
US10802854B2 (en) Method and apparatus for interpreting bytecode instruction stream
US20210049016A1 (en) Efficient performance of inner loops on a multi-lane processor
CN106844242B (en) A kind of method for interchanging data and system
Bruns et al. The formalization and analysis of a communications protocol
US20150286640A1 (en) Data storage device, data storage method and program