|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.krr.propositions.IntEncodedClause.CnfIntEncodedClauseListAdaptor
protected static class IntEncodedClause.CnfIntEncodedClauseListAdaptor
Field Summary | |
---|---|
protected static inf.compilers.LexicalAnalyzer.TokenType |
cnfTT
the token types used |
protected static inf.compilers.LexicalAnalyzer.TokenType |
ignorableTT
the token types used |
protected static inf.compilers.LexicalAnalyzer.TokenType |
minusTT
the token types used |
protected static inf.compilers.LexicalAnalyzer.TokenType |
posintTT
the token types used |
protected java.util.Properties |
props
the properties used for reading and writing |
protected static inf.compilers.LexicalAnalyzer.TokenType |
pTT
the token types used |
protected inf.compilers.LexicalAnalyzer |
scanner
the lexical analyzer used for tokenizing the input |
protected static inf.compilers.LexicalAnalyzer.TokenType |
zeroTT
the token types used |
Constructor Summary | |
---|---|
IntEncodedClause.CnfIntEncodedClauseListAdaptor()
This constructor creates a SyntaxAdaptor that can be used to read statements in a (propositional) KIF syntax and create a propositional Sentence for it, or it can be used to write out a propositional Sentence in KIF syntax. |
Method Summary | |
---|---|
protected java.lang.Object |
clone()
|
java.lang.Class<IntEncodedClause.IntEncodedClauseList> |
getInternalClass()
This function returns the Class that holds the internal representation this adaptor translates to and from. |
java.lang.String |
getProperty(java.lang.String key)
This function gets the property that is associated with the given key. |
java.lang.String |
getSyntaxName()
This function returns the name that should identify the syntactical language that this adaptor translates to and from. |
static IntEncodedClause.IntEncodedClauseList |
parseClauseList(java.io.Reader r,
java.util.Properties props)
This function attempts to parse a propositional Sentence in KIF syntax from the underlying LexicalAnalyzer. |
void |
prettyPrint(int indent,
IntEncodedClause.IntEncodedClauseList iecls,
java.io.Writer w)
This function takes an IntEncodedClauseList which is a Java Object in the internal representation, and writes it to the given Writer as a string conforming to the CNF syntax. |
IntEncodedClause.IntEncodedClauseList |
read(java.io.Reader r)
This function attempts to parse characters from the given Reader until an IntEncodedClauseList that represents an object in the internal representation has been parsed. |
void |
setProperty(java.lang.String key,
java.lang.String value)
This function sets the property associated with the given key to the given value. |
void |
write(IntEncodedClause.IntEncodedClauseList iecls,
java.io.Writer w)
This function takes an IntEncodedClauseList which is a Java Object in the internal representation, and writes it to the given Writer as a string conforming to the CNF syntax. |
static void |
writeClauseList(IntEncodedClause.IntEncodedClauseList iecls,
java.io.Writer w,
java.util.Properties props)
This function takes an IntEncodedClauseList which is a Java Object in the internal representation, and writes it to the given Writer as a string conforming to the CNF syntax. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static inf.compilers.LexicalAnalyzer.TokenType ignorableTT
protected static inf.compilers.LexicalAnalyzer.TokenType pTT
protected static inf.compilers.LexicalAnalyzer.TokenType cnfTT
protected static inf.compilers.LexicalAnalyzer.TokenType posintTT
protected static inf.compilers.LexicalAnalyzer.TokenType minusTT
protected static inf.compilers.LexicalAnalyzer.TokenType zeroTT
protected inf.compilers.LexicalAnalyzer scanner
protected java.util.Properties props
Constructor Detail |
---|
public IntEncodedClause.CnfIntEncodedClauseListAdaptor()
This constructor creates a SyntaxAdaptor that can be used to read statements in a (propositional) KIF syntax and create a propositional Sentence for it, or it can be used to write out a propositional Sentence in KIF syntax.
Method Detail |
---|
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.Class<IntEncodedClause.IntEncodedClauseList> getInternalClass()
This function returns the Class that holds the internal representation this adaptor translates to and from.
getInternalClass
in interface inf.compilers.SyntaxAdaptor<IntEncodedClause.IntEncodedClauseList>
public java.lang.String getSyntaxName()
This function returns the name that should identify the syntactical language that this adaptor translates to and from.
getSyntaxName
in interface inf.compilers.SyntaxAdaptor<IntEncodedClause.IntEncodedClauseList>
public void write(IntEncodedClause.IntEncodedClauseList iecls, java.io.Writer w) throws inf.compilers.ExpressivenessException, java.io.IOException
This function takes an IntEncodedClauseList which is a Java Object in the internal representation, and writes it to the given Writer as a string conforming to the CNF syntax.
write
in interface inf.compilers.SyntaxAdaptor<IntEncodedClause.IntEncodedClauseList>
iecls
- a list of clauses in the internal representationw
- the Writer to which the syntactical translation is written
inf.compilers.ExpressivenessException
- if the syntactical language cannot
represent the given clauses
java.io.IOException
- if writing to the given Writer failspublic void prettyPrint(int indent, IntEncodedClause.IntEncodedClauseList iecls, java.io.Writer w) throws inf.compilers.ExpressivenessException, java.io.IOException
This function takes an IntEncodedClauseList which is a Java Object in the internal representation, and writes it to the given Writer as a string conforming to the CNF syntax.
prettyPrint
in interface inf.compilers.SyntaxAdaptor<IntEncodedClause.IntEncodedClauseList>
indent
- the amount of indentation for the first lineiecls
- a list of clauses in the internal representationw
- the Writer to which the syntactical translation is written
inf.compilers.ExpressivenessException
- if the syntactical language cannot
represent the given clauses
java.io.IOException
- if writing to the given Writer failspublic IntEncodedClause.IntEncodedClauseList read(java.io.Reader r) throws inf.compilers.ExpressivenessException, java.text.ParseException, java.io.IOException
This function attempts to parse characters from the given Reader until an IntEncodedClauseList that represents an object in the internal representation has been parsed.
read
in interface inf.compilers.SyntaxAdaptor<IntEncodedClause.IntEncodedClauseList>
r
- the Reader from which the representation is to be parsed
inf.compilers.ExpressivenessException
- if the internal representation class is
not expressive enough for the given clauses
java.text.ParseException
- if there is a syntax error in the given string
java.io.IOException
- if reading from the Reader failspublic java.lang.String getProperty(java.lang.String key)
This function gets the property that is associated with the given key. Not e that the key should not be null.
getProperty
in interface inf.compilers.SyntaxAdaptor<IntEncodedClause.IntEncodedClauseList>
public void setProperty(java.lang.String key, java.lang.String value)
This function sets the property associated with the given key to the given value. The given key must not be null, but the value may be.
setProperty
in interface inf.compilers.SyntaxAdaptor<IntEncodedClause.IntEncodedClauseList>
key
- the key with which the value is associatedvalue
- the associated valuepublic static void writeClauseList(IntEncodedClause.IntEncodedClauseList iecls, java.io.Writer w, java.util.Properties props) throws inf.compilers.ExpressivenessException, java.io.IOException
This function takes an IntEncodedClauseList which is a Java Object in the internal representation, and writes it to the given Writer as a string conforming to the CNF syntax.
iecls
- a list of clauses in the internal representationw
- the Writer to which the syntactical translation is writtenprops
- the Properties used for writing
inf.compilers.ExpressivenessException
- if the syntactical language cannot
represent the given statement
java.io.IOException
- if writing to the given Writer failspublic static IntEncodedClause.IntEncodedClauseList parseClauseList(java.io.Reader r, java.util.Properties props) throws inf.compilers.ExpressivenessException, java.text.ParseException, java.io.IOException
This function attempts to parse a propositional Sentence in KIF syntax from the underlying LexicalAnalyzer. Since the target representation is propositional and KIF is a much more expressive syntax, there are many reasons why an ExpressivenessException may be thrown. However, some of these may look like syntax problem to this parser and thus will be thrown as ParseExceptions.
scanner
- the LexicalAnalyzer from which character input is readprops
- the properties used for reading
inf.compilers.ExpressivenessException
- if the input is not propositional
java.text.ParseException
- if the KIF syntax is violated
java.io.IOException
- if reading from the LexicalAnalyzer fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |