Home » Machine Learning/Artificial Intelligence

Backus-Naur Form (BNF) in Artificial Intelligence

In this article, we are going to study what Backus-Naur Form is and how is it related to Artificial Intelligence? We will study the BNF in detail and will also study the rules and principles that are used while using this form.
Submitted by Monika Sharma, on June 06, 2019

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.

In a computer system, BNF is used to define the layout of the information.

The syntax of any rule in the BNF is as follows:

    <SYMBOL> ::= <Expression1> | <Expression2> | ...

Here, the following points must be noted:

  • The SYMBOL present in the LHS is always a non-terminal symbol.
  • The sequence of symbols (or expressions): Expression1, Expression2, ... present on the RHS can either be a terminal symbol or a non-terminal symbol.
  • The sequence of symbols in the RHS can also contain only one symbol.
  • 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 :=.

In the sequence of symbols on the RHS, we represent the symbols as follows:

  • 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.

Example of knowledge representation using the Backus-Naur Form:

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





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.