nars.language
Class ImageInt

java.lang.Object
  extended by nars.language.Term
      extended by nars.language.CompoundTerm
          extended by nars.language.ImageInt
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<Term>

public class ImageInt
extends CompoundTerm

An intension image.

(\,P,A,_)) --> B iff P --> (*,A,B)

Internally, it is actually (\,A,P)_1, with an index.


Field Summary
private  short relationIndex
          The index of relation in the component list
 
Fields inherited from class nars.language.CompoundTerm
complexity, components, openVariables
 
Fields inherited from class nars.language.Term
name
 
Constructor Summary
private ImageInt(java.lang.String n, java.util.ArrayList<Term> cs, java.util.ArrayList<Variable> open, short complexity, short index)
          Constructor with full values, called by clone
private ImageInt(java.lang.String n, java.util.ArrayList<Term> arg, short index)
          constructor with partial values, called by make
 
Method Summary
 java.lang.Object clone()
          Clone an object
 short getRelationIndex()
          get the index of the relation in the component list
static Term make(java.util.ArrayList<Term> argList)
          Try to make a new ImageExt.
static Term make(java.util.ArrayList<Term> argument, short index)
          Try to make a new compound from a set of components.
static Term make(ImageInt oldImage, Term component, short index)
          Try to make an Image from an existing Image and a component.
static Term make(Product product, Term relation, short index)
          Try to make an Image from a Product and a relation.
 java.lang.String makeName()
          Override the default in making the name of the current term from existing fields
 java.lang.String operator()
          Get the operator of the term.
 
Methods inherited from class nars.language.CompoundTerm
addComponents, argumentsToList, cloneComponents, cloneList, componentAt, containAllComponents, containComponent, getComplexity, getComponents, getConstantName, getOpenVariables, isCommutative, isConstant, isOperator, make, make, makeCompoundName, makeImageName, makeSetName, prepareComponentLinks, reduceComponents, renameVariables, renameVariables, replaceComponent, replaceComponent, size, substituteComponent
 
Methods inherited from class nars.language.Term
compareTo, equals, getName, getOrder, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

relationIndex

private short relationIndex
The index of relation in the component list

Constructor Detail

ImageInt

private ImageInt(java.lang.String n,
                 java.util.ArrayList<Term> arg,
                 short index)
constructor with partial values, called by make

Parameters:
n - The name of the term
arg - The component list of the term
index - The index of relation in the component list

ImageInt

private ImageInt(java.lang.String n,
                 java.util.ArrayList<Term> cs,
                 java.util.ArrayList<Variable> open,
                 short complexity,
                 short index)
Constructor with full values, called by clone

Parameters:
n - The name of the term
cs - Component list
open - Open variable list
complexity - Syntactic complexity of the compound
index - The index of relation in the component list
Method Detail

clone

public java.lang.Object clone()
Clone an object

Specified by:
clone in class CompoundTerm
Returns:
A new object, to be casted into an ImageInt

make

public static Term make(java.util.ArrayList<Term> argList)
Try to make a new ImageExt. Called by StringParser.

Parameters:
argList - The list of components
Returns:
the Term generated from the arguments

make

public static Term make(Product product,
                        Term relation,
                        short index)
Try to make an Image from a Product and a relation. Called by the inference rules.

Parameters:
product - The product
relation - The relation
index - The index of the place-holder
Returns:
A compound generated or a term it reduced to

make

public static Term make(ImageInt oldImage,
                        Term component,
                        short index)
Try to make an Image from an existing Image and a component. Called by the inference rules.

Parameters:
oldImage - The existing Image
component - The component to be added into the component list
index - The index of the place-holder in the new Image
Returns:
A compound generated or a term it reduced to

make

public static Term make(java.util.ArrayList<Term> argument,
                        short index)
Try to make a new compound from a set of components. Called by the public make methods.

Parameters:
argument - The argument list
index - The index of the place-holder in the new Image
Returns:
the Term generated from the arguments

getRelationIndex

public short getRelationIndex()
get the index of the relation in the component list

Returns:
the index of relation

makeName

public java.lang.String makeName()
Override the default in making the name of the current term from existing fields

Overrides:
makeName in class CompoundTerm
Returns:
the name of the term

operator

public java.lang.String operator()
Get the operator of the term.

Specified by:
operator in class CompoundTerm
Returns:
the operator of the term