Implika automated inference engine

  • 68 Replies
  • 13778 Views
*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Implika automated inference engine
« Reply #45 on: March 19, 2020, 09:09:07 pm »
Code
(
    ((man @x) (mortal @x)) (
        (man Socrates) (
            (man Plato) ()
        )
    )
)

It is a matter of transforming implicational logic to normal logic. `A -> ( B -> ( C -> D ) )` translates to `(A /\ B /\ C) -> D`, and `A`, `B`, and `C` are in the same context, and may interact between each other. We may use `D` as a dummy, or as something more meaningful.
« Last Edit: March 19, 2020, 10:06:40 pm by ivan.moony »

*

Zero

  • Eve
  • ***********
  • 1287
Re: Implika automated inference engine
« Reply #46 on: March 19, 2020, 09:14:52 pm »
In (a b), how would you call a and b? What are the official terms you choose? I can't choose between condition/context/rule, consequence/situation ...

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Implika automated inference engine
« Reply #47 on: March 19, 2020, 09:37:48 pm »
In (a b), how would you call a and b? What are the official terms you choose?

Nothing special, it's all about implications. I'd say `a` is a cause, while `b` is a consequence. Thus `a` implies `b`. But the real beauty is that we may use implication combinations to form data structures. For example, if we have a magical operator `+`, we may write the following function definition and its two use cases:

Code
(
    ( ( add ( left @x ) ( right @y ) ) ( @x + @y ) ) (
        ( add ( left 1 ) ( right 2 ) ) (
            ( add ( left 4 ) ( right 5 ) ) ()
        )
    )
)

The first meaningful line is the function definition. The second line results with `1 + 2`. The third results with `4 + 5`. Try to copy and paste this example into implika test suite and see what happens to `ForeChain` property. Remember, implika is a very simple variant of implicational logic, but we have just been doing math with it.

Thank you for reminding me of this project, I put it aside in a favor of super-duper-logic-able-doing-parser esperas. Nevertheless, I might finish implika one day, I'd still like to simplify different contexts parent-child interaction.
« Last Edit: March 19, 2020, 10:08:27 pm by ivan.moony »

*

Zero

  • Eve
  • ***********
  • 1287
Re: Implika automated inference engine
« Reply #48 on: March 19, 2020, 10:08:41 pm »
Yes I can see that it can represent data structures. Actually, I was working on an expansion of consnets, in OrientDB (see the other thread?) Trying to capture the essence of things, I came to a point where I introduced "truth" and "context" for handling first order logic. Implika popped up in my mind, I reread it, and found it would fit perfectly here.

First, I still need a way to make things move, I don't have rules in my system yet, and you know how much I love minimalism. But I also need to express contexts. I feel contexts is a very primitive concept.

You probably remember that consnet is all about pairs. Pairs is enough to create everything else. But then, there's a schema that comes again and again, which is [LinkType [Left Right]], so I thought that "type" was primitive enough to deserve its own existence. Then, following OpenCog, I wondered about truth and context, and the next step was to add wildcards too, because who doesn't like patterns, right?
:)

Now, with Implika, I think "truth" and "context" are actually the very same thing. Maria Keet says: What matters in logic is not the actual truth of a statement, but rather the relationship between the truth of one statement and that of another.

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Implika automated inference engine
« Reply #49 on: March 19, 2020, 10:21:07 pm »
Be careful if you use only implications, I'm still uncertain about them representing sequences. There was something wrong about it, but I forgot the solution. In logic, if we have `( ( ( A -> B ) -> C ) -> D )`, and if we say `C` in the top context, then from `C` follows `D` without even mentioning `A` and `B`. I don't know how to feel about this logical property, but it seems a nasty one.

About types, you can get away without special operator by demanding the whole expression to be tautology (it is said valid). If the top expression is `SomeA -> SomeB`, then if we consider it a tautology, then `SomeA` is of type `SomeB`. However, expressions constituting `SomeA` and `SomeB` may be only satisfiable, making a room for some needed acrobatics. The third case is contradiction treatment, which may be reported as an error, but they (Gödel) say that that kind of system is then not complete. For a while now, I don't believe them anymore. I suppose there may be multiple onion skin metalayers of which the above may be valid or satisfiable (in contrast to contradictory), while retaining ability to express lower system which may be contradictory if we want.

*

Zero

  • Eve
  • ***********
  • 1287
Re: Implika automated inference engine
« Reply #50 on: March 19, 2020, 10:33:41 pm »
Man, this baby needs a little love. To me, Implika might be one of your greatest works.

And what about backward chaining? Do you think it's possible to enhance it?

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Implika automated inference engine
« Reply #51 on: March 19, 2020, 10:55:30 pm »
I think if all logical operators could be expressed in implika, then `( ( A -> B ) /\ B ) -> A` simulates backward chaining without any special treatment. Try to paste the following example in implika test suite:

Code
(
    (
        ( @x -> @y ) (
            ( ( fore @x ) @y ) (
                ( ( back @y ) @x ) ()
            )
        )
    ) (
        ( rains -> wet ) ()
    )
)

After drawing conclusions, expression `rains -> wet` should in ForeChain property have forward and backward chained cause and consequence.

However, to extract correct results from `fore rains` and `back wet` some crazy stunts with contexts are required, which would be more easily solved with still unimplemented hierarchical contexts.

*

Zero

  • Eve
  • ***********
  • 1287
Re: Implika automated inference engine
« Reply #52 on: March 19, 2020, 11:43:53 pm »
Ok, so to avoid crazy stunts, would you need to expand the model? Or would it be more like changing the algo?

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Implika automated inference engine
« Reply #53 on: March 20, 2020, 12:10:47 am »
It would be an algo adjustment. No additional syntax, just a few loops rearrangements if I remember correctly (I was about to do this before something else attracted my attention). But I think I'd need at least a week to remember what I was doing and to plan things up before making the adjustments (not to inject bigger amounts of code than really needed - I want to keep it below 200 lines of Javascript).

As a motivation, I think we can expect example implementation of the entire Hilbert calculus in about 15-20 lines of more readable implika code instead of the current unnecessary mess among 47 lines.

*

Zero

  • Eve
  • ***********
  • 1287
Re: Implika automated inference engine
« Reply #54 on: March 20, 2020, 12:58:09 am »
I think it's worth it, especially if it is a building block of a bigger project like e-Teoria.

One interesting improvement could be the addition of a syntax for inline comments. I suggest "double quotes anywhere", or [square brackets], being ignored by the parser (together with a good-practice section explaining how to use them). Because since pairs can be conceptually anything, readability of Implika code is currently absolutely awful!!

You're the master of Implika, but while I'm at it, I find @var syntax not so pretty. May I suggest <var> or var? instead? Sorry, probably not my business...

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Implika automated inference engine
« Reply #55 on: March 20, 2020, 06:30:50 am »
You're the master of Implika, but while I'm at it, I find @var syntax not so pretty. May I suggest <var> or var? instead?

I have to admit, `<var>` looks much prettier to me too. I also kind of like capital letters denoting variables, while lower letters denoting constants.
« Last Edit: March 20, 2020, 07:17:14 am by ivan.moony »

*

Zero

  • Eve
  • ***********
  • 1287
Re: Implika automated inference engine
« Reply #56 on: March 20, 2020, 08:22:52 am »
Yes, I thought about Uppercase first letter too, à la Prolog.

About comments, having them between double quotes is unusual, but this is how Smalltalk does it for example. It seems reasonable to me. One way or another, I think comments are very important in a language, you should choose a syntax for them.

Code
( "one meaningful context"

    (("pattern" man <x>) ("template" mortal <x>)) (

        ("starting from" man Socrates) ()
    )
)

Another question. I would expect the state after inference-step to be represented in the same format. Currently, a ForeChain key is added, with the result as an array. This breaks the head/tail format. How do we represent the result of the inference in Implika syntax?
« Last Edit: March 20, 2020, 09:02:36 am by Zero »

*

krayvonk

  • Electric Dreamer
  • ****
  • 125
Re: Implika automated inference engine
« Reply #57 on: March 20, 2020, 09:02:27 am »
One funny thing I think about symbolic logic, is the "framework" thats running your system could just be more symbolic logic.  very confusing topic.
If anyone cracks how to do it really good,  it puts hairs on your chest.

I love that first picture,  why dont you put symbolic logic in a fractal!   Its like that thing I just said, the system running the system, or it would be like "10 people with 10 forks with 10 steaks with 10 blobs of ketchup with 10 little bits of parmesan cheese particles."  - couldnt go more micronicly setted than that in this case.

*

Zero

  • Eve
  • ***********
  • 1287

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: Implika automated inference engine
« Reply #59 on: March 20, 2020, 09:44:14 am »
About comments...

Well, there is already a way to state `(pattern @a) @a`, and later to use it as `pattern (man @x)`, just to increase verbosity. But general comments will certainly be taken under consideration.

I would expect the state after inference-step to be represented in the same format. Currently, a ForeChain key is added, with the result as an array. This breaks the head/tail format.

Sounds extraordinary. I should give it a try.

How do we represent the result of the inference in Implika syntax?

Nohow. Inference particles are just there in forechain to interact with other initial/forechain particles, making new forechain particles.

[EDIT]
continuing in the next post
« Last Edit: March 21, 2020, 07:47:06 am by ivan.moony »

 


Requirements for functional equivalence to conscious processing?
by DaltonG (General AI Discussion)
November 19, 2024, 11:56:05 am
Will LLMs ever learn what is ... is?
by HS (Future of AI)
November 10, 2024, 06:28:10 pm
Who's the AI?
by frankinstien (Future of AI)
November 04, 2024, 05:45:05 am
Project Acuitas
by WriterOfMinds (General Project Discussion)
October 27, 2024, 09:17:10 pm
Ai improving AI
by infurl (AI Programming)
October 19, 2024, 03:43:29 am
Atronach's Eye
by WriterOfMinds (Home Made Robots)
October 13, 2024, 09:52:42 pm
Running local AI models
by spydaz (AI Programming)
October 07, 2024, 09:00:53 am
Hi IM BAA---AAACK!!
by MagnusWootton (Home Made Robots)
September 16, 2024, 09:49:10 pm
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

258 Guests, 0 Users

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

Articles