Karthik Senthil's blog

Definitional Trees : Coding Phase - Changed the output of compile procedure

Hello all,

Over the last few days I worked on changing the compile procedure and made it more generic. A new class named Rule was added which has 2 attributes(lhs and rhs). So the compile procedure now takes a definitional tree as input and produces an array of Rules as output. This enables better processing of the tree for any further operations.

I'm now working on generating some unit tests for the compile procedure and simultaneously looking into the next set of tasks or operations using compile.

My progress can be tracked here

Definitional Trees : Coding Phase - Better design for compile procedure

Hello all,

I'm currently working on improving the modularity and design of the compile procedure. After discussing with my mentor, I've redesigned the procedure using Object Oriented concepts and taking advantage of some unique features of Ruby with respect to OOP. The compile procedure is now an abstract method of the class DefTreeNode and is accordingly specialised in the sub-classes Branch, Leaf and Exempt. I'm currently making some corrections in the design of the examples .

You can track my progress here

Definitional Trees : Coding Phase - Lots of progress

Hello all,

Over the last few days, I had a lot of discussions and code reviews with my mentor Prof.Sergio Antoy regarding the 'compile' procedure as well as the overall modularity of the source code of the tool.

With regards to this I've made a lot of changes. At the same time, I've completed almost all functionalities of the compile procedure. The remaining part left is the last case of handling a Variable on the RHS of a rule. I'm currently working on that issue.

I've also started documenting my classes and modules, and started maintaining an overall file structure hierarchy diagram for better understanding of the code.

My progress can be tracked here

Definitional Trees : Coding Phase - Working on 'compile' procedure

Hello all,

Today I discussed with Prof.Sergio about the details of the different symbols/notations used in the 'compile' procedure and have cleared all doubts about the same.

I will now be working on implementing the procedure in a step-by-step manner post which I plan to test the same for the existing examples.

Definitional Trees : Coding Phase - Moving ahead to "compile" procedure

Hello all,

I spent the last few days working on a final example to completely understand the concept of a Definitional Tree. I was asked by my mentor to implement the tree for the "replace" function described here

Initially I made a few mistakes in understanding the function, but I was guided by my mentor on what exactly the function implies and how to construct the corresponding definitional tree for the same.

I have completed its implementation, which can be tracked here.

The next step is to work on a procedure named "compile" for better and faster tree construction and display. I will be getting more details about the same from my mentor soon.

Definitional Trees : Coding Phase - Added more examples

Hello all,

Over the last few days, I've been identifying particular examples of curry programs and implementing their corresponding definitional trees.

The next step that I will be working on is a faster technique to construct the tree and process the same. I have discussed about this with Prof.Sergio Antoy and he has suggested me an algorithm to lookup for implementation in Ruby.

My progress can be tracked here

Definitional Trees : Coding Phase - Added pretty_print functionality to tree

Hello all,

Today I added the pretty_print functionality in order to give a representative output for the Ruby program. The function prints the nodes at different levels of the definitional tree with matching indentation.

The output can be viewed here.

I will now be working on more examples and also discuss with my mentor about an alternate method for the construction of definitional trees.

Definitional Trees : Coding Phase - Finished 2 more examples

Hello all,

Today I was able to complete 2 more examples of encoding a system of rewrite rules to their corresponding code in Ruby.

The code can be found here:

  1. Less than equal to
  2. Integer division by 2

I'm now focusing on pretty printing the definitional tree on terminal given the code for these examples.

Definitional Trees : Coding Phase - Started with "append" example

Hello all,

Today I discussed with my mentor about the basic example of the "append" operation on lists and was able to successfully encode the correspoding rules into a definitional tree.

All the relevant code is available at : https://github.com/karthiksenthil/DefinitionalTree

Moving ahead with more examples.

Definitional Trees : Literature Survey - Coding in Ruby

Hello all,

After having a brief exercise on using Ruby for the construction of a Binary Search Tree, I'm now working on designing a template class structure needed for the construction of a Definitional Tree in Ruby. With constant reviews from Prof.Sergio Antoy I've built the required basic class template.

The following is the next set of upcoming tasks with respect to the program to construct Definitional Trees-

  1. Design the class functions based on what operations is required for each class(on discussion with Prof.Sergio)
  2. Encode a separate file that constructs a few definitional tree objects using the current Ruby code

Looking forward to test the code on various example codes.

Syndicate content