forge.solve
Class ForgeAtom

java.lang.Object
  extended by forge.solve.ForgeAtom
All Implemented Interfaces:
ProgramElement, ForgeConstant, ForgeConstant.Tuple, ForgeConstant.Unary
Direct Known Subclasses:
BooleanAtom, InstanceAtom, IntegerAtom

public abstract class ForgeAtom
extends java.lang.Object

A singleton constant

Author:
Greg Dennis (gdennis@mit.edu)

Nested Class Summary
 
Nested classes/interfaces inherited from interface forge.solve.ForgeConstant
ForgeConstant.Tuple, ForgeConstant.Unary
 
Nested classes/interfaces inherited from interface forge.solve.ForgeConstant
ForgeConstant.Tuple, ForgeConstant.Unary
 
Method Summary
 int arity()
          Returns the arity of this constant.
 java.util.List<ForgeAtom> atoms()
           
 ForgeConstant.Unary difference(ForgeConstant c)
           
 ForgeAtom domain()
           
 ForgeConstant.Unary intersection(ForgeConstant c)
           
 boolean isDomain()
           
 boolean isEmpty()
          Returns if the size is 0.
 boolean isTuple()
          Returns true if the size is one.
 boolean isUnary()
          Returns true if the arity is one.
 ForgeConstant join(ForgeConstant c)
           
 java.lang.String name()
           
 ForgeConstant.Tuple product(ForgeConstant.Tuple tuple)
           
 ForgeConstant product(ForgeConstant c)
           
 ForgeProgram program()
          Returns the program to which this element belongs.
 ForgeConstant.Tuple projection(int... columns)
           
 ForgeAtom range()
           
 boolean subsetOf(ForgeConstant c)
          Returns true if this is a subset of c
 java.lang.String toString()
           
 java.util.Set<ForgeAtom> tuples()
          Returns the set of tuples in this constant
 kodkod.instance.TupleSet tupleSet()
           
abstract  ForgeDomain type()
          Returns the type of this constant.
 ForgeConstant.Unary union(ForgeConstant c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface forge.solve.ForgeConstant
arity, isEmpty, isTuple, isUnary, join, product, subsetOf, tupleSet
 
Methods inherited from interface forge.program.ProgramElement
program
 
Methods inherited from interface forge.solve.ForgeConstant
arity, isEmpty, isTuple, isUnary, join, product, subsetOf, tupleSet
 
Methods inherited from interface forge.program.ProgramElement
program
 

Method Detail

type

public abstract ForgeDomain type()
Description copied from interface: ForgeConstant
Returns the type of this constant.

Specified by:
type in interface ForgeConstant
Specified by:
type in interface ForgeConstant.Tuple
Specified by:
type in interface ForgeConstant.Unary

name

public final java.lang.String name()

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

tuples

public final java.util.Set<ForgeAtom> tuples()
Description copied from interface: ForgeConstant
Returns the set of tuples in this constant

Specified by:
tuples in interface ForgeConstant
Specified by:
tuples in interface ForgeConstant.Unary

atoms

public final java.util.List<ForgeAtom> atoms()
Specified by:
atoms in interface ForgeConstant.Tuple

domain

public final ForgeAtom domain()
Specified by:
domain in interface ForgeConstant
Specified by:
domain in interface ForgeConstant.Tuple

range

public final ForgeAtom range()
Specified by:
range in interface ForgeConstant
Specified by:
range in interface ForgeConstant.Tuple

projection

public final ForgeConstant.Tuple projection(int... columns)
Specified by:
projection in interface ForgeConstant
Specified by:
projection in interface ForgeConstant.Tuple

product

public ForgeConstant.Tuple product(ForgeConstant.Tuple tuple)
Specified by:
product in interface ForgeConstant.Tuple

union

public final ForgeConstant.Unary union(ForgeConstant c)
Specified by:
union in interface ForgeConstant
Specified by:
union in interface ForgeConstant.Unary

difference

public final ForgeConstant.Unary difference(ForgeConstant c)
Specified by:
difference in interface ForgeConstant
Specified by:
difference in interface ForgeConstant.Unary

intersection

public final ForgeConstant.Unary intersection(ForgeConstant c)
Specified by:
intersection in interface ForgeConstant
Specified by:
intersection in interface ForgeConstant.Unary

tupleSet

public kodkod.instance.TupleSet tupleSet()
Specified by:
tupleSet in interface ForgeConstant

program

public final ForgeProgram program()
Description copied from interface: ProgramElement
Returns the program to which this element belongs.

Specified by:
program in interface ProgramElement

arity

public final int arity()
Description copied from interface: ForgeConstant
Returns the arity of this constant.

Specified by:
arity in interface ForgeConstant

isEmpty

public final boolean isEmpty()
Description copied from interface: ForgeConstant
Returns if the size is 0.

Specified by:
isEmpty in interface ForgeConstant

isUnary

public final boolean isUnary()
Description copied from interface: ForgeConstant
Returns true if the arity is one.

Specified by:
isUnary in interface ForgeConstant

isTuple

public boolean isTuple()
Description copied from interface: ForgeConstant
Returns true if the size is one.

Specified by:
isTuple in interface ForgeConstant

subsetOf

public final boolean subsetOf(ForgeConstant c)
Description copied from interface: ForgeConstant
Returns true if this is a subset of c

Specified by:
subsetOf in interface ForgeConstant

join

public final ForgeConstant join(ForgeConstant c)
Specified by:
join in interface ForgeConstant

product

public final ForgeConstant product(ForgeConstant c)
Specified by:
product in interface ForgeConstant

isDomain

public boolean isDomain()