More on partial evaluation - How does partial evaluation work and why is it important?

in #tauchain7 years ago (edited)

I have been asked the question about what partial evaluation is. Partial evaluation is one of the core components behind the Tau Meta Language. In order to understand Tauchain and TML we have to do a little digging to understand not just partial evaluation but in specific the partial fixed point logic.

Self interpretation and self definition are the core of what makes Tauchain unique, and no other crypto or really any technology outside of academia will have that. Partial fixed point logic will be discussed in this blog post along with Futamura's paper on partial evalulation.

Partial Evaluation of Computation Process--An Approach to a Compiler-Compiler

Futamura's paper discusses partial evaluation as an approach to a compiler compiler. A compiler as many programmers know, is a lot like a translator. A compiler translates "source code" written in a high level formal language into "machine code" which is a lower level language. This translation process is what allows human "programmers" to communicate in a language which the machine can understand without having to speak directly in the machine code at the lowest level. With this in mind we can now understand that a compiler-compiler allows humans to describe, define, and compile a compiler, in essence allowing humans to create new programming languages.

Partial evaluation is a means of building a compiler compiler allowing this. A partial evaluation of a computation is based upon taking the formal description of the semantics of a programming language which is known as an "interpreter", allowing for description of the "evaluation procedure" which is the interpreter, to be used for defining the semantics of a programming language. So to simplify it down, the interpreter allows the advanced users of TML to define the semantics also known as the "meaning" of a programming language. This gives the user of TML a lot of flexibility, to in essence define their own programming language and then compile it (compiler-compiler). A meta compiler is what the paper describes as the ability to compile a particular language, where the partial evaluation process is where the meaning behind the semantics is defined.

A programming language is both syntax and semantics. So for future reference, after parsing is complete (syntax analysis) the meaning comes from the semantics through "semantic analysis". Partial evaluation is a process pertaining to the semantic analysis portion which takes place after syntax analysis otherwise called parsing. So we start with source code, which is input into a parser, which outputs into the generator, which at this point receives input from the partial evaluator just prior to the final stage of compilation into "machine code".

The significance of partial evaluation in Tauchain and the interesting features of partial fixed point logic

Partial evaluation is a bit of a tweak on what is usually called a compiler-compiler or parser generator. Partial fixed point logic is where the magic of TML is supposed to happen and by magic I mean the main selling points such as self defining, decidable, etc. A quick Google search of fixed point logic shows that fixed point logic has a role in model checking which is a critical design feature for Tauchain. We also learn that partial fixed point logic is more expressive on infinite structures than inflationary fixed point logic.

The critical paper comes from Imhof titled "logics that define their own semantics". It is almost magical in that in this paper we are presented with the logic which is self definable by it's nature as well as decidable. So the literature is clearly showing that theory backs TML. TML likey will be used to produce a partial fixed point logic solver which through the unique properties of this logic we will gain the magical properties promised for Tauchain. To understand partial fixed point logic fully requires a lot more in depth study, but this blog post will point potential developers in the right direction so that the most basic questions are answered.

  • TML is a compiler-compiler utilizing partial evaluation.
  • TML will likely be utilizing partial fixed point logic because that is the only logic in the literature which allows for self interpretation, self defining, and decidability.
  • TML if implemented will represent a major technological breakthrough.

What is the significance of this breakthrough? This is the part which is hardest for me because it opens the door to so many opportunities and so much potential. For example what can developers do with the ability to inject any logic they wish, whether partial fixed point logic or some other? What does this mean for Tauchain which can now support multiple logics? What does this mean for Agoras which can be built using a decidable logic yet be expressive? PSPACE complexity, what will this allow for developers?

I'm unable to answer those questions sufficiently, but I think this is a much bigger deal than mere "Turing complete" status which we see common with the current state of the art blockchain tech. In a way this represents the next level, which is a state of the art meta language and compiler-compiler where flexibility is in the ability to communicate from human to machine.

References

Futamura, Y. (1999). Partial evaluation of computation process—an approach to a compiler-compiler. Higher-Order and Symbolic Computation, 12(4), 381-391.

Kreutzer, S. (2002, September). Partial fixed-point logic on infinite structures. In CSL (pp. 337-351).

Imhof, H. (1999). Logics that define their own semantics. Archive for Mathematical Logic, 38(8), 491-513.

Sort:  

This is brilliant! I am not a coder but I understand the logic behind it. No wonder so many people believed in this project before there was any code. Only a true genius could come up with this kind of theory. I am even more convinced now that this project has a huge future. Thank you for taking the time to share your knowledge and expertise with us!

Interesting reading ..right now compilers include Qt wallets right ?

QT is a development kit and is not a compiler at all. You can create apps with QT and a QT wallet is just a wallet written using the QT GUI and libraries. A compiler is like GCC, and a compiler compiler is what you would use to create a compiler.

a compiler compiler... I think the name needs some work! :P
So developers will be able to create their own language to work with Tauchain. Fixed point logic is built into the base language of TML, which gives developers more flexibility in the languages they are building on top of tauchain? And Tauchain will be a database type similar to contemporary blockchains but will be able to perform differently because of the FPL? Or is it just that the FPL enables new types of languages which would have been too difficult to write in the past?

It's definitely above my head, but i'd like to understand more. Not sure i could really understand it without 8 more years of school!

Will definitely be watching this project closely though, and maybe as i read more about it i'll start to grasp more of the pieces. Thanks for the updates.

High Level Compiler

A high level compiler is a compiler for a high level programming language. A compiler compiler is what you use to create compilers and new languages.

Another name for compiler-compiler is a parser generator. The name is what it does, it compiles compilers. Fixed point logic if you look at datalog it shows some of it's capabilities but TML goes beyond that, has recursion, and it seems fixed point logic is used for the knowledge engineering and KRR portion.

As someone with no background in compsci I appreciate your posts on Tauchain and Agoras a lot.

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 54391.40
ETH 2283.95
USDT 1.00
SBD 2.29