AiDL language draft

  • 29 Replies
  • 13422 Views
*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #15 on: January 22, 2018, 10:56:55 pm »
Yeah, cool idea. Thanks  :)

AiDL parsers will be implemented using PEGjs. They use Parsing Expression Grammar formalism, which is close to EBNF. There's a tool called GrammKit that can generate railroads directly from PEGjs, so that's probably what I'd use.

About converting BNF to EBNF, isn't it possible to detect recursion and replace it with " * " or " + " operators? And anyway, isn't EBNF a superset of BNF, semantically?

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: AiDL language draft
« Reply #16 on: January 23, 2018, 12:10:45 am »
AiDL parsers will be implemented using PEGjs. They use Parsing Expression Grammar formalism, which is close to EBNF. There's a tool called GrammKit that can generate railroads directly from PEGjs, so that's probably what I'd use.

Yeah, PEG.js is faaaaaaaaaaaaaaaaaaassssssssssssssssttttttttttttttt :)

About converting BNF to EBNF, isn't it possible to detect recursion and replace it with " * " or " + " operators? And anyway, isn't EBNF a superset of BNF, semantically?

It seems that converting recursions is not such a trivial task (on a first look). There are left, middle and right recursions. There are also nested kinds recursions, and then we may branch over multiple recursions inside a single rule. Moreover, a conditional branching may be added too. All of this looks discouraging, while I don't want to give up of simplicity of BNF (I want to use the least possible number of primitive operators - more about this soon).

Of course, one could write BNF in EBNF, but in that case, mentioned tools would not give a meaningful result, I think railroad looping essence is in a use of `+`, `*` and `?`. Otherwise, they use references that look like everything but a railroad to me.

[Edit]
Just slipped my mind, references could have a little [+/-] beside, just to [expand / contract] their content. That could make a hell of a structural code editor, if combined with railroads... But what about the loops? Huh...

[New edit]
With some proper `null` treatment, I guess it could work, I think I'll give it a try when the time comes.
« Last Edit: January 23, 2018, 09:59:11 am by ivan.moony »

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #17 on: January 23, 2018, 09:45:15 am »
Ok, harder than I thought.

The simplest form of syntax description would be a multiset of couples... when the left hand appears several times, it means "or". Am I wrong?

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: AiDL language draft
« Reply #18 on: January 23, 2018, 10:09:22 am »
If I understood the question, you are right about `or`.

If you skim over context free grammar (CFG) definition, from which is BNF derived, you'll notice that there are only these kind of productions: `A -> B C D ...`, and repeating the same left side `A` makes an `or` set. This follows from a logic operator of consequence `->` where from:
A -> B
C -> D
follows:
(A or B) -> (C and D)

That is how the logic field works. Left sides are `or`-ed and right sides are `and`-ed. Repeating the same letter multiple times over multiple lines on the left or on the right sides makes wonders.

Make a notice that CFG productions draw arrows in the opposite direction than logic. What is in CFG written as
A -> B C D
should in logic be written as
B C D -> A
or more readable
A <- B C D

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #19 on: January 23, 2018, 02:38:38 pm »
Quote
A -> B
C -> D
follows:
(A or B) -> (C and D)
If there's no typo in this quote, then I don't get it. How could (A or B) be related to (C and D), since there's no link between "A -> B" and "C -> D"?

Your notice about CFG and logic is exciting. Could they be expressed and manipulated uniformly? Do they both belong to the same superset?

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: AiDL language draft
« Reply #20 on: January 23, 2018, 04:09:01 pm »
Quote
A -> B
C -> D
follows:
(A or B) -> (C and D)
If there's no typo in this quote, then I don't get it. How could (A or B) be related to (C and D), since there's no link between "A -> B" and "C -> D"?

Sorry, it was a typo. I meant: (A or C) -> (B and D). But I overcalculated myself, sorry again, this statement is also false.

What I really meant (I hope I wrote it right now) was this:
A -> B
A -> C
consequences with:
A -> (B and C)

and other way around:
B -> A
C -> A
consequences with:
(B or C) -> A

This much is logical to me, and it is a kind of a common sense, if you think about it. I derived it a while ago, by connecting the pairs of formulas by `and` and doing a bit of classical logic inference by resolution method and rules:
(A -> B) <-> (¬A or B)
((A and B) or C ) <-> ((A or C) and (B or C))
((A or B) and C) <-> ((A and C) or (B and C))
¬(A and B) <-> (¬A or ¬B)
¬(A or B) <-> (¬A and ¬B)

Your notice about CFG and logic is exciting. Could they be expressed and manipulated uniformly? Do they both belong to the same superset?
It seems, for now, that logic alone is not suitable for processing streams of data, while it is good for isolated stream (sequence) elements. There has to be some sequence operator extension to logic. Maybe in a form of predicates, but then each predicate parameter (as a sequence element) should implement its little sub-logic connected to the above for references and recursion. Very inspiring question. And very good scientific paper could be extracted from CFG - Logic analogy. Proving a contradiction in a grammar would mean that the grammar would never parse anything (it would always report an error upon parsing), and could be considered as an error in grammar.
« Last Edit: January 23, 2018, 06:56:45 pm by ivan.moony »

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #21 on: January 24, 2018, 09:50:49 am »
Quote
What I really meant (I hope I wrote it right now) was this:
A -> B
A -> C
consequences with:
A -> (B and C)

and other way around:
B -> A
C -> A
consequences with:
(B or C) -> A
Thank you, I understand now.

About the CFG - Logic analogy, I'm far from mastering these subjects. But CFG seem to "shrink" data (when used as parser), while logic inference rules seem to "expand" data. So maybe what CFG can do in one direction, logic can do in the opposite direction?

About AiDL, I'm splitting what was functions in two distinct tools: verbs and functions.

Verbs use the Tcl-like syntax. The results of all statements of  a verb are collected during execution, and returned as an "evolution" (a new data type). Verbs can have side-effects.

Functions can't have side-effect, and use a mathematical (classical) syntax, more like a spreadsheet formula's syntax.

ED:

I'm a moron. If verbs return an "evolution", how can I replace square brackets by the result of the code inside them. Stupid me. So... Back to normal: verbs return the value of their last statement.
« Last Edit: January 24, 2018, 11:27:28 pm by Zero »

*

LOCKSUIT

  • Emerged from nothing
  • Trusty Member
  • *******************
  • Prometheus
  • *
  • 4659
  • First it wiggles, then it is rewarded.
    • Main Project Thread
Re: AiDL language draft
« Reply #22 on: January 24, 2018, 10:22:18 pm »
Zero.........what is this thread all about ???????? I have a hint but...   Is it about creating an AI that learns/uses language?

Zero/Ranch, when you bring up "else it's parrot-like", are you talking about a hierarchical knowledge tree made up of neural layers that connect letters to words and then words to sentences in higher layers "meanings" and hence their relations defined by connections? And that when you talk to it and fill it up with human English language, it says the same stuff, even exactly, out of its mouth? I know how to fix that.
Emergent          https://openai.com/blog/

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #23 on: January 25, 2018, 09:04:41 am »
How would you know "how to fix that", if you don't know what this thread is about?  ;)

This thread is about a new programming language named AiDL, which:
- is inspired from Tcl and Io,
- is based on previous works on the pub/sub pattern,
- features a "meaning" type to handle semantic data,
- allows deep metaprogramming,
- targets modern browsers as a platform.

ED: Added links to Tcl and Io.
« Last Edit: January 25, 2018, 09:38:18 am by Zero »

*

LOCKSUIT

  • Emerged from nothing
  • Trusty Member
  • *******************
  • Prometheus
  • *
  • 4659
  • First it wiggles, then it is rewarded.
    • Main Project Thread
Re: AiDL language draft
« Reply #24 on: January 25, 2018, 06:37:36 pm »
Basically, by parrot-talk, I mean, we input into the ANN, and the output is well, the same! No good! It's a parrot! Is this your problem?
Emergent          https://openai.com/blog/

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #25 on: January 25, 2018, 09:34:11 pm »
Thank you LOCKSUIT. There's no neural net here, and no problem to solve. Ranch was "generally speaking".

*

LOCKSUIT

  • Emerged from nothing
  • Trusty Member
  • *******************
  • Prometheus
  • *
  • 4659
  • First it wiggles, then it is rewarded.
    • Main Project Thread
Re: AiDL language draft
« Reply #26 on: January 26, 2018, 04:01:26 am »
Quote
You're right, you can't hardcode everything because there's too much. But I think it's possible to reach some kind of top-down "critical mass", and BOOM. Like the Terminator.

