Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
Function-argument vs. Subject-predicate syntax, redux

By Edmund Blackadder in Edmund Blackadder's Diary
Mon Jan 05, 2015 at 12:55:10 AM EST
Tags: functional style, subject-predicate, aRb, R(a, b), impedance mismatch, logicagent, math agent, louvain1.2, paradigms of programming (all tags)

Cross-posted from the Louv1.2x discussion forum:

Revisiting an argument I made in this thread, in which I expressed a preference for natural language syntax (subject-predicate, or aRb) over function-argument (or R(a,b)):


I came across a paper by Torbjorn Lager (from 2005): "Multi-Paradigm Programming in Oz for Natural Language Processing". Slide 41 shows how "John smiles", in natural language subject-predicate syntax, is converted into function-argument form: smiles(j).

My question is, why? Why convert subject-predicate into function-argument, then back again when you want to communicate with a reader? It seems that converting back and forth between subject-predicate and function-argument creates an impedance mismatch, adding needless complexity.

An example of the extra steps needed is demonstrated by the Math agent presented in Lesson 6. We start with a subject-predicate form in our heads: one plus one. We convert that into function-argument form: add(1 1 Ans). Then in the definition of add(N M A), we use aRb form again: A=N+M. Why did we have to go through the step of converting N+M=A to add(N M A)?

Farther on in Lager's paper, in slides 83 and 84, an inference process is displayed. John is inferred to be happy, since he is a man who whistles, and every man who whistles is happy. But the inference procedure has to translate the subject-predicate syntax of the natural language sentences into function-argument form. Why? What do we gain by such translations?

In contrast, my logicagent can do a similar inference using natural language syntax:


> Every man who whistles is happy.
> John is a man who whistles.
> Every man who whistles includes a man who whistles.
> Is John happy?
Yes, John is happy.

>Why is John happy?
John is happy because: john is a man who whistles, and a man who whistles is a member of every man who whistles, and every man who whistles is happy.

The idea being: we should embrace subject-predicate syntax, especially when dealing with natural language processing.

---

I started following the second part of this MOOC, without having taken the first part which introduced the Oz research language. I was able to pick up the language enough to do most of the programming assignments.

I'm trying now to make the logicagent handle the separate statements "John whistles" and "John is a man", inferring "John is a man who whistles" from them. I see how to do it; it involves some busy work, pulling information out of hashes, doing some permutations, etc. The idea is: I have a graph with "John whistles" and "John is a man"; then I dynamically build "John is a man who whistles" from those two statements, and use that on-the-fly construction to connect to "happy" through "Every man who whistles is happy".

The hidden inductive step, concealed by first-order logic's quantifiers, is "Every man = a man". You are assuming that if you have a man, he will be like every man you've seen so far. Thus, deduction contains induction. You might be able to get away with it in a rigidly formal language, but in natural language "a man who whistles" doesn't have to be like "every man who whistles."

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Related Links
o Louv1.2x
o this thread
o paper
o Slide 41
o Math agent
o slides 83 and 84
o logicagent
o similar inference
o Edmund Blackadder's Diary


Display: Sort:
Function-argument vs. Subject-predicate syntax, redux | 8 comments (8 topical, editorial, 0 hidden)
I blame Frege. (none / 1) (#2)
by Edmund Blackadder on Mon Jan 05, 2015 at 02:55:52 AM EST

See http://www.kuro5hin.org/story/2007/3/3/193342/5534 for example.

The programming language I want to make is English. Synonyms are very important, so I try to make my system easily extensible with new commands and syntax. Since context-sensitive languages (such as English) are a superset of context-free languages (such as math and programming languages, mostly), you can always choose to stick with function-argument syntax.

---
MAY I SUCK YOUR PENIS? - Nimey
Hi! I fail at basic sig technology! En plus, je suis pédé! - smegko

Update: (none / 1) (#9)
by Edmund Blackadder on Tue Jan 06, 2015 at 10:45:10 PM EST

http://subbot.org/edx/louvain1.2/logicagent_is_np_np_who_vp.png

So I got the first step, inferring "John is a man who whistles" from "John is a man" and "John whistles."

But it's very brittle.

What I really need is a regex such that I can do:

input =~ Is NP NP who VP

and the first NP would match "John" or "John Smith" or "John the guy over there" or whatever.

Then the second NP would match "a man".

The way I'm doing it now is assuming that the first NP will be one word. Very, very brittle!

---
MAY I SUCK YOUR PENIS? - Nimey
Hi! I fail at basic sig technology! En plus, je suis pédé! - smegko

Function-argument vs. Subject-predicate syntax, redux | 8 comments (8 topical, 0 editorial, 0 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest © 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!