Skip to content

Latest commit

 

History

History
93 lines (66 loc) · 3.91 KB

README.md

File metadata and controls

93 lines (66 loc) · 3.91 KB
// work in progress //

t-rewriter.js

tags: type system, term graph rewriting, production rules, automated reasoning

project status:
    [ ] alpha conception
        [x] theorizing
        [ ] implementing
            [x] main loop
            [x] variables substitution and free variables
            [ ] types (to do: [ ] deep rules; [ ] deep variables)
            [ ] error messages
            [ ] stress test
    [ ] beta testing and revising code
    [ ] gamma release

Check out the current code performing at online playground.

table of contents

1. project specifics

t-rewriter.js is a term graph rewriting tool for transforming any input s-expr to any output s-expr using a rule-based system. The main intention of t-rewriter.js is to support automated reasoning.

t-rewriter.js code represents a program that is actually a set of formulas performing similar to those in mathematics with the difference that the t-rewriter.js formulas may transform not only math expressions, but also any kinds of s-exprs.

To get a glimpse on how a t-rewriter.js program looks like, here's a quick example:

(
    RL
    (
        RD
        
        (RL (RD) (WT {goes [name] [voice]}))
        
        (RL (RD [name] ) (WT Milo))
        (RL (RD [name] ) (WT Nora))
        (RL (RD [voice]) (WT bark))
        (RL (RD [voice]) (WT meow))
    )
    (
        CN
        
        (RL (VR <X>) (RD {goes <X> meow}) (WT {isA <X> cat}))
            
        (RL (VR <X>) (RD {goes <X> bark}) (WT {isA <X> dog}))
    )
    (
        WT
        
        (RL (RD Milo) (WT [name]  ))
        (RL (RD Nora) (WT [name]  ))
        (RL (RD cat ) (WT [living]))
        (RL (RD dog ) (WT [living]))
        
        (RL (RD {isA [name] [living]}) (WT))
    )
)

This program does the following:

  • reading an input containing {goes Nora meow} or {goes Milo meow} writes an output containing {isA Nora cat} or {isA Milo cat}
  • reading an input containing {goes Nora bark} or {goes Milo bark} writes an output containing {isA Nora dog} or {isA Milo dog}
  • reading any other input yields an error message

2. work done so far

A lot of research is invested in conceptualisation of t-rewriter.js, and it is still heavily under construction. During its conceptualisation journey, it has been an agile experimenting project, advancing its theoretical background with each iteration. Curious readers may want to skim over historical documents directory that collect the successive iterations.

The current iteration is explained in actual working draft, and its implementation is in progress. Expect considerable updates to working draft during the implementation phase.

Related to t-rewriter.js, various experiments in Javascript were conducted with term rewriting concepts, finally achieving some promising results. Please refer to rewrite.js repository for more information about the latest experiment.

3. future plans

t-rewriter.js is an experimental platform used for conceptual testing of term graph rewriting. Positive results of this experiment would place foundations for the future programming framework whose purpose would be building artificial intelligence. We are continuing our efforts to actively work on t-rewriter.js, hoping to get closer to the planned programming framework.

// work in progress //