Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Interpretation  





2 Software paradigm  





3 Publication value of natural-language programs and documents  





4 Contribution of natural-language programs to machine knowledge  





5 AI in Natural Language Programming  





6 See also  





7 References  





8 Bibliography  





9 External links  














Natural-language programming






العربية
Српски / srpski

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Natural-language programming (NLP) is an ontology-assisted way of programming in terms of natural-language sentences, e.g. English.[1] A structured document with Content, sections and subsections for explanations of sentences forms a NLP document, which is actually a computer program. Natural language programming is not to be mixed up with natural language interfacing or voice control where a program is first written and then communicated with through natural language using an interface added on. In NLP the functionality of a program is organised only for the definition of the meaning of sentences. For instance, NLP can be used to represent all the knowledge of an autonomous robot. Having done so, its tasks can be scripted by its users so that the robot can execute them autonomously while keeping to prescribed rules of behaviour as determined by the robot's user. Such robots are called transparent robots [2] as their reasoning is transparent to users and this develops trust in robots. Natural language use and natural-language user interfaces include Inform 7, a natural programming language for making interactive fiction, Shakespeare, an esoteric natural programming language in the style of the plays of William Shakespeare, and Wolfram Alpha, a computational knowledge engine, using natural-language input.[citation needed] Some methods for program synthesis are based on natural-language programming.[3]

Interpretation[edit]

The smallest unit of statement in NLP is a sentence. Each sentence is stated in terms of concepts from the underlying ontology, attributes in that ontology and named objects in capital letters. In an NLP text every sentence unambiguously compiles into a procedure call in the underlying high-level programming language such as MATLAB, Octave, SciLab, Python, etc.

Symbolic languages such as Wolfram Language are capable of interpreted processing of queries by sentences. This can allow interactive requests such as that implemented in Wolfram Alpha.[4][5] The difference between these and NLP is that the latter builds up a single program or a library of routines that are programmed through natural language sentences using an ontology that defines the available data structures in a high level programming language.

An example text from an English language natural-language program is as follows:

If U_ is 'smc01-control', then do the following. Define surface weights Alpha as "[0.5, 0.5]". Initialise matrix Phi as a 'unit matrix'. Define J as the 'inertia matrix' of Spc01. Compute matrix J2 as the inverse of J. Compute position velocity error Ve and angular velocity error Oe from dynamical state X, guidance reference Xnow. Define the joint sliding surface G2 from the position velocity error Ve and angular velocity error Oe using the surface weights Alpha. Compute the smoothed sign function SG2 from the joint sliding surface G2 with sign threshold 0.01. Compute special dynamical force F from dynamical state X and surface weights Alpha. Compute control torque T and control force U from matrix J2, surface weights Alpha, special dynamical force F, smoothed sign function SG2. Finish conditional actions.

that defines a feedback control scheme using a sliding mode control method.

Software paradigm[edit]

Natural-language programming is a top-down method of writing software. Its stages are as follows:

Publication value of natural-language programs and documents[edit]

A natural-language program is a precise formal description of some procedure that its author created. It is human readable and it can also be read by a suitable software agent. For example, a web page in an NLP format can be read by a software personal assistant agent to a person and she or he can ask the agent to execute some sentences, i.e. carry out some task or answer a question. There is a reader agent available for English interpretation of HTML based NLP documents that a person can run on her personal computer .

Contribution of natural-language programs to machine knowledge[edit]

An ontology class is a natural-language program that is not a concept in the sense as humans use concepts. Concepts in an NLP are examples (samples) of generic human concepts. Each sentence in a natural-language program is either (1) stating a relationship in a world model or (2) carries out an action in the environment or (3) carries out a computational procedure or (4) invokes an answering mechanism in response to a question.

A set of NLP sentences, with associated ontology defined, can also be used as a pseudo code that does not provide the details in any underlying high level programming language. In such an application the sentences used become high level abstractions (conceptualisations) of computing procedures that are computer language and machine independent.

AI in Natural Language Programming[edit]

Researchers have started to experiment with natural language programming environments that use plain language prompts and then use AI (specifically large language models) to turn natural language into formal code. For example Spatial Pixel created an natural language programming environment to turn natural language into P5.js code through OpenAI's API. In 2021 OpenAI developed a natural language programming environment for their programming large language model called Codex.

See also[edit]

Programming languages with English-like syntax

References[edit]

  1. ^ Miller, L. A. (1981). "Natural language programming: Styles, strategies, and contrasts". IBM Systems Journal. 20 (2): 184–215. doi:10.1147/sj.202.0184.
  • ^ Development of reliable and trustworthy robots. "transparent robots" }
  • ^ Desai, Aditya, et al. "Program synthesis using natural language." Proceedings of the 38th International Conference on Software Engineering. ACM, 2016.
  • ^ Wolfram Alpha – how it works (part 2) Computer Weekly, 4 June 2009
  • ^ Wolfram Alpha computes answers Tech Crunch, 8 March 2009
  • Bibliography[edit]

    Books
    Papers at conferences
    Program synthesis from natural language specifications

    External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Natural-language_programming&oldid=1227946996"

    Categories: 
    Algorithm description languages
    Structured English
    Computer programming
    Natural language processing
    Hidden categories: 
    Articles with short description
    Short description matches Wikidata
    Use dmy dates from July 2015
    Articles lacking in-text citations from December 2014
    All articles lacking in-text citations
    Articles that may contain original research from December 2014
    All articles that may contain original research
    Wikipedia articles in need of updating from April 2023
    All Wikipedia articles in need of updating
    Articles with multiple maintenance issues
    All articles with unsourced statements
    Articles with unsourced statements from November 2018
     



    This page was last edited on 8 June 2024, at 17:07 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki