Skip to content

google/english--

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This is not an officially supported Google product

english-- is an experimental logic-oriented programming language based on a controlled subset of english.

The investigation started as an exploration on what it would take to make https://schema.org/'s Action more expressive and then took a life of its own.

The compiler takes a controlled subset of the english language and compiles to a lower level logic language. The interpretation of the language is largely inspired by what's described in Hans Kamp's DRT.

You can see a live demo running in the browser here, a larger example here and small examples here. You can see the parser running live here. There is a demo of the low-level language here and here.

There are still many open areas of investigations, most notably generalized quantifiers and propositional attitudes (e.g. beliefs).

english-- is a programming language, which makes it strict but formally precise, rather than flexible and ambiguous. If you are looking for latter, you'll likely be extremely disappointed, and are better off using an LLM instead.

By far, the most notable investigation dates all the way back to Aristotelian Sillogisms, which was followed by Boole's Laws of Thought as well as the more recent branch of Analytical Philosophy explored by Frege, Russel and Whitehead. In Computer Science, Fuchs's Attempto and Knuth's Literate Programming can be thought of working on a related space. Other notable attempts are Peter Norvig's A Grammar of English and the ERG, although it wasn't clear if their intent was to create a programming language (rather than a user-facing dialog system).

For example:

Every person who is brazilian is happy about Brazil. Sam is brazilian. Sam is a person.
Sam is an engineer. He works at Google on the Web Platform.
He is interested in Compilers.
He likes every area of Computer Science.

Is Sam happy about Brazil?

Compiles to:

// Every person who is brazilian is happy about Brazil.
Brazil(a).
for (let every b: person(b) brazilian(b)) {
  happy(b).
  happy-about(b, a).
}

// Sam is brazilian.
Sam(c).
brazilian(c).

// Sam is a person.
person(c).

// Sam is an engineer.
engineer(c).

// He works at Google on the Web Platform.
Web-Platform(d).
Google(e).
work-on(s0, d).
work-at(s0, e).
work(s0, c).

// He is interested in Compilers.
Compilers(f).
interest-in(s1, f).
interest(s1, g, e).

// He likes every area of Computer Science.
Computer-Science(h).
for (let every i: area(i) area-of(i, h)) {
  like(s2, h, i).
}

// Is Sam happy about Brazil?
happy(c) happy-about(c, a)?

Which gets interpreted by a logic reasoner as Yes.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published