Artificial Intelligent-IV


Artificial Intelligent-IV






Hello ,
             So  we have go forward to learn new about Artificial Intelligent Series. In this post I have introduce you with Machine Learning, Artificial Intelligent And  Deep Learning Topics. First I have introduce about these three topic and then the difference of that.
                
                                          
Artificial intelligence(AI)

            AI is the most comprehensive way to think about the best of advanced computer intelligence. At the Dartmouth Artificial Intelligence Conference held in 1956, AI was suitably described as: “Every aspect of learning or any other feature of intelligence can in principle be so precisely described that a machine can be made to simulate it.” It can range from a computer program playing chess or a voice-recognition system like Alexa by Amazon that is capable of speech response and interpretation.
Machine Learning (ML)
            ML is a subfield of AI. The core principle of ML is that machines learn by themselves by taking data from various sources. Presently, it is considered to be one of the most promising tools of the AI kit that is suitable for businesses.
            ML systems are capable of fast application of knowledge and getting trained from large sets of data to be able to do tasks like speech recognition, facial recognition, translation, and object recognition with ease and efficiency. ML allows machines to make predictions based on the recognition of complex data sets and patterns. This is what makes ML different from hand-coding a software program that requires specific instructions for task completion.
Deep Learning
            Deep learning is one of the subsets of machine learning. Whenever the term deep learning is used,  it is generally referred to the deep artificial neural networks, and at times of deep reinforcement learning. Deep artificial neural networks are algorithm sets are extremely accurate especially for problems like sound recognition, image recognition, recommender systems, etc. A few examples would be – deep learning is a part of DeepMind’s popular AlphaGo algorithm, which had beaten former world champion Lee Sedol at Go in 2016, and the current world champion Ke Jie in 2017.

            Deep is a technical term referring to the layers of the neural network. A superficial network has a single hidden layer, and a network that is deep has multiple layers. These hidden layers are the layers that allow deep neural networks to acquire data features from a feature hierarchy. This is due to the fact that simple features recombine from the existing layers to form complex features. Intensive computations form the basis of deep learning, and this is why GPUs are in great demand- to provide training in the deep-learning models.

Difference

              After the above information you have getting enough idea About AI,ML and Deep Learning. So the is some difference on these three fields can described below.
  
            While discussing about Artificial intelligence vs Machine learning vs Deep learning, one needs to understand that data lies at the heart of everything. Whether it is an algorithm that is being used or machine learning or artificial intelligence, one aspect is certain: if flawed data is being used, the extracted information and insights would most definitely be flawed. Algorithms can be flawed quite like the humans that they are replacing but more the usage of data more is the scope for flaws.

             Therefore data cleansing becomes critical. Data cleansing is defined as the process of correcting and detecting inaccurate or corrupt records from a table, record set, or database and deleting/ modifying irrelevant/incorrect data. According to the Crowd Flower Data Science report, data scientists need to cleanse data though it is not something that they enjoy doing. A major part of their time is spent in data cleansing since the output needs to be trustworthy and this can only happen when data is cleansed.

            The concept of Artificial intelligence is broader than that of machine learning, the latter uses computers to imitate the cognitive human functions. Artificial intelligence, therefore, can be defined as machines carrying out various tasks based on algorithms in a perfectly intelligent way. Machine learning is a subset of AI and its’ focus lies on the capability of machines to not only receive data sets but also learn and relearn for themselves, change the algorithms according to the information that they are processing.

            Deep learning networks need to visualize large quantities of items to be trained. Instead of being programmed with the edges that define items, the systems learn from exposure to millions of data points. An early example would be of Google Brain learning to recognize cats after being shown over ten million images. Deep learning networks do not need to be programmed with the criteria that define items; they are able to identify edges through being exposed to large amounts of data.




            So we have understanding the concept of Artificial intelligenceMachine learning, Deep learning. And there difference also. This information can take some time to read,but it’s very interesting because it can provide some important knowledge about Artificial Intelligent. I hope it will help you to grow your knowledge on AI.
Keep in touch to next article on series of AI. Thank you.




Artificial Intelligence - III



Artificial Intelligence - III
            So we are continued with third post on Artificial Intelligence. In this article we are learn about the actual work of AI. We can introducing brief explanation of Intelligence System. Also learn about AI Types and their Information.


What is Intelligence?
The ability of a system to calculate, reason, perceive relationships and analogies, learn from experience, store and retrieve information from memory, solve problems, comprehend complex ideas, use natural language fluently, classify, generalize, and adapt new situations.

What is Intelligence Composed of?
The intelligence is intangible. It is composed of:
1. Reasoning
2. Learning
3. Problem Solving
4. Perception
5. Linguistic Intelligence
What are Agent and Environment?

An agent is anything that can perceive its environment through sensors and acts upon that environment through effectors.
1. A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel to the sensors, and other organs such as hands, legs, mouth, for effectors.
2. A robotic agent replaces cameras and infrared range finders for the sensors, and various motors and actuators for effectors.
3. A software agent has encoded bit strings as its programs and actions.

What are Expert Systems?
The expert systems are the computer applications developed to solve complex problems in a particular domain, at the level of extra-ordinary human intelligence and expertise.

Characteristics of Expert Systems
1. High performance
2. Understandable
3. Reliable
4. Highly responsive

Types of AI 

In the AI there is some types are included there main types are Strong AI and Weak AI. There is also other types we are introduce one by one. 

            Strong AI
           The work aimed at genuinely simulating human reasoning tends to be called strong AI in that any result can be used to not only build systems that think but also explain how humans
Think as well. Genuine models of strong AI or systems that are actual simulations of human cognition have yet to be built.

Weak AI

          The work in the second school of thought, aimed at just getting systems to work, is usually called weak AI in that while we might be able to build systems that can behave like humans, the results tell us nothing about how humans think. One of the prime examples of this was IBM’s Deep Blue, a system that was a master chess player but certainly did not play in the same way that humans do and told us very little about cognition in general.

TYPE I AI: REACTIVE MACHINES

            Some other types are described in below. We need to do more than teach machines to learn. We need to overcome the boundaries that define the four different types of artificial intelligence, the barriers that separate machines from us – and us from them.

The most basic types of AI systems are purely reactive, and have the ability neither to form memories nor to use past experiences to inform current decisions. Deep Blue, IBM’s chess-playing supercomputer, which beat international grandmaster Garry Kasparov in the late 1990s, is the perfect example of this type of machine.

Deep Blue can identify the pieces on a chess board and know how each moves. It can make predictions about what moves might be next for it and its opponent. And it can choose the most optimal moves from among the possibilities. This type of intelligence involves the computer

TYPE II AI: LIMITED MEMORY

            This Type II class contains machines can look into the past. Self-driving cars do some of this already. For example, they observe other cars’ speed and direction. That can’t be done in a just one moment, but rather requires identifying specific objects and monitoring them over time.
These observations are added to the self-driving cars’ preprogrammed representations of the world, which also include lane markings, traffic lights and other important elements, like curves in the road. They’re included when the car decides when to change lanes, to avoid cutting off another driver or being hit by a nearby car.

But these simple pieces of information about the past are only transient. They aren’t saved as part of the car’s library of experience it can learn from, the way human drivers compile experience over years behind the wheel.

So how can we build AI systems that build full representations, remember their experiences and learn how to handle new situations? Brooks was right in that it is very difficult to do this.

TYPE III AI: THEORY OF MIND

Machines in the next, more advanced, class not only form representations about the world, but also about other agents or entities in the world. In psychology, this is called “theory of mind” – the understanding that people, creatures and objects in the world can have thoughts and emotions that affect their own behavior.

This is crucial to how we humans formed societies, because they allowed us to have social interactions. Without understanding each other’s motives and intentions, and without taking into account what somebody else knows either about me or the environment, working together is at best difficult, at worst impossible.

If AI systems are indeed ever to walk among us, they’ll have to be able to understand that each of us has thoughts and feelings and expectations for how we’ll be treated. And they’ll have to adjust their behavior accordingly.

TYPE IV AI: SELF-AWARENESS

The final step of AI development is to build systems that can form representations about themselves. Ultimately, we AI researchers will have to not only understand consciousness, but build machines that have it.
This is, in a sense, an extension of the “theory of mind” possessed by Type III artificial intelligences. Consciousness is also called “self-awareness” for a reason. (“I want that item” is a very different statement from “I know I want that item.”) Conscious beings are aware of themselves, know about their internal states, and are able to predict feelings of others. We assume someone honking behind us in traffic is angry or impatient, because that’s how we feel when we honk at others. Without a theory of mind, we could not make those sorts of inferences.

While we are probably far from creating machines that are self-aware, we should focus our efforts toward understanding memory, learning and the ability to base decisions on past experiences. This is an important step to understand human intelligence on its own. And it is crucial if we want to design or evolve machines that are more than exceptional at classifying what they see in front of them.

This are all about the AI types and there brief explanation. This information can take much time to read it but it’s very interesting because it can provide some important knowledge about Artificial Intelligent. I hope it will help you to get ideas on AI.

Keep in touch to next article on series of AI. Thank you.

Artificial intelligence


Hello Friends,
            Today I have Introduce My new series On Artificial intelligence. I Hope you like it and get new knowledge from my blog. Also I will come with new series on Blockchain, Bitcoin, Deep web and much more fresh topic.
             So please keep In touch with my new series and my blog and Learn Something New..!!! And also share this with your friends and follow my blog.
     So Let’s, Start...This is First post on Artificial intelligence series. 

Introduction

             Artificial intelligence (AI) is the ability of a computer program or a machine to think and learn.
It is also a field of study which tries to make computers "smart". According to the father of Artificial Intelligence John McCarthy, it is “The science and engineering of making intelligent machines, especially intelligent computer programs”.
           Artificial Intelligence (AI) is the key technology in many of today's novel applications, ranging from banking systems that detect attempted credit card fraud, to telephone systems that understand speech, to software systems that notice when you're having problems and offer appropriate advice. These technologies would not exist today without the sustained federal support of fundamental AI research over the past three decades.
           Artificial Intelligence is a way of making a computer, a computer-controlled robot, or a software think intelligently, in the similar manner the intelligent humans think.

           AI is accomplished by studying how human brain thinks, and how humans learn, decide, and work while trying to solve a problem, and then using the outcomes of this study as a basis of developing intelligent software and systems.

While exploiting the power of the computer systems, the curiosity of human, lead him to wonder, “Can a machine think and behave like humans do?”

Thus, the development of AI started with the intention of creating similar intelligence in machines that we find and regard high in humans.
         
           Artificial intelligence is a science and technology based on disciplines such as Computer Science, Biology, Psychology, Linguistics, Mathematics, and Engineering. A major thrust of AI is in the development of computer functions associated with human intelligence, such as reasoning, learning, and problem solving.
           This is the introduction part of Artificial intelligence.


History

            Objects that look and act like humans exist in every major civilization. The first appearance of artificial intelligence is in Greek myths, like Talos of Crete or the bronze robot of Hephaestus. Humanoid robots were built by Yan Shi, Hero of Alexandria, and Al-Jazari. Sentient machines became popular in fiction during the 19th and 20th centuries with the stories of Frankenstein and Rossum's Universal Robots.
             Formal logic was developed by ancient Greek philosophers and mathematicians. This study of logic produced the idea of a computer in the 19th and 20th century. Mathematician Alan Turing's theory of computation said that any mathematical problem could be solved by processing 1's and 0's. Advances in neurology, information theory, and cybernetics convinced a small group of researchers that an electronic brain was possible.
              AI research really started with a conference at Dartmouth College in 1956. It was a month long brainstorming session attended by many people with interests in AI. At the conference they wrote programs that were amazing at the time, beating people at checkers or solving word problems. The Department of Defense started giving a lot of money to AI research and labs were created all over the world.

          AI revived again in the 90s and early 2000s with its use in data
mining and medical diagnosis. This was possible because of faster computers and focusing on solving more specific problems. In 1997, Deep Blue became the first computer program to beat chess world champion Garry Kasparov. Faster computers, advances in deep learning, and access to more data have made AI popular throughout the world. In 2011 IBM Watson beat the top two Jeopardy! Players Brad Rutter and Ken Jennings, and in 2016 Google's Alpha Go beat top Go player Lee Sedol 4 out of 5 times.
          
            I know this is boring reading for you that’s why I will make series on it. So you can read it carefully and get complete Knowledge on Artificial intelligence
           So keep in touch with the series. And most important thing is Share my blog with your friends and suggest me your Ideas in comment, so I will try to give brief information on your ideas. And please give me your feedback on each post on that series.

            Thank You… Keep Reading Next Post to know more on Artificial intelligence.
Next post posted soon. Keep In Touch:) 

Artificial Intelligent-II

Artificial Intelligent-II

                  So how was the first Artificial Intelligent post? I hope it will informative to all my readers, Friends. Also you can get basic knowledge of Artificial Intelligent.
Now we are continue with second post on Artificial Intelligent. In this post we are cover the same topic related with Artificial Intelligent. In that we can get knowledge on Artificial Intelligent Applications, there Goals, and there Issues.

                     Artificial Intelligent is the best option to handle some areas like Gaming, Natural Language Processing, Speech Recognition, and Intelligent Robots etc. It’s very helpful to fast growth of world because it can do the hard job in easy way and also fastly. So it’s very time consuming than other human working process.
Thus, the development of AI started with the intention of creating similar intelligence in machines that we find and regard high in humans.
                     Artificial intelligence is a science and technology based on disciplines such as Computer Science, Biology, Psychology, Linguistics, Mathematics, and Engineering. A major thrust of AI is in the development of computer functions associated with human intelligence, such as reasoning, learning, and problem solving.
Out of the following areas, one or multiple areas can contribute to build an intelligent system.

Goals of AI
1. To Create Expert Systems: The systems which exhibit intelligent behavior, learn, demonstrate, explain, and advice its users.
2. To Implement Human Intelligence in Machines: Creating systems that understand, think, learn, and behave like humans.

What is AI Technique?
In the real world, the knowledge has some unwelcomed properties:
1. Its volume is huge, next to unimaginable.
2. It is not well-organized or well-formatted.
3. It keeps changing constantly.

AI Technique is a manner to organize and use the knowledge efficiently in such a way that:
1. It should be perceivable by the people who provide it.
2. It should be easily modifiable to correct errors.
3. It should be useful in many situations though it is incomplete or inaccurate.
AI techniques elevate the speed of execution of the complex program it is equipped with.

Applications of AI
AI has been dominant in various fields such as:

1. Gaming
AI plays crucial role in strategic games such as chess, poker, tic-tac-toe, etc., where machine can think of large number of possible positions based on heuristic knowledge.

2. Natural Language Processing
It is possible to interact with the computer that understands natural language spoken by humans.

3. Expert Systems
There are some applications which integrate machine, software, and special information to impart reasoning and advising. They provide explanation and advice to the users.

4. Vision Systems
These systems understand, interpret, and comprehend visual input on the computer. For example,

• A spying aero plane takes photographs which are used to figure out spatial information or map of the areas.

• Doctors use clinical expert system to diagnose the patient.

• Police use computer software that can recognize the face of criminal with the stored portrait made by forensic artist.

5. Speech Recognition
Some intelligent systems are capable of hearing and comprehending the language in terms of sentences and their meanings while a human talks to it. It can handle different accents, slang words, noise in the background, change in human’s noise due to cold, etc.

6. Handwriting Recognition
The handwriting recognition software reads the text written on paper by a pen or on screen by a stylus. It can recognize the shapes of the letters and convert it into editable text.

7 Intelligent Robots
Robots are able to perform the tasks given by a human. They have sensors to detect physical data from the real world such as light, heat, temperature, movement, sound, bump, and pressure. They have efficient processors, multiple sensors and huge memory, to exhibit intelligence. In addition, they are capable of learning from their mistakes and they can adapt to the new environment.

AI ISSUES
                   AI is developing with such an incredible speed, sometimes it seems magical. There is an opinion among researchers and developers that AI could grow so immensely strong that it would be difficult for humans to control.
Humans developed AI systems by introducing into them every possible intelligence they could, for which the humans themselves now seem threatened.
Threat to Privacy an AI program that recognizes speech and understands natural language is theoretically capable of understanding each conversation on e-mails and telephones.


                Threat to Human Dignity AI systems have already started replacing the human beings in few industries. It should not replace people in the sectors where they are holding dignified positions which are pertaining to ethics such as nursing, surgeon, judge, police officer, etc.
Threat to Safety the self-improving AI systems can become so mighty than humans that could be very difficult to stop from achieving their goals, which may lead to unintended consequences.
So this are the some Artificial Intelligent Applications, Goals, and Issues. These topic are small information on AI because our AI field is changing constantly day by day so this information also updating .I try to provide latest updated information on Artificial Intelligent.so keep in touch with that series get complete information on AI. And your eyes on next post I will post as soon.

                To get daily update please subscribe my blog, so you can’t miss any post related with it and also other new posts.
Thank You …!!!
   

Introduction of Prolog

Prolog

1. Basic Introduction of Prolog



Prolog (programming in logic) is one of the most widely used programming languages
in artificial intelligence research. As opposed to imperative languages such as C or Java
(which also happens to be object-oriented) it is a declarative programming language.
That means, when implementing the solution to a problem, instead of specifying how
to achieve a certain goal in a certain situation, we specify what the situation (rules and
facts) and the goal (query) are and let the Prolog interpreter derive the solution for
us. Prolog is very useful in some problem areas, such as artificial intelligence, natural
language processing, databases, . . . , but pretty useless in others, such as graphics or
numerical algorithms.
The following three are
well-known titles, but you may also consult any other textbook on Prolog.
• I. Bratko. Prolog Programming for Artificial Intelligence. 3rd edition, Addison-
Wesley Publishers, 2001.
• F. W. Clocksin and C. S. Mellish. Programming in Prolog. 5th edition, Springer-
Verlag, 2003.
• L. Sterling and E. Shapiro. The Art of Prolog. 2nd edition, MIT Press, 1994.

2. Getting Started: An Example

In the introduction it has been said that Prolog is a declarative (or descriptive) language.
Programming in Prolog means describing the world. Using such programs means asking
Prolog questions about the previously described world. The simplest way of describing
the world is by stating facts, like this one:

bigger(elephant, horse).

This states, quite intuitively, the fact that an elephant is bigger than a horse. (Whether
the world described by a Prolog program has anything to do with our real world is, of
course, entirely up to the programmer.) Let’s add a few more facts to our little program:

bigger(elephant, horse).
bigger(horse, donkey).
bigger(donkey, dog).
bigger(donkey, monkey).

This is a syntactically correct program, and after having compiled it we can ask the Prolog
system questions (or queries in proper Prolog-jargon) about it. Here’s an example:

?- bigger(donkey, dog).
Yes

The query bigger(donkey, dog) (i.e. the question “Is a donkey bigger than a dog?”)
succeeds, because the fact bigger(donkey, dog) has previously been communicated to
the Prolog system. Now, is a monkey bigger than an elephant?

?- bigger(monkey, elephant).
No
No, it’s not. We get exactly the answer we expected: the corresponding query, namely
bigger(monkey, elephant) fails. But what happens when we ask the other way round?

?- bigger(elephant, monkey).
No

According to this elephants are not bigger than monkeys. This is clearly wrong as far as
our real world is concerned, but if you check our little program again, you will find that
it says nothing about the relationship between elephants and monkeys. Still, we know
that if elephants are bigger than horses, which in turn are bigger than donkeys, which in
turn are bigger than monkeys, then elephants also have to be bigger than monkeys. In
mathematical terms: the bigger-relation is transitive. But this has also not been defined
in our program. The correct interpretation of the negative answer Prolog has given is
the following: from the information communicated to the system it cannot be proved
that an elephant is bigger than a monkey.
If, however, we would like to get a positive reply for a query like bigger(elephant,
monkey), we have to provide a more accurate description of the world. One way of doing
this would be to add the remaining facts, like e.g. bigger(elephant, monkey), to our
program. For our little example this would mean adding another 5 facts. Clearly too
much work and probably not too clever anyway.
The far better solution would be to define a new relation, which we will call
is_bigger, as the transitive closure (don’t worry if you don’t know what that means)
of bigger. Animal X is bigger than animal Y either if this has been stated as a fact or if
there is an animal Z for which it has been stated as a fact that animal X is bigger than
animal Z and it can be shown that animal Z is bigger than animal Y. In Prolog such
statements are called rules and are implemented like this:

is_bigger(X, Y) :- bigger(X, Y).
is_bigger(X, Y) :- bigger(X, Z), is_bigger(Z, Y).
In these rules :- means something like “if” and the comma between the two terms
bigger(X, Z) and is_bigger(Z, Y) stands for “and”. X, Y, and Z are variables, which
in Prolog is indicated by using capital letters.
You can think of the the bigger-facts as data someone has collected by browsing
through the local zoo and comparing pairs of animals. The implementation of is_bigger,
on the other hand, could have been provided by a knowledge engineer who may not
know anything at all about animals, but understands the general concept of something
being bigger than something else and thereby has the ability to formulate general rules
regarding this relation. If from now on we use is_bigger instead of bigger in our
queries, the program will work as intended:

?- is_bigger(elephant, monkey).
Yes

Prolog still cannot find the fact bigger(elephant, monkey) in its database, so it tries
to use the second rule instead. This is done by matching the query with the head of the
rule, which is is_bigger(X, Y). When doing so the two variables get instantiated: X =
elephant and Y = monkey. The rule says that in order to prove the goal is_bigger(X,
Y) (with the variable instantiations that’s equivalent to is_bigger(elephant, monkey))
Prolog has to prove the two subgoals bigger(X, Z) and is_bigger(Z, Y), again with
the same variable instantiations. This process is repeated recursively until the facts
that make up the chain between elephant and monkey are found and the query finally
succeeds.

3. Prolog Syntax


This section describes the most basic features of the Prolog programming language.
1. Terms
The central data structure in Prolog is that of a term. There are terms of four kinds:
atoms, numbers, variables, and compound terms. Atoms and numbers are sometimes
grouped together and called atomic terms.

Atoms.: Atoms are usually strings made up of lower- and uppercase letters, digits, and
the underscore, starting with a lowercase letter. The following are all valid Prolog atoms:

elephant, b, abcXYZ, x_123, another_pint_for_me_please

On top of that also any series of arbitrary characters enclosed in single quotes denotes
an atom.

’This is also a Prolog atom.’

Finally, strings made up solely of special characters like + - * = < > : & (check the
manual of your Prolog system for the exact set of these characters) are also atoms.
Examples:

+, ::, <------>, ***

Numbers.: All Prolog implementations have an integer type: a sequence of digits,
optionally preceded by a - (minus). Some also support floats. Check the manual for
details.
Variables.:" Variables are strings of letters, digits, and the underscore, starting with a
capital letter or an underscore. Examples:

X, Elephant, _4711, X_1_2, MyVariable, _

The last one of the above examples (the single underscore) constitutes a special case.
It is called the anonymous variable and is used when the value of a variable is of no
particular interest. Multiple occurrences of the anonymous variable in one expression
are assumed to be distinct, i.e. their values don’t necessarily have to be the same.

Compound terms.: Compound terms are made up of a functor (a Prolog atom) and
a number of arguments (Prolog terms, i.e. atoms, numbers, variables, or other compound
terms) enclosed in parentheses and separated by commas. The following are some
examples for compound terms:

is_bigger(horse, X), f(g(X, _), 7), ’My Functor’(dog)

It’s important not to put any blank characters between the functor and the opening
parentheses, or Prolog won’t understand what you’re trying to say. In other places,
however, spaces can be very helpful for making programs more readable.
The sets of compound terms and atoms together form the set of Prolog predicates.
A term that doesn’t contain any variables is called a ground term.

Clauses, Programs and Queries


In the introductory example we have already seen how Prolog programs are made up of
facts and rules. Facts and rules are also called clauses.
Facts. A fact is a predicate followed by a dot.
Examples:

bigger(whale, _).
life_is_beautiful.

The intuitive meaning of a fact is that we define a certain instance of a relation as being
true.

Rules.: A rule consists of a head (a predicate) and a body. (a sequence of predicates
separated by commas). Head and body are separated by the sign :- and, like every
Prolog expression, a rule has to be terminated by a dot.
Examples:
is_smaller(X, Y) :- is_bigger(Y, X).
aunt(Aunt, Child) :-
sister(Aunt, Parent),
parent(Parent, Child).

The intuitive meaning of a rule is that the goal expressed by its head is true, if we (or
rather the Prolog system) can show that all of the expressions (subgoals) in the rule’s
body are true.

Programs.: A Prolog program is a sequence of clauses.
Queries.: After compilation a Prolog program is run by submitting queries to the interpreter.
A query has the same structure as the body of a rule, i.e. it is a sequence
of predicates separated by commas and terminated by a dot. They can be entered at
the Prolog prompt, which in most implementations looks something like this: ?-. When
writing about queries we often include the ?-.

Examples:
?- is_bigger(elephant, donkey).
?- small(X), green(X), slimy(X).

Intuitively, when submitting a query like the last example, we ask Prolog whether all its
predicates are provably true, or in other words whether there is an X such that small(X),
green(X), and slimy(X) are all true.

Some Built-in Predicates

What we have seen so far is already enough to write simple programs by defining predicates
in terms of facts and rules, but Prolog also provides a range of useful built-in
predicates. Some of them will be introduced in this section; all of them should be explained
in manual of your Prolog system.
Built-ins can be used in a similar way as user-defined predicates. The important
difference between the two is that a built-in predicate is not allowed to appear as the
principal functor in a fact or the head of a rule. This must be so, because using them in
such a position would effectively mean changing their definition.

Goal Execution
Submitting a query means asking Prolog to try to prove that the statement(s) implied
by the query can be made true provided the right variable instantiations are made. The
search for such a proof is usually referred to as goal execution. Each predicate in the query
constitutes a (sub)goal, which Prolog tries to satisfy one after the other. If variables are
shared between several subgoals their instantiations have to be the same throughout the
entire expression.
If a goal matches with the head of a rule, the respective variable instantiations are
made inside the rule’s body, which then becomes the new goal to be satisfied. If the body
consists of several predicates the goal is again split into subgoals to be executed in turn.
In other words, the head of a rule is considered provably true, if the conjunction of all
its body-predicates are provably true. If a goal matches with a fact in our program the
proof for that goal is complete and the variable instantiations made during matching are
communicated back to the surface. Note that the order in which facts and rules appear
in our program is important here. Prolog will always try to match its current goal with
the first possible fact or rule-head it can find.

If the principal functor of a goal is a built-in predicate the associated action is executed
whilst the goal is satisfied. For example, as far as goal execution is concerned the
predicate

write(’Hello World!’)

will simply succeed, but at the same time it will also print the words Hello World! on
the screen.
As mentioned before the built-in predicate true will always succeed (without any
further side-effects), whereas fail will always fail.
Sometimes there is more than one way of satisfying the current goal. Prolog chooses
the first possibility (as determined by the order of clauses in a program), but the fact
that there are alternatives is recorded. If at some point Prolog fails to prove a certain
subgoal, the system can go back and try an alternative way of executing the previous
goal. This process is known as backtracking.

Prolog agrees with our own logical reasoning. Which is nice. But how did it come to its
conclusion? Let’s follow the goal execution step by step.
(1) The query mortal(socrates) is made the initial goal.
(2) Scanning through the clauses of our program, Prolog tries to match
mortal(socrates) with the first possible fact or head of rule. It finds mortal(X),
the head of the first (and only) rule. When matching the two terms the instantiation
X = socrates needs to be made.
(3) The variable instantiation is extended to the body of the rule, i.e. man(X) becomes
man(socrates).
(4) The newly instantiated body becomes our new goal: man(socrates).
(5) Prolog executes the new goal by again trying to match it with a rule-head or a fact.
Obviously, the goal man(socrates) matches the fact man(socrates), because they
are identical. This means the current goal succeeds.
(6) This, again, means that also the initial goal succeeds.

One of the major advantages of Prolog is that it allows for writing very short and compact
programs solving not only comparatively difficult problems, but also being readable and

(again: comparatively) easy to understand.

Of course, this can only work, if the programmer (you!) pays some attention to his
or her programming style. As with every programming language, comments do help.
In Prolog comments are enclosed between the two signs /* and */, like this:

/* This is a comment. */

Comments that only run over a single line can also be started with the percentage sign
%. This is usually used within a clause.
aunt(X, Z) :-
sister(X, Y), % A comment on this subgoal.
parent(Y, Z).

Besides the use of comments a good layout can improve the readability of your programs
significantly. The following are some basic rules most people seem to agree on:
(1) Separate clauses by one or more blank lines.
(2) Write only one predicate per line and use indentation:

blond(X) :-
father(Father, X),
blond(Father),
mother(Mother, X),
blond(Mother).

(Very short clauses may also be written in a single line.)

(3) Insert a space after every comma inside a compound term:
born(mary, yorkshire, ’01/01/1980’)
(4) Write short clauses with bodies consisting of only a few goals. If necessary, split
into shorter sub-clauses.
(5) Choose meaningful names for your variables and atoms.

Thanks For Reading.Keep Visiting.!!!

Artificial Intelligent-IV

Artificial Intelligent-IV Hello ,                So    we have go forward to learn new about Artificial Intelligent S...