An execution model inspired from thought stacks

  • 4 Replies
  • 2144 Views
*

Zero

  • Eve
  • ***********
  • 1287
An execution model inspired from thought stacks
« on: September 07, 2018, 10:42:04 am »
I think it's not a new programming paradigm, because this term encompass a lot of things. But it's an interesting execution model.

You probably know stack based languages, like Forth, Factor, Joy. Basically, you push operands on a data stack, then you push an operator which pops operands and pushes the result of the operation.

You also know how thoughts work. They work a bit like a stack. What you're thinking is on top of the stack. If that raises a problem, the problem get pushed on top of your thought stack, until it is solved. The solution is then left on the stack with the previous thoughts, and you can "resume" your prior thinking activities.

What gets pushed on the thought stack depends on what is already on the top. So a basic way to emulate a similar mechanism would be to use pattern matching to decide what to push.

Classical stack-based languages let you create a program; during execution, elements of the program are pushed one by one on the data stack. Here we do something different. We set up a rule engine, like those we use in chatbots, to match the top of the data stack against rules. When a rule fires, it pushes stuff on the data stack.

It's like saying "when the top of the data stack looks like this, push that on the data stack".

Here is an example.

data-stack:
    one two foo 4 3 +

rules:
    # # +    = <built-in sum>
    # # -    = <built-in sub>
    # baz    = baz was 1 #1 -
    # foo #  = bar between #1 and #2 baz

execution trace:
    one two foo 4 3 +
    one two foo 7
    one bar between two and 7 baz
    one bar between two and baz was 1 7 -
    one bar between two and baz was 6


I'm wondering whether I should include this in Airbender, or start fresh on another project, maybe in golang.

*

ranch vermin

  • Not much time left.
  • Terminator
  • *********
  • 947
  • Its nearly time!
Re: An execution model inspired from thought stacks
« Reply #1 on: September 08, 2018, 09:31:07 am »
I think you have to make them multidimensional,  so it has options when it pulls off a leaf.

Coincidentally, I love stacks too.  I know how to make a single number stack with algebra/complex sums.
I actually thought about this alot,  and if you put a video into a stack,  it comes back out playing backwards.

I bet you could get markov chains and palindromes to work in a stack.

 O0

*

Zero

  • Eve
  • ***********
  • 1287
Re: An execution model inspired from thought stacks
« Reply #2 on: September 17, 2018, 03:31:30 pm »
What do you mean, "multidimensional"?
Sounds cool. :)

*

ranch vermin

  • Not much time left.
  • Terminator
  • *********
  • 947
  • Its nearly time!
Re: An execution model inspired from thought stacks
« Reply #3 on: September 17, 2018, 05:23:10 pm »
idea just simple one, but it backfired when i wasnt getting infinite memory from nothing  :idiot2:, a normal stack is 1d, u only push/pop the next item,  i mean just you get options each new pop/push whatever, so you have multiple stacks to pick from.

*

Zero

  • Eve
  • ***********
  • 1287
Re: An execution model inspired from thought stacks
« Reply #4 on: September 17, 2018, 08:40:35 pm »
Reminds me of Push3, which has one data stack per data type. This one is for genetic evolution of programs. Pretty cool.

 


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

317 Guests, 0 Users

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

Articles