logic
Class SList

java.lang.Object
  extended bylogic.SymbolicObject
      extended bylogic.SList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List

public class SList
extends SymbolicObject
implements java.util.List


Field Summary
protected  java.util.List _s
           
 
Constructor Summary
SList()
           
SList(java.lang.Object l)
           
SList(Sentence t)
           
SList(SList l)
           
SList(TermList tl)
           
 
Method Summary
 void add(int i, java.lang.Object o)
           
 boolean add(java.lang.Object o)
           
 boolean add(Sentence term)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int i, java.util.Collection c)
           
 SList addAll(SList other)
           
 SList addNoDups(SList other)
           
 SList addNoDupSignatures(SList other)
           
 void clear()
           
 java.lang.Object clone()
           
 int compareTo(java.lang.Object o)
          Compare two SymbolicObjects.
 boolean contains(java.lang.Object o)
           
 boolean contains(Sentence s)
           
 boolean contains(SList o)
           
 boolean containsAll(java.util.Collection c)
           
 boolean containsDisjunction()
           
 SList eliminateExists()
           
 SList eliminateForall(api.ProblemInstance p)
           
 boolean equals(java.lang.Object o)
           
 boolean equalsSet(SList o)
           
 int finds(Sentence t)
           
 int findSignature(Sentence t)
           
 int findsStrict(Sentence t)
           
 SList flatten()
           
 java.lang.Object get(int i)
           
 SymbolicObject getFirst()
           
 Term getFirstTerm()
           
 java.lang.String getName()
           
 SymbolicObject getRest()
           
 SymbolicObject getRestNew()
           
 Sentence gets(int i)
           
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 java.lang.String infoString()
           
 java.lang.String infoString(java.lang.String sep)
           
 boolean isCompound()
           
 boolean isEmpty()
           
 boolean isSymbol()
           
 java.util.Iterator iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int i)
           
 SList negate()
           
protected  void nonTermErr(java.lang.Object o)
           
protected  void notImplementedErr(java.lang.String fn)
           
 TermList obtainVariables()
          see Proposition.obtainVariables() get the variables in this list of sentences
 int partition(SList t, int low, int high)
           
 java.lang.String prettyString(java.lang.String sep)
           
 double probabilityMass()
           
 SList push(Sentence term)
           
 SList qsort(SList t, int low, int high)
           
 SList reconcileTypes(api.Domain d, api.ProblemInstance p)
           
 SList relativize(api.ProblemInstance p)
           
 java.lang.Object remove(int i)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 int removes(Sentence t)
           
 boolean retainAll(java.util.Collection c)
           
 Sentence sample(double rand)
           
 int sampleIndex(double rand)
           
 SList scootNeqForJIP()
           
 java.lang.Object set(int i, java.lang.Object o)
           
 Sentence sets(int i, Sentence t)
           
 int size()
           
 SList sort()
           
 SList sortInPlace()
           
 java.util.List subList(int from, int to)
           
 SymbolicObject substitute(Substitution s)
           
 SymbolicObject substituteVariable(Variable oldVar, Term newVar)
           
 boolean symbolicMatch(java.lang.Object o)
           
 SymbolicObject symbolicSignature()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String sep)
           
 Substitution unify(SymbolicObject o, Substitution s)
          Given two terms, return their most general unifier, or null if they don't unify.
 SList weightBy(double p)
           
 
Methods inherited from class logic.SymbolicObject
copyData, debugString, geq, getOccurrences, getProbability, getType, getTypeName, gt, isTyped, leq, lt, setOccurrences, setProbability, setType
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_s

protected java.util.List _s
Constructor Detail

SList

public SList()

SList

public SList(Sentence t)

SList

public SList(SList l)

SList

public SList(TermList tl)

SList

public SList(java.lang.Object l)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class SymbolicObject

getName

public java.lang.String getName()
Specified by:
getName in class SymbolicObject

isCompound

public boolean isCompound()
Specified by:
isCompound in class SymbolicObject

isSymbol

public boolean isSymbol()
Specified by:
isSymbol in class SymbolicObject

symbolicSignature

public SymbolicObject symbolicSignature()
Specified by:
symbolicSignature in class SymbolicObject

negate

public SList negate()

getFirst

