@Deprecated public class LogicalPropositionTree extends Object
LogicalPropositionTree
object is a boolean logical evaluator
with support for evaluating propositions into boolean values and evaluating
complex boolean expressions. The language that it supports is below. Every
expression is defined by a string.
==
dtrue
if c and d are
identical; false
otherwise.!=
dfalse
if c and d are
identical; true
otherwise.<
dtrue
if c and d are both a
number and c is less than d or if
c and d are both strings and c
is lexigraphically before d; false
otherwise.<=
d<
d ||
c ==
d.>
dtrue
if c and d are both a
number and c is greater than d or if
c and d are both strings and c
is lexigraphically after d; false
otherwise.>=
d>
d ||
c ==
d.=re
dtrue
if c is a string that
matches the regular expression d; false
otherwise.||
bfalse
if a and b both
evaluate to false
; true
otherwise.&&
btrue
if a and b both
evaluate to true
; false
otherwise.!
btrue
if b evaluates to
false
; false
otherwise.->
bfalse
if a evaluates to
true
and b evaluates to false
;
true
otherwise.<-
bfalse
if a evaluates to
false
and b evaluates to true
;
true
otherwise.<>
btrue
if a and b both
evaluate to the same truth value; false
otherwise."
.*"
that evaluates to the
string contained in the quotes ("
s).PropertiesMap
that evaluates to a boolean, a
string or a number.true
or the value
false
.Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
BooleanNode
,
LogicalNode
,
PropositionNode
,
DataNode
,
PropertyNode
,
StringLiteralNode
,
NumberLiteralNode
,
LogicalPropositionTreeException
Modifier and Type | Field and Description |
---|---|
private BooleanNode |
root
Deprecated.
|
private String |
treeString
Deprecated.
|
Constructor and Description |
---|
LogicalPropositionTree(String newTreeString)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
private void |
buildTree()
Deprecated.
|
boolean |
evaluate(PropertiesMap map)
Deprecated.
Returns the truth value of the tree with the given context, either
true or false . |
String |
getTreeString()
Deprecated.
|
void |
setTreeString(String newTreeString)
Deprecated.
|
private BooleanNode root
private String treeString
public LogicalPropositionTree(String newTreeString)
public String getTreeString()
public void setTreeString(String newTreeString)
public boolean evaluate(PropertiesMap map)
true
or false
.map
- The context within which we are evaluating the truth value.
Defines the type and value of all properties in the tree during the
evaluation.true
or false
.LogicalPropositionTreeException
- If there was a problem determining
the truth value. Usually because a property was referenced as the wrong
type or did not exist.private void buildTree()