Genifer as a programming language

19 views
Skip to first unread message

YKY (Yan King Yin, 甄景贤)

unread,
May 3, 2012, 12:25:04 AM5/3/12
to general-in...@googlegroups.com
[ I'll answer the other questions, but here is a technical problem that needs to be solved before using Genifer for real tasks... ]

I think we can integrate Genifer as a logic programming language with another industrial-grade (possibly functional) programming language.  Some candidates are Lisp, Scheme, Clojure, Haskell, ...etc.  (I'm also looking into SmallTalk and Squeak though they're OO rather than functional -- just for exploration).

The essence of a functional language is that it evaluates functions.

The Genifer logic programming language offers this:

1.  Composition of concepts returns a logical object.  For example,
       "linked ◦ lists"
       "recursive ◦ functions"
       "binary ◦ operator"
are objects.  Another way is to think about them as logic terms that are not yet propositions.

2.  In a Genifer program, a bare proposition is automatically added to the KB.  It can be a simple fact such as:
    "3 is an odd integer."
or an implication statement such as:
    "X is divisible by 2 <- X is even."

3.  A Genifer program can ask queries such as:
    "17 is even ?"
And also generalize from examples using inductive learning.

So, what I need is a way to integrate the logical and functional languages.

In Genifer's logic, there is no notion of functions, only composition.  But we can regard
       sine ◦ x
as the function application
      sin(x)
provided that "sin" is registered as a special atom, ie, that it is a function symbol. Then Genifer logic can emulate functions.

This provides the link to mix Genifer logic with functional programming.

Whether Genifer language is part of functional language, or the functional language is part of Genifer language, is unimportant -- what is important is the end result:  that Genifer logic can be mixed with functional programming.  It's just a question of whose parentheses are wrapping around whom, ie, mere syntax.

Now the question is, how to implement this extension of a functional language?  Which language / platform is easiest to do that?  ( Notice that Haskell's type system can be compatible with Genifer logic, as I explained before. )

Maybe we build a Genifer interpreter that accepts Genifer logic statements, but also accepts functional program constructs (ie, both function definitions and function calls).  Then Genifer interpreter can invoke the functional language to "eval" things, whenever it recognizes function symbols.

That seems very close to writing programs in English... =)

KY

Matt Mahoney

unread,
May 3, 2012, 1:52:24 AM5/3/12
to general-in...@googlegroups.com
I thought the goal was to answer questions in natural language. How
does this help? Are you proposing to hand code a Cyc-sized knowledge
base in Genifer-Haskell? Shouldn't we solve the induction and
knowledge acquisition problems before choosing a programming language?
--
-- Matt Mahoney, mattma...@gmail.com

YKY (Yan King Yin, 甄景贤)

unread,
May 3, 2012, 2:14:13 AM5/3/12
to general-in...@googlegroups.com
On Thu, May 3, 2012 at 1:52 PM, Matt Mahoney <mattma...@gmail.com> wrote:

I thought the goal was to answer questions in natural language. How
does this help? Are you proposing to hand code a Cyc-sized knowledge
base in Genifer-Haskell? Shouldn't we solve the induction and
knowledge acquisition problems before choosing a programming language?


Right, we should keep hand-crafting the KB to a minimum.  Perhaps I'd build a simple inductive learner, and then use it interactively to build the KB...

This will be a proof-of-concept.  The next stage is to do this massively, distributively, and efficiently... =)

KY

YKY (Yan King Yin, 甄景贤)

unread,
May 3, 2012, 2:58:19 AM5/3/12
to general-in...@googlegroups.com
PS:  After an English sentence is translated into Genifer logic form, it can be reasoned about using traditional logic algorithms such as deduction, unification, etc.  The translation may look superficial, but the logic engine makes it very powerful.

For example we can ask:
    "melancholy" =? "sad"
ie, is melancholy (roughly) synonymous to sadness?

Or:
   "quick-sort is a recursive function ?"
etc...

You can answer all these via some hacks or Google search, but NOT in a unified and integrated way.

KY
Reply all
Reply to author
Forward
0 new messages