Ai Dreams Forum

Member's Experiments & Projects => General Project Discussion => Topic started by: ivan.moony on January 04, 2021, 05:44:26 pm

Title: Exp-Log (a deductive system)
Post by: ivan.moony on January 04, 2021, 05:44:26 pm
Introduction to expression logic formal language

[Intended audience]
Beginners in language parsing, term rewriting, and logic deduction

[Short description]
Languages can be seen as streams of symbols used to carry on, process, and exchange informations. Expression logic is also a language, but it is a general kind of metalanguage capable of describing and hosting any other language. Expression logic is also able to perform any intermediate data processing upon recognizing hosted languages. Being a general kind of metalanguage, expression logic represents all of the following:
These descriptions render expression logic as a general solution verifier and problem solver, which seems to be a required minimum characteristic to process a wider range of formal languages.

[Project reference]
https://github.com/contrast-zone/exp-log (https://github.com/contrast-zone/exp-log)
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on January 19, 2021, 04:29:28 pm
Let's compare exp-log to a part of OpenCog.

Probably some of us heard of OpenCog. It is an expertimental symbolic AI development platform that exists since 2006. The famous robot Sophia (that one that got a citizenship of Saudi Arabia) is partially based on OpenCog. At the last, the platform of SingularityNet (that one that introduced AgiCoin digital currency) would be based on OpenCog too.

OpenCog is currently in a process of major restructuring, due to gaining experiences from the current work pros and cons. It won't be entirly different project with the same name and intention, except it would be a thorough upgrade with some seemingly neat ideas.

OpenCog is consisted of many parts, mostly programmed in some Lisp. In the heart of OpenCog there lays URE (unified rule engine) which is basically a deduction system capable of describing many deductive formalisms, and is based on natural deduction. OpenCog uses URE to support PLN (probability logic networks), a fuzzy version of logic conceived by dr. Ben Goertzel, the head of OpenCog team.

To finally draw a parallel to exp-log, exp-log represents an URE on steroids. To surpass the URE, besides deducing interesting facts, it also deals with mutable input/output syntax. Dealing with syntax, exp-log would be a perfect choice for constructing programming languages. And because I want to get some attention from a wider community, for now, I think I'll put a weight to supporting programming languages. Later, once I hopefully attract enough users, I may shift the attention to symbolic AI, which is why I started to develop this system in the first place.

Funny how things work out, if one does what he really likes, one can hardly get money or fame from it, but one gets a personal satisfaction of being really himself. The drawback is there will be no one to actually see it. Instead, to get some attention, one should make some considerable compromises in a direction of providing assets that a wider audience want to see. OpenCog did it with Sophia to get the fame, and then again with AgiCoin to get the money.

Now, I'm not interested in that scale of magnitude as long as money is concerned, but I could really use some attention (if the project happens to deserve such a thing) from at least a smaller part of audience. To do that, I'll try to introduce exp-log to programming languages compiler market, which is a piece of market that necessarily embraces only freeware and/or opensource languages. If things align with my plan, in the exp-log package, some more interesting use examples would find their place. Those would be examples of symbolic AI, just to heal my soul. Things like theorem proving and logical puzzle solving would finally be a part of a programming languages ecosystem I'm after in my quest.

Thus, I aim for symbolic AI introduction to a range of usual programmers, if you like, because all of it is not really a big deal to understand, at least not from a standpoint of usual programming, while it may be a very interesting asset to usual application development.
Title: Re: Exp-Log (a deductive system)
Post by: Zero on February 08, 2021, 08:01:01 pm
Hello my old friend :)

The web is a strange world. You can be something, while looking like something else.

Some projects have an awesome landing page, but are empty shells. Your project is the opposite: it is a high quality project, with the potential strength of a true world-class game changer, but... man, it looks like crap.

IMO, you need 2 things.

First is, a superman landing page. It is not enough to be amazing, you have to look amazing.

Second is, if exp-log can be used to create programming languages, go ahead and create a real one. People need a sample of what can be done with the product.

When I land on a page, first I look for a 'pricing' tab. If I find one, I fly away. Otherwise, I jump to the 'example' tab. And 2 minutes later, my opinion is made.
Title: Re: Exp-Log (a deductive system)
Post by: LOCKSUIT on February 09, 2021, 03:41:16 am
Hmm, Zero, good point. My new group will look like, hmm, I'm going to use Discord. Everything you see will certainly look incredible; what the text say, the videos, picture. The only thing missing might be that thing at the top that collect the flies, you know, the thing that is made of woombat-man material. But then again, others may think it's too kid like. Idk. But you're still right, it definitely has to look both sexy/ free/ simple/ advanced.
Title: Re: Exp-Log (a deductive system)
Post by: Zero on February 09, 2021, 04:29:29 am
A third thing would be a 'get started' tab, to help users.

And yes, a Discord could definitely be a 4th thing to add.  O0


edit: here is an example of good looking project
https://t3js.org/


edit: just wondering, since the EBNF of Exp-log is minimalist, maybe it could be used through Blockly (https://developers.google.com/blockly/)?

Quote
Blockly in a browser allows web pages to include a visual code editor for any of Blockly's five supported programming languages, or your own.
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on February 09, 2021, 11:14:11 am
Yes, there would be a number of enhancements to do on the site, once that the language is in working state. I still have to finish exp-log algorithm to get there. Right now it is merely a CFG-like parser with a lengthy to-do list, nothing more.

Blockly? Nice project, it caught my eye a while ago. I guess it is doable on higher levels, once that specific languages are defined. But the languages have to conform what Blockly expects them to look like.

Once, I was thinking about something similar to Blockly, but for BNF in general. It would be based on expression generator. Algorithm for generator is very similar to algorithm for parser. It would read an input, and offer all the expressions that could be a valid continuation of that input. Continuations would, in fact, be templates with placeholders to fill in. The placeholders could, again, be templates, and so on. Still, I'm not sure how would it behave on a superset of BNF, which exp-log tries to represent.

Projects like Blockly are great for beginners, to catch up with new languages. However, I'm worried that forcing such a thing would be a distraction for advanced users. I guess it is possible to blend such a thing with an editor, so it is optionally used by mouse, while leaving an option to ordinary type language elements by keyboard. Then that would be called... a projectional editor (https://en.wikipedia.org/wiki/Structure_editor)? Some guy on lambda-the-ultimate (http://lambda-the-ultimate.org/) site even had an idea for user defined specific graphical editors for specific kinds of expected input / function calls.

But I dunno anymore, maybe this whole editor thing is too big byte for me. One thing I know is that first things come first. I would like to try to finish the core language, then to see where the road leads me, hopefully to concentrate on deductive aspect of the language. There exist a vast of programming languages, while there exist only a good few of deductive systems. I would like to explore that direction.
Title: Re: Exp-Log (a deductive system)
Post by: Zero on February 10, 2021, 08:06:47 am
This sounds wise. I wish you the best on this project.

I follow your work for a long time now, and I know you're working in a very specific direction, with each new project being a new iteration of the previous one, with enhancements and different ideas. Do you think Exp-log could be the final stage you're looking for?
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on February 10, 2021, 06:36:16 pm
Do you think Exp-log could be the final stage you're looking for?

It may be. And it may be not. It can always be better. The question is how satisfied I am with the current version. I just hope I would not seek a hair in an egg anymore. The thing seems to work in theory, and I somehow like it enough to keep it. If I don't run into unsolvable problems, I believe I'm keeping the current version for good.
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on February 10, 2021, 09:26:03 pm
Finally a piece of code after a long time. For now, only top level bootstrap of expression logic to detect if the top level syntax is ok. The theoretical definition remained the same as before, although there is a new section [3.2.2.] explaining the oldish algorithm in a new guise (33 lines of pseudocode).

You can play with exp-log top-level syntax in online editor over here (https://contrast-zone.github.io/exp-log/test/). Initial example shows lambda calculus definition. Semantics is yet to be programmed.

 I know it's not much, but it makes me happy. After all, it has been more than a year under the theoretical hood since the last code update. Cheers!  :beer-fresh:
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on May 04, 2021, 08:58:03 pm
Finally made myself to convert my chart parser output into a decent abstract syntax tree. This wasn't such a trivial task as I thought it would be. I'm using my own general parsing technology, and this is the first time I got usable abstract syntax tree from the output chart. Yey, the parser works! :favicon:

The plan is to turn the parser into abduction based logic programming language, as there is a correspondence between abduction and extended parsing. Here (https://contrast-zone.github.io/exp-log/playground/) is a spoiler if anyone wants to take a look.
Title: Re: Exp-Log (a deductive system)
Post by: infurl on May 04, 2021, 11:07:10 pm
That's great progress Ivan. :)

Your next challenge will be to handle feature constraints. If you do it right, you will get semantic parsing for free.  8)
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on May 05, 2021, 09:29:13 am
Your next challenge will be to handle feature constraints. If you do it right, you will get semantic parsing for free.  8)

May I ask what are feature constraints?
Title: Re: Exp-Log (a deductive system)
Post by: infurl on May 05, 2021, 12:59:56 pm
May I ask what are feature constraints?

https://en.wikipedia.org/wiki/Feature_structure (https://en.wikipedia.org/wiki/Feature_structure)
http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/node79.html (http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/node79.html)

You may recall that I implemented a very powerful GLR parser and some years ago I wrote a much more advanced version which can associate grammatical features with syntax rules. The result is that not only can much more be expressed with much simpler rules, the resulting parse trees are endowed with all the necessary semantic information as well. It is a very elegant and efficient way to solve a complex problem and now I am able to parse a sentence in plain English directly into an executable program.
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on May 05, 2021, 03:26:08 pm
https://en.wikipedia.org/wiki/Feature_structure (https://en.wikipedia.org/wiki/Feature_structure)
http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/node79.html (http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/node79.html)

Wow, feature constraints are something new to me! It looks like a powerful and concise tool for building grammars.

As the language I'm building is a kind of Prolog packed in a special way, and Prolog may implement feature constraints on a level above Prolog kernel - in Prolog programming space, I hope I could do the same with Exp-Log. I'll certainly return to this subject at some point. Thanks for the links.

You may recall that I implemented a very powerful GLR parser and some years ago I wrote a much more advanced version which can associate grammatical features with syntax rules. The result is that not only can much more be expressed with much simpler rules, the resulting parse trees are endowed with all the necessary semantic information as well. It is a very elegant and efficient way to solve a complex problem and now I am able to parse a sentence in plain English directly into an executable program.


Executable program? Sounds like NLP programming language.
Title: Re: Exp-Log (a deductive system)
Post by: infurl on May 06, 2021, 02:27:54 am
Executable program? Sounds like NLP programming language.

Exactly. My software is a compiler for "The English Programming Language".
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on May 08, 2021, 11:34:13 am
Can feature constraints replace the need for variables?
Title: Re: Exp-Log (a deductive system)
Post by: infurl on May 08, 2021, 11:39:13 am
Can feature constraints replace the need for variables?

That depends on what you're using variables for. I'm certainly not using any variables for parsing.
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on May 08, 2021, 11:44:39 am
Can feature constraints replace the need for variables?

That depends on what you're using variables for. I'm certainly not using any variables for parsing.

For example, to calculate factorial or Fibonacci numbers (happens in recursion)?
Title: Re: Exp-Log (a deductive system)
Post by: infurl on May 08, 2021, 11:50:19 am
It sounds to me like you're searching for The One True Hammer(tm) when you should just be using the best tool for any given job.
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on May 08, 2021, 12:17:03 pm
Yeah, the mother of all the hammers sounds just about right!  ;D
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on May 11, 2021, 04:33:37 pm
I tidied up the parser output a bit and introduced `expected: ... at position ...` type of syntax error messages. Syntax will loose a clear distinction from semantics in later project phases, when the parser will be able to detect i.e. if a variable is declared before assignment using only exp-log patterns.
Title: Re: Exp-Log (a deductive system)
Post by: ivan.moony on June 10, 2021, 01:34:43 pm
Current project status:
Still working on logical programming language for describing other formal languages, based on extension of original parsing technology. Anytime soon, there will be completely functional general CFG parser which then has to be extended in two steps, first to be Turing complete, then to include appropriate logical operators (I observe productions as implications).

Last insights about program synthesis:
It should be possible to send arbitrary input and output pairs along the lambda calculus definition. From just that, the system could construct a set of possible specific lambda functions that turn provided inputs to provided outputs. If instead of lambda calculus we provide a definition of some other language, other kinds of source code may be synthesized. I'm still wondering about troubles with speed that may pop up, mostly around recursive functions. Anyway, simply typed LC should work well if I'm not mistaken.

Last insights about AI:
The same procedure for program synthesis should work as a replacement for what artificial neural networks provide. NNs are trained by pairing inputs to outputs, and in between, neuron set does all the future magic of firing outputs upon recognized inputs. With completely formalizing a Turing complete environment, instead of general neuron set, we may put 100% accurate synthesized pieces of code. Although the general idea should work, I'm afraid that details about AI would be pretty tricky to grasp.

What competition has to show on this subject:
Here is interesting video about business use - very insightful - https://www.microsoft.com/en-us/research/group/prose/ (https://www.microsoft.com/en-us/research/group/prose/)