Sensing can be tricky, yes: we need specific perception/interpretation devices or subsystems whatever you wanna call them. It can't be high-level. When your eyes meet a face, you just see a face. The mechanism that makes the "face construct" pop in your mind isn't conscious at all.



about an automatic sensor to fill it up->  if your putting tonnes of english with some kind of natural language processor that goes into the symbolic system, they tend to be parrotlike and take it in no matter how nonsensical it is,  a machine has no judgement of good reading matter unless u give it to it, and it would be tricky.

even people dont know what to believe,  its actually a fundamental problem with intelligence in general,  let alone parrotlike data collecting.

I guess it must take in the information,  but maybe you put a scope difference between "different opinions", and it takes them all in...  then a machine has a bit of a personality problem, doesnt know who to be. :)

Im not saying these symbolic structures dont work tho,  I think they do just as much as pattern recognition stuff does.  (see Yann Lecun's amazing works) its all assignment after all. (=) in both techniques.

Q1) It seems from the above that this incorporates AI, senses, and actions?
Q2) Why AiDL and not C++? If it comes with T5000 then I get why.
Emergent          https://openai.com/blog/

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #27 on: January 26, 2018, 08:54:54 am »
Thanks for your questions.

Q1. Indeed, it's a global project.
Q2. Because you can't express everything easily in C++. I want a unified high-level language, that's able to define everything above senses: abstract concepts and their instances, behaviors, relations. And I want an engine that can run the whole 'mind' of a thinkbot, in a browser. That's why I'm creating AiDL.
ED: I know that most AI hobbyists believe that the key to success lies in learning techniques. I don't think so. I think we need to build an ontology of self, an ontology of the AI's own 'mind', and then use it to interpret and understand the various data produced by its 'internal sensors'. Then, establish a communication with the AI, through a controlled natural language, and teach it how to develop itself, until it starts enhancing itself by itself.
« Last Edit: January 26, 2018, 09:42:35 am by Zero »

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #28 on: January 26, 2018, 03:48:21 pm »
Code
set Hand [ object {
    <body-part>fingers: 5,
    <state>holds: nothing,
    <action>grab: verb {
        if (holds==nothing) {
            set holds [argument];
        };
    },
    <action>write: verb {
        if (holds==pencil) {
            Console log "Writing [argument]";
        };
    },
    <action>drop: verb {
        set holds nothing;
    }
}];

set Human [ object {
    <body-part>head: object {
        <action>say: verb {
            console log "Saying [argument]";
        }
    },
    <body-part>left-hand: [Hand clone],
    <body-part>right-hand: [Hand clone]
}];

set John [Human clone];

John right-hand grab pencil, write "Hello world";

This is a taste of AiDL, as it is today. Like Io, it works by message-passing. Like Tcl, code between square brackets is evaluated, and square brackets are replaced by the result of the evaluation.
- In the last line, we send the message right-hand grab pencil, write "Hello world"; to John.
- Then John sends grab pencil, write "Hello world"; to its right-hand slot.
- Then John's right-hand calls its grab method with pencil as argument.
- Then John's right-hand calls its write method with "Hello world" as argument.

*

Zero

  • Eve
  • ***********
  • 1287
Re: AiDL language draft
« Reply #29 on: January 29, 2018, 08:35:40 am »
I was wondering what interface should I propose for AiDL. It has to be neutral, give developers freedom to do whatever they want with their page... Then I remembered Amber, a Smalltalk environment in the browser. The cool thing here is what happens when you click the big green button "Try Amber in your browser!". A panel shows up at the bottom of the page, just like the developer's tool every browser would show when you hit CTRL+SHIT+I. This might be a nice solution for AiDL.

ED: Probably with Golden Layout because, let's face it, it's awesome isn't it?
« Last Edit: January 29, 2018, 01:40:25 pm by Zero »

 


LLaMA2 Meta's chatbot released
by spydaz (AI News )
August 24, 2024, 02:58:36 pm
ollama and llama3
by spydaz (AI News )
August 24, 2024, 02:55:13 pm
AI controlled F-16, for real!
by frankinstien (AI News )
June 15, 2024, 05:40:28 am
Open AI GPT-4o - audio, vision, text combined reasoning
by MikeB (AI News )
May 14, 2024, 05:46:48 am
OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 31, 2024, 01:00:53 pm
Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am

Users Online

388 Guests, 0 Users

Most Online Today: 447. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles