Title: Rule-Based Reasoning
1Rule-Based Reasoning
2Outline
- Rules as a knowledge representation formalism
- Common characteristics of rule-based systems
- Diversity of rules and rule-based reasoning
- Advantages and limitations
- Production rules and systems
- Abstract syntax
- High-level operational semantics
- Example rule bases
- Special cases
- Practical applications
- Rewrite rules and systems
- Abstract syntax
- High-level operational semantics
- Comparison with production rules
- Example rule bases
- Special cases
- Practical applications
- Constraint Handling Rules (CHR)
- Abstract syntax
- Declarative logical semantics
- High-level operational semantics
- Example rule bases
- Comparison with rewrite and production rules
- Extension CHRV
- Practical applications
3Rules as a Knowledge Representation Formalism
- What is a rule?
- A statement that specifies that
- If a determined logical combination of
conditions is satisfied - over the set of perceptions and/or the fluent
facts in an agents Knowledge Base (KB) that
represents the current, past and/or hypothetical
future of its environment model, its goals and/or
its preferences - then a logico-temporal combination of actions
can or must be executed by the agent - on directly on its environment (through
actuators) or on its fluent facts. - A KB agent such that the persistent part of its
KB consists entirely of such rules is called a
rule-base agent - In such case, the inference engine used by the KB
agent is an interpreter or a compiler for a
specific rule language.
4Rule-Based Agent
Environment
Sensors
Ask
Tell
Retract
- Rule Base
- Persistant intentional knowledge,
- specific to application domain,
- but general to problem class
- Declarative code
Effectors
5Rule Languages Common Characteristics
- Syntax generally
- Extends a host programming language and/or
- Restricts a formal logic and/or
- Uses a semi-natural language with a closed
keyword set expressing logical connectives and
actions classes and an open keyword set to refer
to the entities and relations appearing in the
agents fact base - Some systems provide 3 distinct syntax layers
for different users with automated tools to
translate a rule across the various layers - Declarative semantics
- Generally based on some formal logic
- Operational semantics
- Generally based on transition systems, automata
or similar procedural formalisms - Formalizes the essence of the rule interpreter
algorithm.
6Rule Languages General Advantages
- Human experts in many domains (medicine, law,
finance, marketing, administration, design,
engineering, equipment maintenance, games,
sports, etc.) find it intuitive and easy to
formalize their knowledge as a rule base - Facilitates knowledge acquisition
- Rules can be easily paraphrased in semi-natural
language syntax, friendlier to experts averse to
computational languages - Facilitates knowledge acquisition
- Rule bases easy to formalize as logical formulas
(conjunctions of equivalences and/or
implications) - Facilitates building rule engine that perform
sound, logic-based inference - Each rule largely independent of others in the
base (but to precisely what degree depends highly
of the rule engine algorithm) - Can thus be viewed as an encapsulated
declarative piece of knowledge - Facilitates life cycle evolution and composition
of knowledge bases - Very sophisticated, mature rule base compilation
techniques available - Allows scalable inference in practice
- Some engines for simple rule languages can
efficiently handle millions of rules
7Rule Languages General Limitations
- Subtle interactions between rules hard to debug
without sophisticated rule explanation GUI and
detailed knowledge with the rule engines
algorithm - Especially serious with object-oriented rule
languages that combine rule-based deduction or
abduction with class-based inheritance - But purely relational rule-based language do not
naturally - Embed within mainstream object-oriented modeling
and programming languages - Represent inherently procedural knowledge
- Represent taxonomic knowledge
8Rule Languages Diversity
- Production rules
- Event-Condition-Action rules (ECA rules)
- Rewrite rules
- Conditional rewrite rules
- Logic program rules
- Constraint handling rules (CHR)
- Object-oriented rules
- Semantic web service rules (SWS rules)
- Business rules
- Meta-rules
9Production Rules Abstract Syntax
IF (p(X,a) OR p(X,b)) AND
p(Y,Z) AND q(c) AND X ltgt Y AND X gt 3.5 THEN
Z X 12 AND addr(a,c,Z
AND deletep(Y,Z)
Production Rule Base
Production Rule
Right-Hand Side (RHS)
Action
Left-Hand Side (LHS)
Arithmetic Calculation
Fact Base
Fact
2..
Atom
Predicate Symbol
Functor
args
Arithmetic Predicate Symbol
Non-Ground Atom
Non-Functional Term
Ground Atom
Constant Symbol
Arithmetic Constant Symbol
Variable
10Production System Architecture
Fact Base Management Component
Fact Base
Rule Firing Policy Component
Action Execution Component
Pattern Matching Component
Rule Base
Host Language API
Candidate Rules
11Production Rules Operational Semantics
Matching Instantiated Rule Set Empty
Pick one Instantiated Rule to Fire
Match LHS of Rule Base against Fact Base
Matching Instantiated Rule Set
Else
Rule Base
Fact Base
Matching Instantiated Rule Set Singleton
Selected Instantiated Rule
Execute in Sequence Actions in RHS of
Selected Instantiated Rule
12Conflict Resolution Strategies
- Conflict resolution strategy
- Heuristic to choose at each cycle which of the
matching rule set to fire - Common strategies
- Follow writing order of rules in rule base
- Follow absolute priority level annotations
associated with each rule or rule class - Follow relative priority level annotations
associated with pairs of rules or rule classes - Prefer rules whose LHS match the most recently
derived facts in the fact base - Prefer rules that have remained for the longest
time unfired while matching a fact - Apply control meta-rules that declaratively
specify arbitrarily sophisticated strategies
13Production Rule Base ExampleIs West Criminal?
- Production Rule Base
- IF american(P) AND weapon(W) AND nation(N) AND
hostile(N) AND sell(P,N,W) - THEN addcriminal(P)
- IF owns(nono,W) AND missile(W) THEN
addsells(west,nono,W) - IF missile(W) THEN addweapon(W)
- IF enemy(N,america) THEN addhostile(N)
- Initial Fact Base
- owns(nono,m1)
- missile(m1)
- american(west)
- nation(nono)
- enemy(nono,america)
- nation(america)
14Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(P)
weapon(W)
nation(N)
hostile(N)
sells(P,N,W)
sells(west,nono,W)
missile(W)
enemy(N,america)
owns(nono,W)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
15Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(P)
weapon(W)
nation(N)
hostile(N)
sells(P,N,W)
sells(west,nono,W)
missile(m1)
enemy(nono,N)
owns(nono,m1)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
16Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(P)
weapon(m1)
nation(N)
hostile(N)
sells(P,N,W)
sells(west,nono,W)
missile(W)
enemy(nono,N)
owns(nono,W)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
17Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(P)
weapon(m1)
nation(N)
hostile(N)
sells(P,N,W)
sells(west,nono,W)
missile(m1)
enemy(nono,N)
owns(nono,m1)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
18Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(P)
weapon(m1)
nation(N)
hostile(nono)
sells(P,N,W)
sells(west,nono,W)
missile(W)
owns(nono,W)
missile(m1)
american(west)
nation(nono)
enemy(nono,N)
owns(nono,m1)
nation(america)
19Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(P)
weapon(m1)
nation(N)
hostile(nono)
sells(P,N,W)
sells(west,nono,W)
missile(m1)
owns(nono,m1)
missile(m1)
american(west)
nation(nono)
enemy(nono,america)
owns(nono,m1)
nation(america)
20Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(P)
weapon(m1)
nation(N)
hostile(nono)
sells(P,N,W)
sells(west,nono,m1)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
21Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(P)
american(west)
weapon(m1)
nation(nono)
hostile(nono)
sells(west,nono,m1)
sells(west,nono,m1)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
22Production Rule Inference ExampleIs West
Criminal?
criminal(west)?
criminal(west)
weapon(m1)
hostile(nono)
sells(west,nono,m1)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
23Production Rule Inference ExampleIs West
Criminal?
criminal(west)? yes
criminal(west)
weapon(m1)
hostile(nono)
sells(west,nono,m1)
missile(m1)
american(west)
nation(nono)
enermy(nono,america)
owns(nono,m1)
nation(america)
24Properties of Production Systems
- Confluence
- From confluent rule base, same final fact base
is derived independently of rule firing order - Makes values of queries made to the system
independent of the conflict resolution strategy - Termination
- Terminating system does not enter in an infinite
loop - Example of non-termination production rule base
- Initial fact base p(0)
- Production rule base IF p(X) THEN Y X 1 AND
addp(Y) - Any production system which conflict resolution
strategy does not prevent the same rule instance
to be fired in two consecutive cycles is
trivially non-terminating.
25Production System Inference vs.Lifted Forward
Chaining
- Common characteristics
- Data driven reasoning
- Requires conflict resolution strategy to choose
- Which of several matching rules to fire
- Which of several unifying clauses for next Modus
Ponens inference step
- Production System Inference
- Sequential conjunction of actions in rule RHS
- Non-monotonic reasoning due to delete actions
- Matching only Datalog atoms (i.e., atoms which
arguments are all non-functional terms) - Matching ground fact atoms against non-ground
atoms in rule LHS And-Or atom - Neither sound nor complete inference engine
- Lifted Forward Chaining
- Unique conclusion in Horn Clause
- Monotonic reasoning
- Unifying arbitrary first-order atoms, possibly
functional - Unifying two arbitrary atoms, possibly both
non-grounds - Sound and refutation-complete
26Embedded Production System Abstract Syntax
Production Rule Base
Production Rule
Right-Hand Side (RHS)
Action
Fact Base\
Fact
Left-Hand Side (LHS)
HPL Operation
HPL Boolean Operation
HPL Ground Data Structure
HPL Data Structure
2..
args
HPL Operator
HPL Boolean Operator
27Generalized Production Rules ECA Rules
- Event-Condition-Action rule extension of
production rule with triggering event external to
addition of facts in fact base - Only the rule subset which event just occurred is
matched against the fact base - Events thus partition the rule base into subsets,
each one specifying a behavior in response to a
given events
Event Condtion Action Rule
LHS
RHS
Event
Agents Percept
HPL Boolean Operation
28Production SystemsPractical Applications
- Reactive agents
- Expert systems in domains without complex entity
taxonomy nor uncertainty - Business rules
29Semi-Natural Language Syntaxfor Production Rules
- Associate key word or key phrase to
- Each domain model constant, function and
predicate symbol - Each production rule syntactic construct
- Each host programming language construct
- Substitute in place of these constructs and
symbols the associated words or phrase - Example Is West Criminal? in semi-natural
language syntax - IF P is American AND P sells a W to N AND
W is a weapon - AND N is a nation AND N is hostile
- THEN P is a criminal
- IF nono owns a W AND W is a missile THEN west
sells nono to W - IF W is a missile THEN W is a weapon
- IF N is an enemy of America THEN N is hostile
30Rewrite Rules Abstract Syntax
Rewrite Rule Base
Rewrite Rule
- plus(X,0) ? X
- fib(suc(suc(N)))
- ? plus(fib(suc(N)),fib(N))
RHS
LHS
Term
args
non-overlapping, complete
non-overlapping, complete
Functional Term
Non-Functional Term
Ground Term
Non-Ground Term
Function Symbol
Constant Symbol
Variable
31Rewrite Rules Operational Semantics
Rewrite Rule Base
T Term
32Rewrite Rule Base Example
- plus(X,0) ? X
- plus(X,suc(Y)) ? suc(plus(X,Y))
- fib(0) ? suc(0)
- fib(suc(0)) ? suc(0)
- fib(suc(suc(N)) ? plus(fib(suc(N)),fib(N))
- fib(suc(suc(suc(0)))) w/ rule
e - plus(fib(suc(suc(0))),fib(suc(0))) w/ rule d
- plus(fib(suc(suc(0))),suc(0)) w/ rule b
- suc(plus(fib(suc(suc(0))),0)) w/ rule a
- suc(fib(suc(suc(0)))) w/ rule
e - suc(plus(fib(suc(0)),fib(0))) w/ rule c
- suc(plus(fib(suc(0)),suc(0))) w/ rule b
- suc(suc(plus(fib(suc(0)),0))) w/ rule a
- suc(suc(fib(suc(0)))) w/ rule
c - suc(suc(suc(0)))
33Conditional Rewrite RulesAbstract Syntax
Rewrite Rule Base
Rewrite Rule
RHS
LHS
Condition
2
Term
Equation
- Rule with matching LHS can only be fired if
condition is also verified - Proving condition can be recursively done by
rewriting it to true
34Rewrite Rule Base ExampleIs West Criminal?
- Rewrite Rule Base
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(west,nono,W) ? owns(nono,W) ? missile(W)
- hostile(N) ? enemy(N,america)
- weapon(W) ? missile(W)
- owns(nono,m1) ? missile(m1) ? american(west) ?
nation(nono) ? enemy(nono,america) ? true - A ? B ? B ? A
- A ? A ? A
- Term
- criminal(P)
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W)
w/ rule a - american(P) ? weapon(W) ? nation(N) ? hostile(N)
? owns(nono,W) ? missile(W) w/
rule b - american(P) ? weapon(W) ? nation(N) ?
enemy(N,america) ? owns(nono,W) ? missile(W) w/
rule c - american(P) ? missile(W) ? nation(N) ?
enemy(N,america) ? owns(nono,W) ? missile(W)
w/ rule d - american(P) ? missile(W) ? nation(N) ?
enemy(N,america) ? owns(nono,W)
w/ rule g -
...
w/ rule f - owns(nono,W) ? missile(W) ? american(P) ?
nation(N) ? enemy(N,america)
w/ rule f - true
w/ rule e
35Rewriting Systems Practical Application
- Theorem proving
- CASE
- Programming language formal semantics
- Program verification
- Compiler design and implementation
- Model transformation and automatic programming
- Data integration
- Using XSLT an XML-based language to rewrite
XML-based data and documents - Web server pages and web services (also using
XSLT)
36Production Rules vs. Rewriting Rules
- Common characteristics
- Data driven reasoning
- Requires conflict resolution strategy to choose
- Which of several matching rules to fire
- Which of several rules with an LHS unifying with
a sub-term - Non-monotonic reasoning due to
- Fact deletion actions in RHS
- Retraction of substituted sub-term
- Tricky confluence and termination issues
- Production System Inference
- Fact base implicitly conjunctive
- Matching only Datalog atoms (i.e., atoms which
arguments are all non-functional terms) - Matching ground fact atoms against non-ground
atoms in rule LHS And-Or atom
- Term Rewriting
- Reified logical connectives in term provide full
first-order expressivity - Unifying arbitrary first-order atoms, possibly
functional - Unifying two arbitrary atoms, possibly both
non-grounds
37Constraint Handling Rules (CHR)Key Ideas
- Originally a logical rule-based language to
declaratively program specialized constraint
solvers on top of a host programming language
(Prolog, Haskell, Java) - Since evolved in a general purpose first-order
knowledge representation language and
Turing-complete programming language - Fact base contains both extensional and
intentional knowledge in the form of a
conjunction of constraints - Rule base integrates and generalizes
- Event-Condition-Action rules (themselves
generalizing production rules) for constraint
propagation - Conditional rewrite rules for constraint
simplification - Relies on forward chaining and rule LHS matching
- Extended variant CHRV adds backtracking search
and thus generalizes Prolog rules as well
38CHR Syntax Overview
CHR Base
- Simplification rule sh1(X,a), sh2(b,Y)
ltgt g1(X,Y),
g2(a,b,c) b1(X,c), b2(Y,c). - Propagation rule ph1(X,Y), ph2(d)
gt g3(X), g4(d,Y)
b3(X,d), b4(X,Y). - Simpagation rule ph3(X), ph4(Y,Z) \
sh3(X,U), sh4(Y,V) ltgt g5(X,Z), g6(Z,Y)
b5(X), b6(Y,Z). - Simplification rules are conditional rewrite
rules (condition is the guard) - Propagation rules are event-condition-action
rules (event is the guard) - Simpagation rules heads are hybrid syntactic
sugar, each can be replaced by a semantically
equivalent simplification rule, ex, p, r \ s, t
ltgt g, h b, c. is equivalent to p, r, s, t ltgt
g, h p, r, b, c.
Body Rule-Defined and Built-In Constraints
Guard Built-In Constraints (from host
language)
Head Rule-Defined Constraints
39CHR Complete Abstract Syntax
body
guard
0..1
Logical Formula
CHR Rule
2..
simplified head
CHR Base
0..1
And Formula
propagated head
0..1
non-overlapping, complete
Atomic Formula
Simpagation Rule
Simplification Rule
Propagation Rule
40CHR Derivation Data Structures
body
guard
0..1
CHR Logical Formula
CHR Rule
2..
simplified head
CHR Base
0..1
And Formula
propagated head
0..1
arg
Atomic Formula
Simpagation Rule
Simplification Rule
Propagation Rule
Term
Built-In Constraint
Rule Defined Constraint
41CHR Declarative Semantics inClassical
First-Order Logic (CFOL)
- Simplification rule sh1, ... , shi ltgt g1, ...,
gj b1, ..., bk. - where X1, ..., Xn vars(sh1 ? ... ? shi ? g1
? ... ? gj) and Y1, ... , Ym vars(b1 ? ... ?
bk) \ X1, ..., Xn?X1, ..., Xn g1 ? ... ? gj
? (sh1 ? ... ? shi ? ?Y1, ... , Ym b1 ? ... ? bk) - Propagation rule ph1, ... , phi gt g1, ..., gj
b1, ..., bk. - where X1, ..., Xn vars(ph1 ? ... ? phi ? g1
? ... ? gj) and Y1, ... , Ym vars(b1 ? ... ?
bk) \ X1, ..., Xn?X1, ..., Xn g1 ? ... ? gj
? (ph1 ? ... ? phi ? ?Y1, ... , Ym b1 ? ... ? bk)
42CHR Operational Semantics
43CHR Rule Priority Heuristics
- No standard, implementation dependent
- Simplification before simpagation before
propagation - Rule whose head matches the highest number of
RDCS constraints first - Rule matching yet untried for the longest time
first - Writing order
44CHR Base Example Is West Criminal?Goal-Directed
Version with Rewrite Rules
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(P,N,W) ? N nono ? P west owns(N,W) ?
missile(W) - hostile(N) ? M america enemy(N,M)
- weapon(W) ? missile(W)
- owns(N,W) ? missile(W) ? american(P) ? nation(N)
? enemy(N,M) ? N nono ? W m1 ? P west ? M
america true
Rule Goal UDCS BICS
criminal(P) true true
45CHR Base Example Is West Criminal?Goal-Directed
Version with Rewrite Rules
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(P,N,W) ? N nono ? P west owns(N,W) ?
missile(W) - hostile(N) ? M america enemy(N,M)
- weapon(W) ? missile(W)
- owns(N,W) ? missile(W) ? american(P) ? nation(N)
? enemy(N,M) ? N nono ? W m1 ? P west ? M
america true
Rule Goal UDCS BICS
criminal(P) true true
true criminal(P) true
46CHR Base Example Is West Criminal?Goal-Directed
Version with Rewrite Rules
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(P,N,W) ? N nono ? P west owns(N,W) ?
missile(W) - hostile(N) ? M america enemy(N,M)
- weapon(W) ? missile(W)
- owns(N,W) ? missile(W) ? american(P) ? nation(N)
? enemy(N,M) ? N nono ? W m1 ? P west ? M
america true
Rule Goal UDCS BICS
criminal(P) true true
true criminal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
47CHR Base Example Is West Criminal?Goal-Directed
Version with Rewrite Rules
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(P,N,W) ? N nono ? P west owns(N,W) ?
missile(W) - hostile(N) ? M america enemy(N,M)
- weapon(W) ? missile(W)
- owns(N,W) ? missile(W) ? american(P) ? nation(N)
? enemy(N,M) ? N nono ? W m1 ? P west ? M
america true
Rule Goal UDCS BICS
criminal(P) true true
true criminal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
b) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? owns(N,W) ? missile(W) N nono ? P west
48CHR Base Example Is West Criminal?Goal-Directed
Version with Rewrite Rules
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(P,N,W) ? N nono ? P west owns(N,W) ?
missile(W) - hostile(N) ? M america enemy(N,M)
- weapon(W) ? missile(W)
- owns(N,W) ? missile(W) ? american(P) ? nation(N)
? enemy(N,M) ? N nono ? W m1 ? P west ? M
america true
Rule Goal UDCS BICS
criminal(P) true true
true criminal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
b) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? owns(N,W) ? missile(W) N nono ? P west
c) true american(P) ? weapon(W) ? nation(N) ? enemy(N,M) ? owns(N,W) ? missile(W) N nono ? P west ? M america
49CHR Base Example Is West Criminal?Goal-Directed
Version with Rewrite Rules
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(P,N,W) ? N nono ? P west owns(N,W) ?
missile(W) - hostile(N) ? M america enemy(N,M)
- weapon(W) ? missile(W)
- owns(N,W) ? missile(W) ? american(P) ? nation(N)
? enemy(N,M) ? N nono ? W m1 ? P west ? M
america true
Rule Goal UDCS BICS
criminal(P) true true
true criminal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
b) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? owns(N,W) ? missile(W) N nono ? P west
c) true american(P) ? weapon(W) ? nation(N) ? enemy(N,M) ? owns(N,W) ? missile(W) N nono ? P west ? M america
d) true american(P) ? nation(N) ? enemy(N,M) ? owns(N,W) ? missile(W) N nono ? P west ? M america
50CHR Base Example Is West Criminal?Goal-Directed
Version with Rewrite Rules
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(P,N,W) ? N nono ? P west owns(N,W) ?
missile(W) - hostile(N) ? M america enemy(N,M)
- weapon(W) ? missile(W)
- owns(N,W) ? missile(W) ? american(P) ? nation(N)
? enemy(N,M) ? N nono ? W m1 ? P west ? M
america true
Rule Goal UDCS BICS
criminal(P) true true
true criminal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
b) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? owns(N,W) ? missile(W) N nono ? P west
c) true american(P) ? weapon(W) ? nation(N) ? enemy(N,M) ? owns(N,W) ? missile(W) N nono ? P west ? M america
d) true american(P) ? nation(N) ? enemy(N,M) ? owns(N,W) ? missile(W) N nono ? P west ? M america
e) true true N nono ? P west ? M america ? W m1
51CHR Base Example Is West Criminal?CHR are
matched not unified with constraint store
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(west,nono,W) ? owns(nono,W) ? missile(W)
- hostile(N) ? enemy(N,america)
- weapon(W) ? missile(W)
- owns(nono,m1) ? missile(m1) ? american(west) ?
nation(nono) ? enemy(nono,america) ? true
Rule Goal UDCS BICS
criminal(P) true true
52CHR Base Example Is West Criminal?CHR are
matched not unified with constraint store
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(west,nono,W) ? owns(nono,W) ? missile(W)
- hostile(N) ? enemy(N,america)
- weapon(W) ? missile(W)
- owns(nono,m1) ? missile(m1) ? american(west) ?
nation(nono) ? enemy(nono,america) ? true
Rule Goal UDCS BICS
criminal(P) true true
true crimimal(P) true
53CHR Base Example Is West Criminal?CHR are
matched not unified with constraint store
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(west,nono,W) ? owns(nono,W) ? missile(W)
- hostile(N) ? enemy(N,america)
- weapon(W) ? missile(W)
- owns(nono,m1) ? missile(m1) ? american(west) ?
nation(nono) ? enemy(nono,america) ? true
Rule Goal UDCS BICS
criminal(P) true true
true crimimal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
head sells(west,nono,W) unifies with constraint
sells(P,N,W) but does not match it!
54CHR Base Example Is West Criminal?CHR are
matched not unified with constraint store
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(west,nono,W) ? owns(nono,W) ? missile(W)
- hostile(N) ? enemy(N,america)
- weapon(W) ? missile(W)
- owns(nono,m1) ? missile(m1) ? american(west) ?
nation(nono) ? enemy(nono,america) ? true
Rule Goal UDCS BICS
criminal(P) true true
true crimimal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
c) true american(P) ? weapon(W) ? nation(N) ? enemy(N,america) ? sells(P,N,W) true
55CHR Base Example Is West Criminal?CHR are
matched not unified with constraint store
- criminal(P) ? american(P) ? weapon(W) ? nation(N)
? hostile(N) ? sells(P,N,W) - sells(west,nono,W) ? owns(nono,W) ? missile(W)
- hostile(N) ? enemy(N,america)
- weapon(W) ? missile(W)
- owns(nono,m1) ? missile(m1) ? american(west) ?
nation(nono) ? enemy(nono,america) ? true
Rule Goal UDCS BICS
criminal(P) true true
true crimimal(P) true
a) true american(P) ? weapon(W) ? nation(N) ? hostile(N) ? sells(P,N,W) true
c) true american(P) ? weapon(W) ? nation(N) ? enemy(N,america) ? sells(P,N,W) true
d) true american(P) ? missile(W) ? nation(N) ? enemy(N,america) ? sells(P,N,W) true
- No new rule applies
- Neither positive nor negative conclusion can be
reached about the goal to prove - Like CFOL and unlike Prolog and production
systems, CHR makes open-world assumption - Thus, lack of proof for the goal does not result
in negative conclusion
56CHR Base Example Is West Criminal?Data-Driven
Version with Production Rules
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(N,W) ? missile(W) ? N nono ? P west
sells(P,N,W) - enemy(N,M) ? M america hostile(N)
- missile(W) ? weapon(W)
- start ? N nono ? W m1 ? P west ? M
america owns(N,W) ? missile(W) ?
american(P) ? nation(N) ? enemy(N,M)
Rule Goal UDCS BICS
start true true
57CHR Base Example Is West Criminal?Data-Driven
Version with Production Rules
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(N,W) ? missile(W) ? N nono ? P west
sells(P,N,W) - enemy(N,M) ? M america hostile(N)
- missile(W) ? weapon(W)
- start ? N nono ? W m1 ? P west ? M
america owns(N,W) ? missile(W) ?
american(P) ? nation(N) ? enemy(N,M)
Rule Goal UDCS BICS
start true true
true start true
58CHR Base Example Is West Criminal?Data-Driven
Version with Production Rules
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(N,W) ? missile(W) ? N nono ? P west
sells(P,N,W) - enemy(N,M) ? M america hostile(N)
- missile(W) ? weapon(W)
- start ? N nono ? W m1 ? P west ? M
america owns(N,W) ? missile(W) ?
american(P) ? nation(N) ? enemy(N,M)
Rule Goal UDCS BICS
start true true
true start true
e) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) N nono ? W m1 ? P west ? M america
59CHR Base Example Is West Criminal?Data-Driven
Version with Production Rules
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(N,W) ? missile(W) ? N nono ? P west
sells(P,N,W) - enemy(N,M) ? M america hostile(N)
- missile(W) ? weapon(W)
- start ? N nono ? W m1 ? P west ? M
america owns(N,W) ? missile(W) ?
american(P) ? nation(N) ? enemy(N,M)
Rule Goal UDCS BICS
start true true
true start true
e) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) N nono ? W m1 ? P west ? M america
b) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) N nono ? W m1 ? P west ? M america
60CHR Base Example Is West Criminal?Data-Driven
Version with Production Rules
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(N,W) ? missile(W) ? N nono ? P west
sells(P,N,W) - enemy(N,M) ? M america hostile(N)
- missile(W) ? weapon(W)
- start ? N nono ? W m1 ? P west ? M
america owns(N,W) ? missile(W) ?
american(P) ? nation(N) ? enemy(N,M)
Rule Goal UDCS BICS
start true true
true start true
e) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) N nono ? W m1 ? P west ? M america
b) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) N nono ? W m1 ? P west ? M america
c) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) ? hostile(N) N nono ? W m1 ? P west ? M america
61CHR Base Example Is West Criminal?Data-Driven
Version with Production Rules
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(N,W) ? missile(W) ? N nono ? P west
sells(P,N,W) - enemy(N,M) ? M america hostile(N)
- missile(W) ? weapon(W)
- start ? N nono ? W m1 ? P west ? M
america owns(N,W) ? missile(W) ?
american(P) ? nation(N) ? enemy(N,M)
Rule Goal UDCS BICS
start true true
true start true
e) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) N nono ? W m1 ? P west ? M america
b) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) N nono ? W m1 ? P west ? M america
c) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) ? hostile(N) N nono ? W m1 ? P west ? M america
d) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) ? hostile(N) ? weapon(W) N nono ? W m1 ? P west ? M america
62CHR Base Example Is West Criminal?Data-Driven
Version with Production Rules
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(N,W) ? missile(W) ? N nono ? P west
sells(P,N,W) - enemy(N,M) ? M america hostile(N)
- missile(W) ? weapon(W)
- start ? N nono ? W m1 ? P west ? M
america owns(N,W) ? missile(W) ?
american(P) ? nation(N) ? enemy(N,M)
Rule Goal UDCS BICS
start true true
true start true
e) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) N nono ? W m1 ? P west ? M america
b) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) N nono ? W m1 ? P west ? M america
c) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) ? hostile(N) N nono ? W m1 ? P west ? M america
d) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) ? hostile(N) ? weapon(W) N nono ? W m1 ? P west ? M america
a) true start ? owns(N,W) ? missile(W) ? american(P) ? nation(N) ? enemy(N,M) ? sells(P,N,W) ? hostile(N) ? weapon(W) ) ? criminal(P) N nono ? W m1 ? P west ? M america
63CHR Base Example Is West Criminal?Data Driven
Version with Partially Instantiated Heads
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(nono,W) ? missile(W) ? sells(west,nono,W)
- enemy(N,america) ? hostile(N)
- missile(W) ? weapon(W)
- start ? owns(nono,m1) ? missile(m1) ?
american(west) ? nation(nono) ?
enemy(nono,america)
Rule Goal UDCS BICS
start true true
64CHR Base Example Is West Criminal?Data Driven
Version with Partially Instantiated Heads
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(nono,W) ? missile(W) ? sells(west,nono,W)
- enemy(N,america) ? hostile(N)
- missile(W) ? weapon(W)
- start ? owns(nono,m1) ? missile(m1) ?
american(west) ? nation(nono) ?
enemy(nono,america)
Rule Goal UDCS BICS
start true true
true start true
65CHR Base Example Is West Criminal?Data Driven
Version w/ Partially Instantiated Heads
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(nono,W) ? missile(W) ? sells(west,nono,W)
- enemy(N,america) ? hostile(N)
- missile(W) ? weapon(W)
- start ? owns(nono,m1) ? missile(m1) ?
american(west) ? nation(nono) ?
enemy(nono,america)
Rule Goal UDCS BICS
start true true
true start true
e) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) true
66CHR Base Example Is West Criminal?Data Driven
Version w/ Partially Instantiated Heads
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(nono,W) ? missile(W) ? sells(west,nono,W)
- enemy(N,america) ? hostile(N)
- missile(W) ? weapon(W)
- start ? owns(nono,m1) ? missile(m1) ?
american(west) ? nation(nono) ?
enemy(nono,america)
Rule Goal UDCS BICS
start true true
true start true
e) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) true
b) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) true
67CHR Base Example Is West Criminal?Data Driven
Version w/ Partially Instantiated Heads
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(nono,W) ? missile(W) ? sells(west,nono,W)
- enemy(N,america) ? hostile(N)
- missile(W) ? weapon(W)
- start ? owns(nono,m1) ? missile(m1) ?
american(west) ? nation(nono) ?
enemy(nono,america)
Rule Goal UDCS BICS
start true true
true start true
e) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) true
b) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) true
c) owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) ? hostile(N) true
68CHR Base Example Is West Criminal?Data Driven
Version w/ Partially Instantiated Heads
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(nono,W) ? missile(W) ? sells(west,nono,W)
- enemy(N,america) ? hostile(N)
- missile(W) ? weapon(W)
- start ? owns(nono,m1) ? missile(m1) ?
american(west) ? nation(nono) ?
enemy(nono,america)
Rule Goal UDCS BICS
start true true
true start true
e) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) true
b) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) true
c) owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) ? hostile(N) true
d) owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) ? hostile(N) ? weapon(m1) true
69CHR Base Example Is West Criminal?Data Driven
Version w/ Partially Instantiated Heads
- american(P) ? weapon(W) ? nation(N) ? hostile(N)
? sells(P,N,W) ? criminal(P) - owns(nono,W) ? missile(W) ? sells(west,nono,W)
- enemy(N,america) ? hostile(N)
- missile(W) ? weapon(W)
- start ? owns(nono,m1) ? missile(m1) ?
american(west) ? nation(nono) ?
enemy(nono,america)
Rule Goal UDCS BICS
start true true
true start true
e) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) true
b) true owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) true
c) owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) ? hostile(N) true
d) owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) ? hostile(N) ? weapon(m1) true
a) owns(nono,m1) ? missile(m1) ? american(west) ? nation(nono) ? enemy(nono,america) ? sells(west,nono,m1) ? hostile(N) ? weapon(m1) ? criminal(west) true
70CHRV Abstract Syntax
2..
body
guard
0..1
CHR Rule
And Formula
Tried Alternative Body
simplified head
CHR Base
0..1
propagated head
0..1
Atomic Formula
Fired Rule
Simpagation Rule
Simplification Rule
Propagation Rule
Constraint
ordered
Built-In Constraint
Rule Defined Constraint
Built-In Constraint Store
Rule Defined Constraint Store
Derivation State
CHR Derivation
true
false
71CHRV Declarative Semantics inClassical
First-Order Logic (CFOL)
- Simplification rule sh1, ... , shi ltgt g1, ...,
gj b11, ..., bkp ... b11, ..., blq. - where X1, ..., Xn vars(sh1 ? ... ? shi ? g1
? ... ? gj) and Y1, ... , Ym vars(b1 ? ... ?
bk) \ X1, ..., Xn?X1, ..., Xn g1 ? ... ? gj
? (sh1 ? ... ? shi ?
?Y1, ... , Ym ((b11 ? ... ?
bkp) ? ... ? (b11 ? ... ? bkq)) - Propagation rule ph1, ... , phi gt g1, ..., gj
b11, ..., bkp ... b11, ..., blq. - where X1, ..., Xn vars(ph1 ? ... ? phi
? g1 ? ... ? gj) and Y1, ... , Ym vars(b1 ?
... ? bk) \ X1, ..., Xn?X1, ..., Xn g1 ? ...
? gj ? (ph1 ? ... ? phi ?
?Y1, ... , Ym ((b11 ? ...
? bkp) ? ... ? (b11 ? ... ? bkq))
72CHRV Operational Semantics
- When rule R with disjunctive body B1 ... Bk
is fired - Update both constraint stores using B1
- Start next matching-updating cycle
- When BICS false or when no rule matches the
RDCS - Backtrack to last alternative body Bi
- Restore both constraint stores to their states
prior to their update with Bi - Update both constraint stores using Bi1
- Start next matching-updating cycle
- Exhaustively try all alternative bodies of all
fired rules through backtracking
73CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltgd Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
74CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
75CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
76CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
77CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
78CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
79CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
80CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
e) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996, enrolled(john,cs50,T), T lt 1996 true
81CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
e) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996, enrolled(john,cs50,T), T lt 1996 true
a1) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
82CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
e) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996, enrolled(john,cs50,T), T lt 1996 true
a1) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
c) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996, T lt 1994 true
83CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
e) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996, enrolled(john,cs50,T), T lt 1996 true
a1) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
c) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996, T lt 1994 true
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1994 1994 ltgd 1996
84CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
e) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996, enrolled(john,cs50,T), T lt 1996 true
a1) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
c) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996, T lt 1994 true
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1994 1994 ltgd 1996
a2) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
85CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
e) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996, enrolled(john,cs50,T), T lt 1996 true
a1) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
c) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996, T lt 1994 true
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1994 1994 ltgd 1996
a2) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
d) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996, T' gt 1996 true
86CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 false
a2) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996 true
e) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 gt 1996, enrolled(john,cs50,T), T lt 1996 true
a1) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
c) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996, T lt 1994 true
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1994 1994 ltgd 1996
a2) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 true
d) enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996, T gt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T) true, false
87CHRV Base Example Course Enrollment
- enrolled(john,C,T) gt T lt 1994 T gt 1996.
- enrolled(S,C,T), prereq(C,C) gt
enrolled(S,C,T), T lt T. - XltY, XltZ ltgt Y ltground Z X lt Y.
- X ltY, X gt Y ltgt false.
- X gt X ltgt true.
- X lt Y ltgt gd(X), gd(Y) X ltgd Y
Rule UDCS BICS
a1) enrolled(john,cs100,1996), prereq(cs100,cs50) true
b) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994 true
f) enrolled(john,cs100,1996), prereq(cs100,cs50), 1996 lt 1994, enrolled(john,cs50,T), T lt 1996 true
solve enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(john,cs50,T), T lt 1996 gd(1996), gd(1994),1996 ltgd 1994
bt enrolled(john,cs100,1996), prereq(cs100,cs50), enrolled(