0% found this document useful (0 votes)
27 views

Week 11 Recursion and Negation-As-Failure

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Week 11 Recursion and Negation-As-Failure

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Recursive

Logic Programing
-> Arecursive definite clause rule is one in which the
same
predicate symbol appears in both the head and
tail of the (typically with different arguments
rule

Ancestor (x,y), Parent(y, z) Ancestor (n,z)


->

resolution the
->
procedure
the
is
exactly same but we

may
need to
apply same rule multiple times

-> We also need base case for recursive rule


a

without a base case, program


as
may keep
looping Parent(x,y) Ancestor (x,
e) ->
y)
-> It is
possible to have more than one base case if
needed.

->
The of the rule and the position of the repeated
placementthe
predicate in tail of the rule may affect the order
in which backtracking occurs.
Recursion in
Propositional logic
- We also encounter recursive rules in
may
propositional logic prog butthese are
typicalor
unhelpful and should ramming
- some cases of recursion
may not be obvious and
the order of the
success or failure may depend on
rules

Negation -
as -

Failure

the principlein logicprogrammingwherealiterest


->

From the logic program p

-> Extended Definite Clause is a definite clause of


the form

Vx, URK
....
CA, ...
. .

.
An. not B, Bm-c)
...
not
Universal duantifiers Quantifier free -

not
definite clause (with

Where not B is a new Boolean connective distinct from


-> B used to indicate negation
-

as -

failure
->
Extended Logic Programs are
any of extented
definite clauses in rule form.

You might also like