Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.core
Class Functions.Rule

java.lang.Object
  extended by imp.core.Function
      extended by imp.core.Functions.Rule
Enclosing class:
Functions

public static class Functions.Rule
extends Function

Defines a function defined by a pattern-matching rule.

THIS MECHANISM IS NOT YET VALIDATED IN THE PRESENT VERSION: DO NOT USE !!!
Pattern matching. In this context a pattern to be matched is defined by the following rules: Pattern matching thus allows to test if an expression has a given form and verifies some properties, i.e. belongs to a domain of definition.
Typing variables.Here, the type of a variable is simply defined by the evaluation of boolean expression, i.e. a construct of the form $name:condition
Typing is thus not static but verified at execution time.
Instantiation.During pattern matching, the variables are set to values so that the expression to be matched is equal to the given pattern, providing a match-list() function.
E.g.: log(f(a, $u:*) ^ $v:*) matches log(f(a, b) ^ (n+1)) with the substitution {u = b, v = n+1}


Constructor Summary
Functions.Rule(Value pattern)
          Constructs a function defined a pattern-matching rule.
 
Method Summary
 
Methods inherited from class imp.core.Function
eval, popContext, pushContext, setArity, setFixedPoint, setName, setQuoted, setRemember, setTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Functions.Rule

public Functions.Rule(Value pattern)
Constructs a function defined a pattern-matching rule.