/canon

conceptual rule-based programming formalism

Primary LanguageJavaScriptMIT LicenseMIT

// under construction //

canon

about the project

As an embodiment of general problem solving strategy related to term rewriting, Canon aims to be a host for a variety of kinds of formal languages, exhibiting rule-based programming system. For each area of interest, one is able to define a custom domain specific language in a language oriented programming paradigm. Having clearly defined communication input and output forms, Canon performs transition from input to output by additionally defining possibly expressive, functional, and semantic complete set of chaining production rules. This sort of arrangement also sheds light on Canon from an angle of systems theory, thus broadening a possible range of use cases.

expected appearance

To get a glimpse of how (once it is finished) interfacing with canon would look like, we bring the following ruleset:

/*
    dog/cat decision example
    
     input: `*subject* barks/meows`
    output: `*subject* is a dog/cat`
*/

(
    RULE
    (
        BACK
        (RULE (BACK       ) (FORE <<name> barks> <<name> meows>))
        (RULE (BACK <name>) (FORE <...>                        ))
        ...
    )
    (
        CHAIN
        (
            MATCH
            (ID <X> <name>)
            (RULE (FORE <<X> barks>) (BACK <<X> is a dog>))
        )
        (
            MATCH
            (ID <X> <name>)
            (RULE (FORE <<X> meows>) (BACK <<X> is a cat>))
        )
    )
    (
        FORE
        ...
        (RULE (FORE                               <...>) (BACK <name>))
        (RULE (FORE <<name> is a dog> <<name> is a cat>) (BACK       ))
    )
)

Feeding an input Nora meows to the above ruleset should yield the output Nora is a cat, while feeding Milo barks should yield Milo is a dog.

What is really happening is that we try to parse an input string using rules from BACK section of the topmost rule in a forward direction. Then we try to parse the same input string using rules from CHAIN and FORE sections of the topmost rule in a backward direction. If everything goes well, our output then represents the first deepest parsing excerpt consisted only of rules in FORE section of the topmost rule.

current status

A lot of research is invested in creation of canon, and it is still under construction. During its creation journey, it has been an agile experimenting project, advancing its theoretical background with each iteration (curious readers may want to skim over historical documents explaining logos, esperas, exp-log, and exp-flow iterations). The most recent iteration canon draft document is in preparation phase.

Canon will base its functionality on a novel v-parse-cfg algorithm. The canon creation is divided into three successive iterations dealing with term rewriting rules, each being a superset of the previous one. Additional, fourth iteration deals with semantic rhombus interpretation. Here is the current project roadmap with finished marks:

  1. v-parse-crux algorithm (elementary terms interpretation)
  2. v-parse-plus algorithm (composite terms interpretation)
  3. v-parse-star algorithm (term matching interpretation)
  4. forward-chain-backward connection (semantic rhombus interpretation)

If one is interested in details about the preparation for project development, there are some partial resources to check out:

// under construction //