By representing a strategy as a term, it can be passed around. This requires an EvalStrategy? operator that evaluates such a term. This need not be a primitive;

Problems

  • How to distinghuish congruence strategies represented as terms from terms themselves?

  • By declaring constructors for the strategies, a congruence operator is declared automatically. This should be avoided. That is, the user should not declare these constructors, but they should be generated implicitly from strategy definitions.

  • Closures?

-- EelcoVisser - 27 Oct 2001

A possibility is to use a quotation mechanism in the style of MetaML and represent quoted stategies internally using abstract syntax representation. This requires an interpreter that maps calls to strategy operators, but has to interprete ordinary combinators. This would make possible an integration of the interpreter StrategoScript? with the StrategoCompiler. In fact, StrategoScript? already calls C functions, i.e., the Stratego primitives from the Stratego standard library?.

ELAN provides such a mechanism. The idea of RewritingByRewriting? is based on this idea, if I remember correctly.

-- EelcoVisser - 02 Nov 2001


CategoryToDo? | ToDo | LanguageExtensions

Revision: r1.3 - 17 May 2003 - 20:14 - MartinBravenboer
Stratego > RepresentStrategyAsTerm
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback