Skip to content

watchduck/tree_table

Repository files navigation

This Vue.js app is a proof of concept for a detail of the prolog_trace app, and uses the same Python backend.
It turns a formula in prefix notation into a tree structure, realized as an HTML table.

The formula in the following screenshot is the law of cosines. (ang means angle opposite of.)
The cursor is on the c highlighted in orange. All other occurences are highlighted in yellow.

treetable_law_of_cosines

The app allows functions with different arity to have the same name, and be treated as different.
(That is motivated by the fact that Prolog allowes this.)

The following screenshot shows the result for the input "f(f, f(f), f(f, f(f)))".
Only 1-ary f is highlighted, but not the others.
This example also shows, that entered names can be replaced by custom names.
3-ary f has been renamed to "X", and 0-ary f is shown as a dot.

Screenshot from 2020-02-09 02-56-10

Custom names must not be empty, and together with the arity they must be unique.
(One could even used parentheses as custom names – which is probably not a good idea.)

About

convert tree structure in prefix notation to HTML table

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published