|
JTP API Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jtp.rs.RSUtils
Utility methods for ReasoningStep
s.
Constructor Summary | |
RSUtils()
|
Method Summary | |
static ReasoningStepIterator |
concatenate(ReasoningStepIterator[] rss)
Given an array of ReasoningStepIterators, returns a single ReasoningStepIterator that iterates over all ReasoningSteps in each ReasoningStepIterator of the array in order. |
static ReasoningStepIterator |
concatenate(ReasoningStepIterator rsi1,
ReasoningStepIterator rsi2)
Given two ReasoningStepIterators, returns a single ReasoningStepIterator that iterates over all ReasoningSteps in rsi1 and then rsi2 . |
static ReasoningStepIterator |
concatenate(ReasoningStepIterator rsi1,
ReasoningStepIterator rsi2,
ReasoningStepIterator rsi3)
Given three ReasoningStepIterators, returns a single ReasoningStepIterator that iterates over all ReasoningSteps in rsi1 , then rsi2 , then rsi3 . |
static int |
getNestingDepth(ReasoningStep rs)
Return the depth of the proof tree that rs is the
root of. |
static Map |
getRecursiveBindings(Proof rs,
Map collector)
Recursively collects bindings
from rs and all of its
child proofs in the proof
tree below it. |
static String |
printReasoningStep(ReasoningStep rs,
String prefix)
Creates a String representation of a ReasoningStep. |
static String |
printReasoningStepIterator(ReasoningStepIterator rsi,
String prefix)
Creates a String representation of a ReasoningStepIterator. |
static void |
recursiveBacktrack(ReasoningStep rs)
Unbinds nested Variables in a ReasoningStep. |
static ReasoningStep |
recursiveClone(ReasoningStep rs)
Constructs a ReasoningStep clone by cloning it and recursively cloning its subproofs as well. |
static void |
recursiveMakeStep(ReasoningStep rs)
Binds nested Variables in a ReasoningStep. |
static Map |
variableStackToMap(List varStack,
Map m)
Deprecated. use SubstUtils.variableStackToMap(List, Map) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RSUtils()
Method Detail |
public static Map variableStackToMap(List varStack, Map m)
SubstUtils.variableStackToMap(List, Map)
public static void recursiveMakeStep(ReasoningStep rs)
ReasoningStep.makeStep()
on
rs
and its subproofs
.
rs
- a ReasoningStep that is to have its Variables boundpublic static void recursiveBacktrack(ReasoningStep rs)
ReasoningStep.backtrack()
on
rs
and its subproofs
.
rs
- a ReasoningStep that is to have its Variables unboundpublic static ReasoningStep recursiveClone(ReasoningStep rs)
subproofs
as well.
rs
- the ReasoningStep to be cloned
rs
public static Map getRecursiveBindings(Proof rs, Map collector)
bindings
from rs
and all of its
child
proofs in the proof
tree below it.
rs
- a Proof from which bindings are to be recursively collectedcollector
- a Map in which collected bindings will be placed. If null, a HashMap
will be created and returned.
public static String printReasoningStepIterator(ReasoningStepIterator rsi, String prefix) throws ReasoningException
ReasoningStepIterator.next()
and printed to a String
with printReasoningStep(ReasoningStep, String)
.
rsi
- a ReasoningStepIteratorprefix
- a String that will be prepended to each line in the String representation returned
rsi
ReasoningException
public static String printReasoningStep(ReasoningStep rs, String prefix)
class
,
goal
,
description
,
bindings
,
and subgoals
included in the String.
Subproofs
will be recursively
added to the returned String; each child proof will be indented by
one more space than its parent.
rs
- a ReasoningStepprefix
- a String that will be prepended to each line in the String representation returned
rs
public static int getNestingDepth(ReasoningStep rs)
rs
is the
root of.
rs
- a ReasoningStep
public static ReasoningStepIterator concatenate(ReasoningStepIterator rsi1, ReasoningStepIterator rsi2)
rsi1
and then rsi2
.
rsi1
- a ReasoningStepIteratorrsi2
- a ReasoningStepIterator
rsi1
and rsi2
public static ReasoningStepIterator concatenate(ReasoningStepIterator rsi1, ReasoningStepIterator rsi2, ReasoningStepIterator rsi3)
rsi1
, then rsi2
, then rsi3
.
rsi1
- a ReasoningStepIteratorrsi2
- a ReasoningStepIteratorrsi3
- a ReasoningStepIterator
rsi1
, rsi2
, and rsi3
public static ReasoningStepIterator concatenate(ReasoningStepIterator[] rss)
rss
- an array of ReasoningStepIterators
rss
|
JTP API Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |