You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While debugging NAL-6 tests, I found that one of the reasons for increased runtime when variables are present lies in variable initialization. It takes almost 3x longer to create a Variable than to create a Term.
As KanrenReasoner performs frequent conversions back and forth between Narsese and Logic, this leads to suboptimal performance on tasks involving variables. We need to find a way to handle variables more efficiently.
The text was updated successfully, but these errors were encountered:
Through those lines/functions, the ids and indices of variables are computed. For example,
The id of each variable is repersented as a number. In the example above, <(&&, <#x-->A>, <#x-->B>, <$y-->C>)==><$y-->D>> contains four variables (#x, #x, $y, $y) (though only two distinct variables), and they are internaly stored in a tuple (0, 0, 1, 1). The indices of the variables are [0, 0, 0], [0, 1, 0], [0, 2, 0], and [1, 0]. There are some routines to maintain this kind of structure and records.
Another example:
The reason why I use this structure is that when doing unification, for example, the two variable terms are (&&, <$x --> A>, <$y --> B>) and (&&, <$z --> A>, <$w --> B>), their internal representations are equal (i.e., (&&, <$ --> A>, <$ --> B>) (0, 1) [[0, 0], [1, 0]] (here (0, 1) are the ids of the two variables, and [[0, 0], [1, 0]] are their indices/postions).
But when using Kanran, there seems no need to maintain such a data-structure.
Describe the bug
While debugging NAL-6 tests, I found that one of the reasons for increased runtime when variables are present lies in variable initialization. It takes almost 3x longer to create a
Variable
than to create aTerm
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
As KanrenReasoner performs frequent conversions back and forth between Narsese and Logic, this leads to suboptimal performance on tasks involving variables. We need to find a way to handle variables more efficiently.
The text was updated successfully, but these errors were encountered: