blog.distrib
Class ListInterp

java.lang.Object
  extended by blog.AbstractFunctionInterp
      extended by blog.distrib.ListInterp
All Implemented Interfaces:
FunctionInterp

public class ListInterp
extends AbstractFunctionInterp

An interpretation for a Boolean function symbol, specified by a list of tuples for which the function returns true. The first parameter to ListInterp is the arity of the tuples, i.e., the number of arguments to the function. If the arity is k, then the remaining parameters are interpreted in groups of k, as k-tuples for which the function returns true. The function returns false for all other tuples.


Constructor Summary
ListInterp(int arity)
          Creates a new ListInterp object with an empty list of tuples on which the function returns true.
ListInterp(java.util.List params)
          Creates a new ListInterp object with a specified list of tuples on which the function returns true.
 
Method Summary
 void add(java.util.List args)
          Adds the given argument tuple to the list of tuples on which the function returns true.
 java.util.Set getInverseTuples(java.lang.Object value)
          Returns the set of argument tuples that yield the given value, if this set is finite and can be computed easily.
 java.lang.Object getValue(java.util.List args)
          Returns the value of this function on the given tuple of arguments.
 
Methods inherited from class blog.AbstractFunctionInterp
getInverseArgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListInterp

public ListInterp(int arity)
Creates a new ListInterp object with an empty list of tuples on which the function returns true.


ListInterp

public ListInterp(java.util.List params)
Creates a new ListInterp object with a specified list of tuples on which the function returns true.

Parameters:
params - List whose first element is an Integer k, and whose remaining elements are interpreted in groups of k, as tuples of function arguments.
Method Detail

add

public void add(java.util.List args)
Adds the given argument tuple to the list of tuples on which the function returns true. Does nothing if the tuple is already in the list.

Throws:
java.lang.IllegalArgumentException - if the size of args does not equal the arity passed to this object's constructor

getValue

public java.lang.Object getValue(java.util.List args)
Description copied from interface: FunctionInterp
Returns the value of this function on the given tuple of arguments. Implementations can assume that the arguments are of the expected types and are not Model.NULL.


getInverseTuples

public java.util.Set getInverseTuples(java.lang.Object value)
Description copied from class: AbstractFunctionInterp
Returns the set of argument tuples that yield the given value, if this set is finite and can be computed easily. Otherwise returns null.

This default implementation just returns null.

Specified by:
getInverseTuples in interface FunctionInterp
Overrides:
getInverseTuples in class AbstractFunctionInterp
Returns:
Set of List of objects