public SymbolicObject getFirst()
Specified by:
getFirst in class SymbolicObject

getFirstTerm

public Term getFirstTerm()
Specified by:
getFirstTerm in class SymbolicObject

getRestNew

public SymbolicObject getRestNew()

getRest

public SymbolicObject getRest()
Specified by:
getRest in class SymbolicObject

gets

public Sentence gets(int i)

sets

public Sentence sets(int i,
                     Sentence t)

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.List

size

public int size()
Specified by:
size in interface java.util.List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.List

clear

public void clear()
Specified by:
clear in interface java.util.List

add

public boolean add(Sentence term)

push

public SList push(Sentence term)

addAll

public SList addAll(SList other)

addNoDups

public SList addNoDups(SList other)

addNoDupSignatures

public SList addNoDupSignatures(SList other)

compareTo

public int compareTo(java.lang.Object o)
Description copied from class: SymbolicObject
Compare two SymbolicObjects. The result is zero if the objects are equal according to the equals() operator. Otherwise, the result is a negative integer if this object's name lexicographically precedes the other's name. The result is a positive integer if this object's name lexicographically follows the other's name.

Specified by:
compareTo in class SymbolicObject

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.List
Specified by:
equals in class SymbolicObject

symbolicMatch

public boolean symbolicMatch(java.lang.Object o)

equalsSet

public boolean equalsSet(SList o)

contains

public boolean contains(SList o)

contains

public boolean contains(Sentence s)

findSignature

public int findSignature(Sentence t)

finds

public int finds(Sentence t)

findsStrict

public int findsStrict(Sentence t)

removes

public int removes(Sentence t)

reconcileTypes

public SList reconcileTypes(api.Domain d,
                            api.ProblemInstance p)

scootNeqForJIP

public SList scootNeqForJIP()

sortInPlace

public SList sortInPlace()

sort

public SList sort()

qsort

public SList qsort(SList t,
                   int low,
                   int high)

partition

public int partition(SList t,
                     int low,
                     int high)

relativize

public SList relativize(api.ProblemInstance p)

eliminateExists

public SList eliminateExists()

eliminateForall

public SList eliminateForall(api.ProblemInstance p)

flatten

public SList flatten()

weightBy

public SList weightBy(double p)

obtainVariables

public TermList obtainVariables()
see Proposition.obtainVariables() get the variables in this list of sentences

Specified by:
obtainVariables in class SymbolicObject

substituteVariable

public SymbolicObject substituteVariable(Variable oldVar,
                                         Term newVar)
Specified by:
substituteVariable in class SymbolicObject

substitute

public SymbolicObject substitute(Substitution s)
Specified by:
substitute in class SymbolicObject

unify

public Substitution unify(SymbolicObject o,
                          Substitution s)
Description copied from class: SymbolicObject
Given two terms, return their most general unifier, or null if they don't unify. may be mutated.

Specified by:
unify in class SymbolicObject

toString

public java.lang.String toString()
Specified by:
toString in class SymbolicObject

infoString

public java.lang.String infoString()
Overrides:
infoString in class SymbolicObject

toString

public java.lang.String toString(java.lang.String sep)

prettyString

public java.lang.String prettyString(java.lang.String sep)

infoString

public java.lang.String infoString(java.lang.String sep)

probabilityMass

public double probabilityMass()

sampleIndex

public int sampleIndex(double rand)

sample

public Sentence sample(double rand)

nonTermErr

protected void nonTermErr(java.lang.Object o)

notImplementedErr

protected void notImplementedErr(java.lang.String fn)

add

public void add(int i,
                java.lang.Object o)
Specified by:
add in interface java.util.List

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.List

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.List

addAll

public boolean addAll(int i,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.List

get

public java.lang.Object get(int i)
Specified by:
get in interface java.util.List

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.List

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int i)
Specified by:
listIterator in interface java.util.List

remove

public java.lang.Object remove(int i)
Specified by:
remove in interface java.util.List

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.List

set

public java.lang.Object set(int i,
                            java.lang.Object o)
Specified by:
set in interface java.util.List

subList

public java.util.List subList(int from,
                              int to)
Specified by:
subList in interface java.util.List

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.List

containsDisjunction

public boolean containsDisjunction()