backus-naur_人工智能中的Backus-Naur形式(BNF)
backus-naur
Backus-Naur Form, in short, known as BNF is a technique by which we can notify our Context Free Grammar (CFG). The CFG (or CFL for Context Free Language) is a formal grammar in which all the strings lying in that given language or Grammar can be derived using the standard rules and principles which are known as production rules.
简而言之, Backus-Naur形式称为BNF,是一种可以通知上下文无关语法(CFG)的技术。 CFG(或上下文无关语言的CFL)是一种正式的语法,其中可以使用称为生产规则的标准规则和原则来派生该给定语言或语法中的所有字符串。
In a computer system, BNF is used to define the layout of the information.
在计算机系统中, BNF用于定义信息的布局。
The syntax of any rule in the BNF is as follows:
BNF中任何规则的语法如下:
<SYMBOL> ::= <Expression1> | <Expression2> | ...
Here, the following points must be noted:
在此,必须注意以下几点:
The SYMBOL present in the LHS is always a non-terminal symbol.
LHS中存在的符号始终是非终端符号。
The sequence of symbols (or expressions): Expression1, Expression2, ... present on the RHS can either be a terminal symbol or a non-terminal symbol.
RHS上出现的符号(或表达式)符号的序列: Expression1 , Expression2 ,...可以是终端符号或非终端符号。
The sequence of symbols in the RHS can also contain only one symbol.
RHS中的符号序列也只能包含一个符号。
If there are more than one symbols present, then they are separated by the or sign- |.
如果存在多个符号,则它们之间用或符号- |分隔。 。
All these rules of the Grammar together are called the Production Rules.
所有这些语法规则统称为生产规则。
The symbols on the LHS and RHS are separated by the symbol ::= or :=.
LHS和RHS上的符号由符号:: =或:=分隔。
In the sequence of symbols on the RHS, we represent the symbols as follows:
在RHS上的符号序列中,我们将符号表示如下:
The optional Symbols are written in within square brackets.
可选符号写在方括号内。
The repeating symbols which can appear any number of times are followed by *.
可以出现多次的重复符号后跟* 。
The symbols which repeat for at least one time are followed by +.
重复至少一次的符号后跟+ 。
Group of items must always be enclosed within brackets.
项目组必须始终放在方括号内。
In Artificial Intelligence, the BNF is used for knowledge representation in the KB (Knowledge Base) of the agent. The words or strings can be derived from the raw data present in the agent's system by using this method.
在人工智能中 , BNF用于代理的KB(知识库)中的知识表示 。 可以使用此方法从座席系统中存在的原始数据派生单词或字符串。
Example of knowledge representation using the Backus-Naur Form:
使用Backus-Naur形式的知识表示示例:
In an agent who is designed to fix or automatically call the respective maintenance men when any sort of problem detected in household items, the information is present as follows:
在专门设计用于在生活用品中发现任何问题时修复或自动致电相应维修人员的代理中 ,信息如下:
<Problem> := Water Purifier | Television | Telephone | Washing Machine
<Water Purifier> := Manual | Phone Number
<Television> := Manual | Phone Number
<Telephone> := Manual | Phone Number
<Washing Machine> := Manual | Phone Number
<Manual> := Fix
<Phone Number> := Call
翻译自: https://www.includehelp.com/ml-ai/backus-naur-form-bnf-in-artificial-intelligence.aspx
backus-naur
更多推荐
所有评论(0)