Re: [Toss-devel] Hierarchical Terms with Sharing
Status: Beta
Brought to you by:
lukaszkaiser
|
From: Lukasz K. <luk...@gm...> - 2012-06-16 00:47:04
|
Hi. > I'm sorry, I still haven't finished the example with generating the > board. In the drafts I have a description of matching as an algorithm > to compute "ISA", therefore rewriting can be based on computing > "subterm ISA pattern". In the future, sure - but I think for now the rewriting we have is quite ok, no? > As for "Var", it has so many parameters to be compatible with the > current system, right? In the end it will most probably be "Var of > string * term option ref". See "Term Rewriting and All That" section > 4.8 "Unification of term graphs". Just the contrary - the parameters of the variable are necessary, also in principle, in any system I think. The reason is that we have functional variables - and we certainly want them (map, fold, etc :).) So variables take parameters when the var-function is applied, and it must be like this. And the integer - current arity - is just to know if we have a ternary function fully applied or rather a ternary function but still as a functional variable - unapplied. Maybe this could be removed, but I see no reason - it does not cost much, and is really useful some times. So I guess the variables have to be like that. And maybe there is some use of functional variables in the type system, or maybe not? Lukasz |