|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractSet java.util.HashSet java.util.LinkedHashSet orbital.moon.logic.resolution.ClauseImpl
public class ClauseImpl
Default implementation of a representation of a clause, i.e. a set of literals. A clause {L1,...,Ln} is a different notation for the disjunction L1∨...∨Ln.
Field Summary |
---|
Fields inherited from interface orbital.moon.logic.resolution.Clause |
---|
CONTRADICTION |
Constructor Summary | |
---|---|
ClauseImpl()
|
|
ClauseImpl(java.util.Set literals)
Copy constructor. |
Method Summary | |
---|---|
java.util.Iterator |
factorize()
Get all factors of F. |
protected Clause |
factorize(java.util.Collection literals)
Factorize a clause by the specified literals. |
protected Pair |
factorize2(java.util.Collection literals)
Workaround for returning 2 arguments. |
protected static ClausalFactory |
getClausalFactory()
|
Signature |
getFreeVariables()
Get the free variables of a formula represented as a clause. |
java.util.Iterator |
getProbableUnifiables(Formula L)
Get (an iterator over) all literals contained in this clause that may possibly unify with L. |
java.util.Iterator |
getResolvableLiterals()
Select some literals of this clause, which are usable for resolution. |
java.util.Set |
getUnifiables(Formula L)
Get all literals contained in this clause that unify with L. |
boolean |
isElementaryValid()
Returns true when this clause obviously is an elementary tautology. |
boolean |
isElementaryValidUnion(Clause G)
Returns true when the union F∪G would obviously contain an elementary tautology. |
protected Clause |
resolventWith(Clause G,
Formula L,
Formula K)
Resolve clause F with G by the complementary resolution literals L∈F and K∈G. |
protected Pair |
resolventWith2(Clause G,
Formula L,
Formula K)
Workaround for returning 2 arguments. |
java.util.Iterator |
resolveWith(Clause G)
Get all resolvents of F and G, if any. |
java.util.Iterator |
resolveWithFactors(Clause _G)
Get all resolvents of factors of F and G, if any. |
java.util.Iterator |
resolveWithVariant(Clause G)
Get all resolvents of variants of F and G, if any. |
java.util.Iterator |
resolveWithVariantFactors(Clause G)
|
boolean |
subsumes(Clause D)
Implements subsumption based on unit input semi-ground resolution. |
Formula |
toFormula()
Convert this clause to a formula representation. |
Clause |
variant(Signature disjointify)
Get a variant of this clause with the given variables renamed. |
Methods inherited from class java.util.HashSet |
---|
add, clear, clone, contains, isEmpty, iterator, remove, size |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Constructor Detail |
---|
public ClauseImpl(java.util.Set literals)
public ClauseImpl()
Method Detail |
---|
protected static ClausalFactory getClausalFactory()
public Signature getFreeVariables()
Clause
getFreeVariables
in interface Clause
public java.util.Iterator resolveWith(Clause G)
Clause
resolveWith
in interface Clause
public java.util.Iterator resolveWithFactors(Clause _G)
Clause
resolveWithFactors
in interface Clause
Clause.factorize()
,
Clause.resolveWith(Clause)
protected Clause resolventWith(Clause G, Formula L, Formula K)
null
if the
resolution of F with G by L and K is impossible because of
mgU{L,¬K}=∅.protected Pair resolventWith2(Clause G, Formula L, Formula K)
(null,null)
.public Clause variant(Signature disjointify)
Clause
variant
in interface Clause
disjointify
- the variables to rename (in order to produce a variable disjoint variant of F relative to some formula G).
disjointify
.public java.util.Iterator resolveWithVariant(Clause G)
Clause
resolveWithVariant
in interface Clause
Clause.variant(Signature)
,
Clause.resolveWith(Clause)
,
Convenience Methodpublic java.util.Iterator resolveWithVariantFactors(Clause G)
public boolean isElementaryValidUnion(Clause G)
Clause
We can forget about elementary valid clauses for resolving false, (essentially) because true formulas will only imply true formulas, never false ones.
isElementaryValidUnion
in interface Clause
G
- a clausepublic boolean isElementaryValid()
Clause
We can forget about elementary valid clauses for resolving false, because true formulas will only imply true formulas, never false ones.
isElementaryValid
in interface Clause
public java.util.Iterator factorize()
Clause
Will implement the factorization rule necessary for binary resolution:
factorize
in interface Clause
∅
if no factorization was possible.protected Clause factorize(java.util.Collection literals)
Will implement the factorization rule necessary for binary resolution:
literals
- the literals {Lk,...,Ln} to factorize to a single literal.
null
if no factorization was possible.protected Pair factorize2(java.util.Collection literals)
(null,null)
.public boolean subsumes(Clause D)
subsumes
in interface Clause
public java.util.Iterator getResolvableLiterals()
Clause
getResolvableLiterals
in interface Clause
public java.util.Iterator getProbableUnifiables(Formula L)
Clause
Implementations may use indexing or links to estimate the clauses to return very quickly. Furthermore, implementations may apply selection refinements.
getProbableUnifiables
in interface Clause
Clause.getUnifiables(Formula)
public java.util.Set getUnifiables(Formula L)
Clause
Implementations may use indexing or links to estimate the clauses to return very quickly. Furthermore, implementations may apply selection refinements.
getUnifiables
in interface Clause
Clause.getProbableUnifiables(Formula)
public Formula toFormula()
Clause
toFormula
in interface Clause
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |