AI algorithms data structures and idioms in Prolog Lisp and Java 6th Edition George F. Luger - Download the full ebook set with all chapters in PDF format
AI algorithms data structures and idioms in Prolog Lisp and Java 6th Edition George F. Luger - Download the full ebook set with all chapters in PDF format
https://ebookultra.com/download/data-structures-and-algorithms-in-
java-6th-edition-michael-t-goodrich/
https://ebookultra.com/download/artificial-intelligence-structures-
and-strategies-for-complex-problem-solving-6th-edition-george-f-luger/
https://ebookultra.com/download/data-structures-and-algorithms-in-
java-4th-edition-michael-t-goodrich/
https://ebookultra.com/download/learning-f-functional-data-structures-
and-algorithms-1st-edition-masood/
Artificial Intelligence Structures and Strategies for
Complex Problem Solving 5th Edition George F. Luger
https://ebookultra.com/download/artificial-intelligence-structures-
and-strategies-for-complex-problem-solving-5th-edition-george-f-luger/
https://ebookultra.com/download/java-collections-an-introduction-to-
abstract-data-types-data-structures-and-algorithms-1st-edition-david-
a-watt/
https://ebookultra.com/download/growing-algorithms-and-data-
structures-4th-edition-david-scuse/
https://ebookultra.com/download/data-structures-algorithms-in-go-1st-
edition-hemant-jain/
https://ebookultra.com/download/learning-javascript-data-structures-
and-algorithms-2nd-edition-loiane-groner/
AI algorithms data structures and idioms in Prolog Lisp
and Java 6th Edition George F. Luger Digital Instant
Download
Author(s): George F. Luger, William A. Stubblefield
ISBN(s): 9780136070474, 0136070477
Edition: 6
File Details: PDF, 2.27 MB
Year: 2009
Language: english
Luger_all_wcopyright_COsfixed.pd2 2 5/15/2008 6:34:39 PM
AI Algorithms, Data Structures, and
Idioms in Prolog, Lisp, and Java
George F. Luger
William A. Stubblefield
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and Addison-Wesley was aware of a
trademark claim, the designations have been printed in initial caps or all caps.
Copyright © 2009 Pearson Education, Inc. All rights reserved. No part of this publication may be
reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic,
mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher.
Printed in the United States of America. For information on obtaining permission for use of material in this
work, please submit a written request to Pearson Education, Inc., Rights and Contracts Department, 501
Boylston Street, Suite 900, Boston, MA 02116, fax (617) 671-3447, or online at
http://www.pearsoned.com/legal/permissions.htm.
ISBN-13: 978-0-13-607047-4
ISBN-10: 0-13-607047-7
1 2 3 4 5 6 7 8 9 10—OPM—12 11 10 09 08
Exercises 266
Chapter 26 Case Studies: JESS and other Expert System Shells in Java 363
26.1 Introduction 363
26.2 JESS 363
26.3 Other Expert system Shells 364
26.4 Using Open Source Tools 365
Chapter 31 Case Studies: Java Natural Language Tools on the Web 423
31.1 Java Natural Language Processing Software 423
31.2 LingPipe from the University of Pennsylvania 423
31.3 The Stanford Natural Language Processing Group Software 425
31.4 Sun’s Speech API 426
Bibliography 439
Index 443
- Aristotle, Ethics
Why Another Writing a book about designing and implementing representations and
Programming search algorithms in Prolog, Lisp, and Java presents the authors with a
Language number of exciting opportunities.
Book?
The first opportunity is the chance to compare three languages that give
very different expression to the many ideas that have shaped the evolution
of programming languages as a whole. These core ideas, which also
support modern AI technology, include functional programming, list
processing, predicate logic, declarative representation, dynamic binding,
meta-linguistic abstraction, strong-typing, meta-circular definition, and
object-oriented design and programming. Lisp and Prolog are, of course,
widely recognized for their contributions to the evolution, theory, and
practice of programming language design. Java, the youngest of this trio, is
both an example of how the ideas pioneered in these earlier languages
have shaped modern applicative programming, as well as a powerful tool
for delivering AI applications on personal computers, local networks, and
the world wide web.
The second opportunity this book affords is a chance to look at Artificial
Intelligence from the point of view of the craft of programming. Although
we sometimes are tempted to think of AI as a theoretical position on the
nature of intelligent activity, the complexity of the problems AI addresses
has made it a primary driver of progress in programming languages,
development environments, and software engineering methods. Both Lisp
and Prolog originated expressly as tools to address the demands of
symbolic computing. Java draws on object-orientation and other ideas that
can trace their roots back to AI programming. What is more important, AI
has done much to shape our thinking about program organization, data
structures, knowledge representation, and other elements of the software
craft. Anyone who understands how to give a simple, elegant formulation
to unification-based pattern matching, logical inference, machine learning
theories, and the other algorithms discussed in this book has taken a large
step toward becoming a master programmer.
The book’s third, and in a sense, unifying focus lies at the intersection of
these points of view: how does a programming language’s formal structure
interact with the demands of the art and practice of programming to
xi
create the idioms that define its accepted use. By idiom, we mean a set of
conventionally accepted patterns for using the language in practice.
Although not the only way of using a language, an idiom defines patterns
of use that have proven effective, and constitute a common understanding
among programmers of how to use the language. Programming language
idioms do much to both enable, as well as support, ongoing
communication and collaboration between programmers.
These, then, are the three points of view that shape our discussion of AI
programming. It is our hope that they will help to make this book more
than a practical guide to advanced programming techniques (although it is
certainly that). We hope that they will communicate the intellectual depth
and pleasure that we have found in mastering a programming language
and using it to create elegant and powerful computer programs.
The Design of There are five sections of this book. The first, made up of a single chapter,
this Book lays the conceptual groundwork for the sections that follow. This first
chapter provides a general introduction to programming languages and
style, and asks questions such as “What is a master programmer?” What is a
programming language idiom?,” and “How are identical design patterns
implemented in different languages?” Next, we introduce a number of
design patterns specific to supporting data structures and search strategies
for complex problem solving. These patterns are discussed in a “language
neutral” context, with pointers to the specifics of the individual
programming paradigms presented in the subsequent sections of our
book. The first chapter ends with a short historical overview of the
evolution of the logic-based, functional, and object-oriented approaches to
computer programming languages.
Part II of this book presents Prolog. For readers that know the rudiments
of first-order predicate logic, the chapters of Part II can be seen as a
tutorial introduction to Prolog, the language for programming in logic.
For readers lacking any knowledge of the propositional and predicate
calculi we recommend reviewing an introductory textbook on logic.
Alternatively, Luger (2005, Chapter 2) presents a full introduction to both
the propositional and predicate logics. The Luger introduction includes a
discussion, as well as a pseudo code implementation, of unification, the
pattern-matching algorithm at the heart of the Prolog engine.
The design patterns that make up Part II begin with the “flat” logic-based
representation for facts, rules, and goals that one might expect in any
relational data base formalism. We next show how recursion, supported by
unification-based pattern matching, provides a natural design pattern for
tree and graph search algorithms. We then build a series of abstract data
types, including sets, stacks, queues, and priority queues that support
patterns for search. These are, of course, abstract structures, crafted for
the specifics of the logic-programming environment that can search across
state spaces of arbitrary content and complexity. We then build and
demonstrate the “production system” design pattern that supports rule
based programming, planning, and a large number of other AI
technologies. Next, we present structured representations, including
GL
BS
July 2008
Albuquerque
all good things - trout as well as eternal salvation - come by grace and grace comes by art and art does not
come easy…
CHAPTER XXIV.
CHAPTER XXV.
In the morning, after breakfast in the little Saxe room, she said to
him with gentle firmness: 'Réné, you must tell me now—why have
you refused Russia?'
He had known that the question must come, and all the way on his
homeward journey he had been revolving in his mind the answer he
would give to it. He was very pale, but otherwise he betrayed no
agitation as he turned and looked at her.
'That is what I cannot tell you,' he replied.
She could not believe she heard aright.
'What do you mean?' she asked him. 'I have had a message from
Kunst; he is deeply angered. I understand that, after all was
arranged, you abruptly resigned the Russian mission. I ask your
reasons. It is a very grave step to have taken. I suppose your
motives must be very strong ones?'
'They are so,' said Sabran; and he continued in the forced and
measured tone of one who recites what he has taught himself to
say: 'It is quite natural that your cousin Kunst should be offended;
the Emperor also. You perhaps will be the same when I say to you
that I cannot tell you, as I cannot tell them, the grounds of my
withdrawal. Perhaps you, like them, will not forgive it.'
Her nostrils dilated and her breast heaved: she was startled,
mortified, amazed. 'You do not choose to tell me!' she said in
stupefaction.
'I cannot tell you.'
'She gazed at him with the first bitterness of wrath that he had ever
seen upon her face. She had been used to perfect submission of
others all her life. She had the blood in her of stern princes, who had
meted out rule and justice against which there had been no appeal.
She was accustomed even in him to deference, homage,
consideration, to be consulted always, deferred to often. His answer
for the moment seemed to her an unwarrantable insult.
Her influence, her relatives, her sovereign, had given him one of the
highest honours conceivable, and he did not choose to even say why
he was thankless for it! Passionate and withering words rose to her
lips, but she restrained their utterance. Not even in that moment
could she bring herself to speak what might seem to rebuke him
with the weight of all his debt to her. She remained silent, but he
understood all the intense indignation that held her speechless
there. He approached her more nearly, and spoke with emotion, but
with a certain sternness in his voice——
'I know very well that I must offend and even outrage you. But I
cannot tell you my motives. It is the first time that I have ever acted
independently of you or failed to consult your wishes. I only venture
to remind you that marriage does give to the man the right to do so,
though I have never availed myself of it. Nay, even now, I owe you
too much to be ingrate enough to take refuge in my authority as
your husband. I prefer to owe more, as I have owed so much, to
your tenderness. I prefer to ask of you, by your love for me, not to
press me for an answer that I am not in a position to make; to be
content with what I say—that I have relinquished the Russian
mission because I have no choice but to do so.'
He spoke firmly, because he spoke only the truth, although not all
the truth.
A great anger rose up in her, the first that she had ever been moved
to by him. All the pride of her temper and all her dignity were
outraged by this refusal to have confidence in her. It seemed
incredible to her. She still thought herself the prey of some dream, of
some hallucination. Her lips parted to speak, but again she withheld
the words she was about to utter. Her strong justice compelled her
to admit that he was but within his rights, and her sense of duty was
stronger than her sense of self-love.
She did not look at him, nor could she trust her voice. She turned
from him without a syllable, and left the room. She was afraid of the
violence of the anger that she felt.
'If it had been only to myself I would pardon it,' she thought; 'but an
insult to my people, to my country, to my sovereign!—an insult
without excuse, or explanation, or apology——'
She shut herself alone within her oratory and passed the most bitter
hour of her life. The imperious and violent temper of the Szalras was
dormant in her character, though she had chastened and tamed it,
and the natural sweetness and serenity of her disposition had been a
counterpoise to it so strong that the latter had become the only
thing visible in her. But all the wrath of her race was now aroused
and in arms against what she loved best on earth.
'If it had been anything else,' she thought; 'but a public act like this
—an ingratitude to the Crown itself! A caprice for all the world to
chatter of and blame!'
It would have been hard enough to bear, difficult enough to explain
away to others, if he had told her his reasons, however captious,
unwise, or selfish they might be; but to have the door of his soul
thus shut upon her, his thoughts thus closed to her, hurt her with
intolerable pain, and filled her with a deep and burning indignation.
She passed all the early morning hours alone in her little temple of
prayer, striving in vain against the bitterness of her heart; above her
the great ivory Crucifixion, the work of Angermayer, beneath which
so many generations of the women of the House of Szalras had knelt
in their hours of tribulation or bereavement.
When she left the oratory she had conquered herself. Though she
could not extinguish the human passions that smarted and throbbed
within her, she knew her duty well enough to know that it must lie in
submission and in silence.
She sought for him at once. She found him in the library: he was
playing to himself a long dreamy concerto of Schubert's, to soothe
the irritation of his own nerves and pass away a time of keen
suspense. He rose as she came into the room, and awaited her
approach with a timid anxiety in his eyes, which she was too
absorbed by her own emotions to observe. He had assumed a
boldness that he had not, and had used his power to dominate her
rather in desperation than in any sense of actual mastery. In his
heart it was he who feared her.
'You were quite right,' she said simply to him. 'Of course, you are
master of your own actions, and owe no account of them to me. We
will say no more about it. For myself, you know I am content enough
to escape exile to any embassy.'
He kissed her hand with an unfeigned reverence and humility.
'You are as merciful as you are great,' he murmured. 'If I be silent it
is my misfortune.' He paused abruptly.
A sudden thought came over her as he spoke.
'It is some State secret that he knows and cannot speak of, and that
has made him unwilling to go. Why did I never think of that before?'
An explanation that had its root in honour, a reticence that sprang
from conscience, were so welcome to her, and to her appeared so
natural, that they now consoled her at once, and healed the wounds
to her own pride.
'Of course, if it be so, he is right not to speak even to me,' she
mused, and her only desire was now to save him from the insistence
and the indignation of the Princess, and the examination which
these were sure to entail upon him when he should meet her at the
noon breakfast now at hand.
To that end she sought out her aunt in her own apartments, taking
with her the tiny Ottilie, who always disarmed all irritation in her
godmother by the mere presence of her little flower-like face.
'Dear mother,' she said softly, when the child had made her morning
obeisance, 'I am come to ask of you a great favour and kindness to
me. Réné returned last night. He has done what he thought right. I
do not even ask his reasons. He has acted from force majeure by
dictate of his own honour. Will you do as I mean to do? Will you
spare him any interrogation? I shall be so grateful to you, and so will
he.'
Mdme. Ottilie, opening her bonbonnière for her namesake, drew up
her fragile figure with a severity unusual to her.
'Do I hear you aright? You do not even know the reasons of the
insult M. de Sabran has passed upon the Crown and Cabinet, and
you do not even mean to ask them?'
'I do mean that; and what I do not ask I feel sure you will admit no
one else has any right to ask of him.'
'No one certainly except His Majesty.'
'I presume His Majesty has had all information due to him as our
Imperial master. All I entreat of you, dearest mother, is to do as I
have done; assume, as we are bound to assume, that Réné has
acted wisely and rightly, and not weary him with questions to which
it will be painful to him not to respond.'
'Questions! I never yet indulged in anything so vulgar as curiosity,
that you should imagine I shall be capable of subjecting your
husband to a cross-examination. If you be satisfied, I can have no
right to be more exacting than yourself. The occurrence is to me
lamentable, inexcusable, unintelligible; but if explanation be not
offered me you may rest assured I shall not intrude my request for
it.'
'Of that I am sure; but I am not contented only with that. I want you
to feel no dissatisfaction, no doubt, no anger against him. You may
be sure that he has acted from conviction, because he was most
desirous to go to Russia, as you saw when you urged him to accept
the mission.'
'I have said the utmost that I can say,' replied the Princess, with a
chill light in her blue eyes. 'This little child is no more likely to ask
questions than I am, after what you have stated. But you must not
regard my silence as any condonation of what must always appear
to me a step disrespectful to the Crown, contrary to all usages of
etiquette, and injurious to his own future and that of his children.
His scruples of conscience came too late.'
'I did not say they were exactly that. I believe he learned something
which made him consider that his honour required him to withdraw.'
'That may be,' said the Princess, frigidly. 'As I observed, it came
lamentably late. You will excuse me if I breakfast in my own rooms
this morning.'
Wanda left her, gave the child to a nurse who waited without, and
returned to the library. She had offended and pained Mdme. Ottilie,
but she had saved her husband from annoyance. She knew that
though the Princess was by no means as free from curiosity as she
declared herself, she was too high-bred and too proud to solicit a
confidence withheld from her.
Sabran was seated at the piano where she had left him, but his
forehead rested on the woodwork of it, and his whole attitude was
suggestive of sad and absorbed thought and abandonment to
regrets that were unavailing.
'It has cost him so much,' she reflected as she looked at him.
'Perhaps it has been a self-sacrifice, a heroism even; and I, from
mere wounded feeling, have been angered against him and almost
cruel!'
With the exaggeration in self-censure of all generous natures, she
was full of remorse at having added any pain to the disappointment
which had been his portion; a disappointment none the less
poignant, as she saw, because it had been voluntarily, as she
imagined, accepted.
As he heard her approach he started and rose, and the expression of
his face startled her for a moment; it was so full of pain, of
melancholy, almost (could she have believed it) of despair. What
could this matter be to affect him thus, since being of the State it
could be at its worst only some painful and compromising secret of
political life which could have no personal meaning for him? It was
surely impossible that mere disappointment——a disappointment
self-inflicted——could bring upon him such suffering? But she threw
these thoughts away. In her great loyalty she had told herself that
she must not even think of this thing, lest she should let it come
between them once again and tempt her from her duty and
obedience. Her trust in him was perfect.
The abandonment of a coveted distinction was in itself a bitter
disappointment, but it seemed to him as nothing beside the sense of
submission and obedience compelled from him to Vàsàrhely. He felt
as though an iron hand, invisible, weighed on his life, and forced it
into subjection. When he had almost grown secure that his enemy's
knowledge was a buried harmless thing, it had risen and barred his
way, speaking with an authority which it was not possible to disobey.
With all his errors he was a man of high courage, who had always
held his own with all men. How the old forgotten humiliation of his
earliest years revived, and enforced from him the servile timidity of
the Slav blood which he had abjured. He had never for an instant
conceived it possible to disregard the mandate he received; that an
apparently voluntary resignation was permitted to him was, his
conscience acknowledged, more mercy than he could have
expected. That Vàsàrhely would act thus had not occurred to him;
but before the act he could not do otherwise than admit its justice
and obey.
But the consciousness of that superior will compelling him, left in
him a chill tremor of constant fear, of perpetual self-abasement.
What was natural to him was the reckless daring which many
Russians, such as Skobeleff, have shown in a thousand ways of peril.
He was here forced only to crouch and to submit; it was more
galling, more cruel to him than utter exposure would have been. The
sense of coercion was always upon him like a dragging chain. It
produced on him a despondency, which not even the presence of his
wife or the elasticity of his own nature could dispel.
He had to play a part to her, and to do this was unfamiliar and
hateful to him. In all the years before he had concealed a fact from
her, but he had never been otherwise false. Though to his
knowledge there had been always between them the shadow of a
secret untold, there had never been any sense upon him of
obligation to measure his words, to feign sentiments he had not, to
hide behind a carefully constructed screen of untruth. Now, though
he had indeed not lied with his lips, he had to sustain a concealment
which was a thousand times more trying to him than that
concealment of his birth and station to which he had been so long
accustomed that he hardly realised it as any error. The very nobility
with which she had accepted his silence, and given it, unasked, a
worthy construction, smote him with a deeper sense of shame than
even that which galled him when he remembered the yoke laid on
him by the will of Egon Vàsàrhely.
He roused himself to meet her with composure.
She rested her hand caressingly on his.
'We will never speak of Russia any more. I should be sorry were the
Kaiser to think you capricious or disloyal, but you have too much
ability to have incurred this risk. Let it all be as though there had
never arisen any question of public life for you. I have explained to
Aunt Ottilie; she will not weary you with interrogation; she
understands that you have acted as your honour bade you. That is
enough for those who love you as do she and I.'
Every word she spoke entered his very soul with the cruellest irony,
the sharpest reproach. But of these he let her see nothing. Yet he
was none the less abjectly ashamed, less passionately self-
condemned, because he had to consume his pain in silence, and had
the self-control to answer, still with a smile, as he touched a chord or
two of music:
'When the Israelites were free they hankered after the flesh-pots of
Egypt. They deserved eternal exile, eternal bondage. So do I, for
having ever been ingrate enough to dream of leaving Hohenszalras
for the world of men!'
Then he turned wholly towards the Erard keyboard, and with
splendour and might there rolled forth under his touch the military
march of Rákóczi: he was glad of the majesty and passion of the
music which supplanted and silenced speech.
'That is very grand,' she said, when the last notes had died away.
'One seems to hear the Eljén! of the whole nation in it. But play me
something more tender, more pathetic——some lieder half sorrow
and half gladness, you know so many of all countries.'
He paused a moment; then his hands wandered lightly across the
notes, and called up the mournful folk-songs that he had heard so
long, so long, before; songs of the Russian peasants, of the maidens
borne off by the Tartar in war, of the blue-eyed children carried away
to be slaves, of the homeless villagers beholding their straw-roofed
huts licked up by the hungry hurrying flame lit by the Kossack or the
Kurd; songs of a people without joy, that he had heard in his childish
days, when the great rafts had drifted slowly down the Volga water,
and across the plains the lines of chained prisoners had crept as
slowly through the dust; or songs that he had sung to himself, not
knowing why, where the winter was white on all the land, and the
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com