CHAPTER ONE
INTRODUCTION
1.0 BACKGROUND TO THE STUDY
Knowledge and the way it is managed, according to Jashapara (2011), has been with
humankind since the beginning of time. Knowledge is an asset which does not deplete
after its use rather it grows through transfer or exchange. However, knowledge, if not
closely watched or kept may go extinct. Whether indigenous or modern, knowledge has
become the key asset to drive organizational survival and success and as such is an asset
which should not be allowed to suffer death due to ineffective management. Knowledge
is constituted by the ways in which people categorize, code, process, and impute meaning
to their experiences (Studley, 1998).
It should not be forgotten that indigenous knowledge formed part of humanity’s common
heritage. Indigenous, Local and Traditional are terms that have been used interchangeably
to describe the peculiarity of arts, beliefs, language, practice or knowledge (the list being
in-exhaustive) to communities. Indigenous Knowledge (IK) has been defined by a
number of authors, though different yet similar in their ideas of what indigenous
knowledge is. The recurring terms in the various definitions of indigenous knowledge
are: natural resources, local, communities, experience and innovation. Kolawole (2001)
used the term local or indigenous knowledge (IK) to distinguish the knowledge developed
by a given community from international knowledge systems or scientific knowledge.
The United Nations Environment Programme (UNEP) defined IK as the knowledge that
an indigenous local community accumulates over generations of living in a particular
1
environment. UNEP also identified a number of terms that are often used interchangeably
to refer to the concept of indigenous knowledge. These terms include Traditional
Knowledge (TK), Indigenous Technical Knowledge (ITK), Local Knowledge (LK), and
Indigenous Knowledge Systems (IKS). Indigenous knowledge (IK) is unique to every
culture and society and it is embedded in community practices, institutions, relationships
and rituals. It is considered a part of the local knowledge in that it has roots in particular
communities and is situated within broader cultural traditions.
Agricultural indigenous knowledge (AIK) refers to the knowledge through which local
communities go about their agricultural practice to ensure survival. Indigenous
knowledge (IK), and AIK for that matter, is knowledge that has been in existence since
the existence of man. It is knowledge that evolved as man perceived the only means for
survival was to adapt to his environment, and by adapting there was need to identify
which plants and animal were edible, how to cultivate the land around them so as to
reproduce these plants, how to protect the plants and animals from diseases and so on. IK
is not static. It evolved in response to changing ecological, economic and social
circumstances based on how creative and innovative members of the community are.
AIK has been observed to be a significant asset to communities in the area of decision
making towards sustainability. Adedipe et.al (2004) testified to the undeniable
importance of IK when they stated that this kind of knowledge , i.e. IK, are evidently
related to global science traits of Conservation; Biodiversity maintenance; Plant
physiological; and Entomological principles of crop protection and Pest management.
START (Global Change System for Analysis Research and Training) in its flood risk
2
analysis in the coastal communities in Nigeria noted that some communities in the Niger
Delta have used indigenous knowledge to forecast floods with some degree of accuracy.
Africa is a continent rich in indigenous knowledge and Nigeria, by all indication, is a
major contributor to this richness. Nigeria’s richness in indigenous knowledge (IK) can
be attributed to the large number of (divers) ethnic groups in the country. Relevantly is
AIK. This varies from indigenous yam production and control of mite in Poultry farming
in the South to control method for pest and disease of cattle in the North, to mention a
few. A number of researches have been carried out with the aim of identifying some of
the indigenous agricultural practices in selected places in Nigeria but this knowledge does
not exist in any structured form. Based on the researchers inquiry there is no such
collection or large documentation of indigenous knowledge in Nigeria.
It has been shown that organizations that are able to harness knowledge grow stronger
and are more competitive. This validates the more a saying about knowledge being
power. In the economy today, corporate success can be achieved through an
organization’s ability to acquire, codify, and transfer knowledge more effectively and
with greater speed than it competition. Jashapara (2011) considers knowledge as
‘actionable information’. Unlike data and information, which are letters and numbers
without context and with context, respectively, knowledge equips one with a greater
ability to predict future outcomes.
In a more definitive form, knowledge is information plus the rules for its application.
Knowledge is information associated with rules which allow inferences to be drawn
automatically so that the information can be employed for useful purposes. Knowledge
3
can be classified into implicit knowledge and explicit knowledge. Explicit knowledge is
the knowledge that is documented while implicit knowledge is knowledge in the human
brain; it is personal knowledge.
Agricultural indigenous knowledge (AIK) can be classified as tacit knowledge. The core
feature of AIK which qualifies it as tacit knowledge is that it is embedded in the farmer’s
brain. Tacit knowledge is accumulated through study and experience. It is a kind of
knowledge that grows through the practice of trial and error and series of success and
failure experiences. These features are also peculiar with traditional agricultural
practices.
Knowledge-based systems otherwise known as Expert systems are computer programs
that use knowledge of the application domain to solve problems in that domain, obtaining
essentially the same solutions that a person with experience in the same domain would
obtain. It is a system that tries to solve problems that will normally require human
experts.
An expert system is designed in a manner in which it imitates human experts’ thinking
process to proffer solution to problems. In order to get the most of an expert system it is
important to engineer knowledge appropriately otherwise it would be a case of “garbage
in, garbage out”.
The same can be said of a medical doctor who has not immersed himself well enough in
practice to diagnose a patient with malaria. He must be equipped with knowledge
acquired through studies and experiences which will enable him deliver the right medical
4
services for the right ailments. Thus, designing an expert system requires well pruned
processes of Knowledge acquisition, Knowledge representation and Knowledge
validation.
Expert systems have been noted to assist in a number of fields ranging from medicals
(MYCIN), automobile (ALTREX), building and construction (PREDICTE), to mineral
resources (PROSPECTOR), to mention a few. Expert systems can be applied to perform
functions such as interpreting and identifying, predicting, diagnosing, designing,
planning, monitoring, debugging and testing, instruction and training, and controlling.
1.2 Statement of Problem
In Africa there is limited documented literature in IK. This owes to the fact that IK is
transmitted among generations orally or through observation. It is passed unto
generations through traditional socialization processes by elders of indigenous
communities. These modes of learning are insufficient and unreliable in protecting IK
from going into extinction. According to Msuya (2007), lack of written memory on IK
has also led to its marginalization. He also pointed out that the new generation folks
spend most of the time nowadays in formal education and as such are exposed the more to
western education and less to IK.
Western education, which brings with it global knowledge, no doubt has advantages but
global knowledge without local knowledge is inefficient. Every knowledge system has its
origin and functions for which it came into existence. Rather than use a knowledge
system as a benchmark for other knowledge systems, each knowledge system should be
5
recognized as distinct and unique. Shiva, (2000) as cited by Gall (2009), opined that the
various knowledge systems should not be reduced to the language and logic of Western
knowledge systems as each of them has its own logic and epistemological foundations.
Banuri; Apffel-Marglin et al (1993) explained the differences between indigenous
knowledge and western knowledge. One of the points they noted as the difference
between the stated types of knowledge is based on a contextual ground. That is,
indigenous knowledge differs from western knowledge because indigenous knowledge is
more deeply rooted in its environment. It is people’s knowledge. Brokensha et al., 1980,
as cited by Agrawal (2004), therefore emphasized that to ignore people's knowledge is
almost to ensure failure in development.
The agriculture profession is one that has been facing intensive marginalization since the
discovery of oil in Nigeria. There is an increasing demand for white collar jobs while the
farm work is left for the poor rural farmers. Agriculture is not an area of interest to an
average Nigerian graduate; even the so called graduates of agricultural sciences abandon
their farming tools for pens.
Abebe et al as cited by Kolawole (2001) reviewed that farmers have quite a sophisticated
knowledge of agriculture based on insights from several generation and he stressed the
need to document and preserve the knowledge in situ and ex situ. The emphasis, of this
present project however, is on agricultural indigenous knowledge (AIK) and how its use
can be aided by an expert system. In designing an expert system for AIK, there are
accompanying advantages of protection, preservation, and improvement (in its use) of the
knowledge.
6
1.3 Overall Objective
The overall objective of the study is to develop a knowledge-based system which will
manage indigenous knowledge for crop protection.
1.3.1 Specific objectives
The objectives of this study are to:
To elicit domain knowledge on local crop pests and disease;
To elicit domain knowledge on local pest and disease control ;
To elicit domain knowledge on local storage methods;
To develop a knowledge-based system that can reason based on the indigenous
knowledge provided and proffer solutions to problems in the domain.
1.4 Justification of the study
In the history of humans, people have sustained themselves by using the natural resources
around them in a largely suitable manner (Akegbejo-Samsons, 2009). Many of these
survival practices particularly those that are unique to indigenous people around the world
are disappearing. This therefore heavily threatens the existence of indigenous knowledge.
Indigenous knowledge in agriculture is only one out of the numerous categories of
indigenous knowledge that suffer the threat of extinction. As the greater part of
agricultural produce in Nigeria comes from rural farmers there is a need to pay attention
to the farmers’ local knowledge system. Hansen et al (1987) as cited by Bamigboye and
Kuponiyi (2010) stated that researchers have observed that these indigenous agricultural
7
practices are cost-effective and it poses less production risks such as environmental
degradation. An understanding of indigenous knowledge systems will enable
agriculturalists take advantage of the benefits offered by the age old practices.
Warren and Rajasekaran (1993) noted that policy makers and agricultural development
planners are beginning to give attention to existing indigenous knowledge systems and
decision-making processes. Indigenous knowledge if built upon will enhance local
development, enhance sustainability and capacity building such as this study provides.
This is based on the fact that a clear understanding of a community’s indigenous
knowledge will provide the basis for basic communication with the farmers. Indigenous
knowledge should form the foundation for agricultural and food policy initiatives and
technological interventions.
Every phase of this present project is vital but a more significant phase without which this
project would not be relevant is the knowledge acquisition phase. Knowledge acquisition
refers to the processes by which knowledge is acquired, either from primary or secondary
sources. Primary and secondary sources were considered for the supply of the knowledge
required for this project but while some of them have yielded the results many of these
sources have not proven to provide sufficient knowledge for the purpose due to some
constraints.
The Faculty of Agriculture and Forestry at the University of Ibadan was selected as a
source for data needed for this present project. On visitation to some of the departments
of the faculty (Agricultural Extension and Rural Development department, Crop
Protection and Environmental Biology department, and Agronomy department) the senior
8
researchers whom the researcher interacted could not provide such data. The senior
researchers stated clearly that there is no such documentation (of indigenous knowledge
used for pest control and disease management in crops). Some of the senior researchers
offered textbooks which they thought could provide some information. In their opinion
such data can only be elicited from farmers, thus, they suggested that the researcher visits
various farming communities in order to acquire such information in details.
Based on the recommendation of the senior researchers, the researcher interviewed
farmers in Ijero Ekiti. It was a process which consumed time and financial resources.
Some of the farmers were able to provide some information based on the crops they
specialize in. It was observed that the farmers, being the elderly ones, were gradually
forgetting the indigenous methods. It took some of the farmers significant time to
remember the names of pests, the names of leaves or other ingredients used to prepare
solutions for treating infested crops. This owes to the fact that they have been introduced
to the use of modern pesticides and herbicides which has reduced the use of local
pesticides.
The researcher proceeded to some research institutes such as International Institute for
Tropical Agriculture (IITA), National Stored Products Research Institute, and Nigerian
Institute of Social and Economic Research (NISER). The researchers spoken with said
they do not have documented indigenous knowledge. As a matter of fact they strongly
believe that such information should be available at the Faculty of the Agriculture and
Forestry at University of Ibadan.
9
The researcher also visited the indigenous knowledge library at Nigerian Institute of
Social and Economic Research (NISER). The books, periodicals and journals which were
consulted did not spell out the indigenous knowledge used for pest control and disease
management rather they emphasized the importance of indigenous knowledge for
development. A source at the National Centre for Genetic Resources and Biotechnology
(NAGRAB) whom the researcher spoke with said based on his interaction with farmers
during his duties as an extension officer he has no doubt that agricultural indigenous
knowledge is invaluable but to his knowledge there is no collection whether in prints or in
an electronic database to preserve these elements of knowledge.
This demonstrates the urgency of harvesting and documenting of all available indigenous
knowledge and the necessity of a much bigger project which could be well organized and
funded by national or international research institutes.
Due to time, financial and logistic constraints the project study cannot assume the
responsibility of the proposed bigger project. However, it presents a template and a
knowledge-based platform upon which the proposed project can be based.
A knowledge-based system in AIK will reveal the step by step processes that rural
farmers apply in their farming processes. It is, thus, capable of providing this information
to agricultural researchers and other practitioners in a format easily accessible for use and
modification where, and if, necessary.
10
A knowledge-based system serves beyond documentation but also provides solutions to
problems. Some of the benefits a knowledge-based system for indigenous agricultural
practices will offer are highlighted below.
Preserve and protect agricultural indigenous practices ;
Provide researchers and scientists with a problem-solving platform which will assist
in research;
Provide a platform for diffusing and integrating agricultural indigenous knowledge
with scientific knowledge to improve agricultural production;
Serve students in their academic work;
Serve as a tool for extension workers in their field work.
It could also be useful to young farmers who cannot afford expensive pesticides.
1.5 Scope of the Study
The scope of the study is to build an expert system shell which can describe indigenous
methods of crop storage and also be used to identify pests and diseases in selected crops
and proffer indigenous methods of controlling the pests and diseases.
The knowledge in the knowledgebase is limited to indigenous/traditional knowledge
used in agriculture. The expert system provides an interactive user interface through
which users can interrogate the system.
1.6 Definition of Terms
Artificial intelligence: it is the study of ways in which computers can perform tasks
which people are better at.
11
Disease: an abnormal condition of an organism which interrupts the normal growth
and function of the organism.
Expert system: an expert system is a computer system designed to solve problems in
specific narrow domain in the same way human experts will do.
Indigenous knowledge: indigenous knowledge is local or traditional knowledge
acquired by communities over the years through interactions with their environment
in a bid to survive.
Pest: a destructive insect or other animal that attacks plants, crops or animals.
Prolog: Programming in Logic
12
CHAPTER TWO
LITERATURE REVIEW
2.1 Artificial Intelligence
The name ‘artificial intelligence’ dates back to 1955 when McCarthy, Minsky, Rochester,
and Shannon at the Dartmouth conference made a proposal to study artificial intelligence.
The study, they said,” was to proceed on the basis of the conjecture that 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 “ (Rich, 2003).
Alan Turing, however, had in 1950 implied the name artificial intelligence in his paper
‘Computing Machinery and Intelligence’ when he asked the question “Can machines
think?” Turing in an attempt to prove the said intelligent behavior of a machine against
that of a human being, proposed a test which he called the imitation game. In the
imitation game, he placed the machine and a human in a room and a second human in
another room. The second human is the interrogator in the game. The interrogator then
communicates with the human counterpart and the machine in the other room via a
textual device. The interrogator through a question and answer session is expected to
distinguish the computer from the human based on the responses he gets for the questions
he poses. If the interrogator is unable to tell the difference, Turing argues, the computer
can be assumed to be intelligent.
Artifice outlined three important features of Turing’s test. The features are:
1. The test attempts to give an objective notion of intelligence, i.e., the behavior of a
known intelligent being in response to a particular set of questions.
13
2. It prevents us from being sidetracked by such confusing and currently unanswerable
questions as whether or not the computer uses the appropriate internal processes or
whether or not the machine is actually conscious of its actions.
3. It eliminates any bias in favor of living organisms by forcing the interrogator to focus
solely on the content of the answers to questions. (UVETEJO, 2007)
Russel and Norvig noted, however, that a computer must possess some capabilities to
enable it pass the test. The computer must be able:
To communicate in natural/human language (natural language processing);
Store what it knows or hears (knowledge representation);
Use the information it stores to provide answers, make inferences and also to draw
conclusions(automated reasoning);
To adapt to new circumstances and to detect patterns and to further extent the
application of such patterns (machine learning).
The question which evolves at this point is, what is intelligence? There has been a long
history of debate as to what intelligence is, and despite the decades of research there is
still no single acceptable or standard definition of intelligence. Several definitions of
intelligence have been recorded. Legg and Hutter (2006) noted that there are obvious
strong similarities between the numerous proposed definitions of intelligence. Some
definitions of intelligence given are as follows:
“A person possesses intelligence insofar as he has learned, or can learn to adjust
himself to his environment”. S. S. Colvin
“…. the ability to plan and structure one’s behavior with an end in view” J. P. Das
“…in its lowest terms intelligence is present where the individual animal, or human
being, is aware, however dimly, of the relevance of his behavior to an objective.
14
Many definitions of what is indefinable have been attempted by psychologists, of
which the least unsatisfactory are:
1. The capacity to meet novel situations, or to learn to do so, by new adaptive
responses and,
2. The ability to perform tests or tasks involving the grasping of relationships, the
degree of intelligence being proportional to the complexity, or the abstractness, or
both of the relationship” J. Drever
“…adjustment or adaption of the individual to his total environment, or limited
aspects thereof …the capacity to reorganize one’s behavior patterns so as to act more
effectively and more appropriately in novel situations …the ability to learn …the
extent to which a person is educable …the ability to carry out on abstract thinking …
the effective use of concepts and symbols in dealing with a problem to be solved…”
W. Freeman
Amtar (1976), remarked that the major problem with the several viewpoint is that
intelligence is generally regarded as a uniquely human quality. He stated further that we
humans are yet to understand ourselves, our capabilities, or our origins of thought.
Minsky (1991), on the contrary, points out a problem of attempts to unify theories of
intelligence. He assigns blame to lack of clarity in distinguishing between some broad
aspects of what constitutes intelligence. Minsky offered the definition of intelligence as
“…the ability to solve hard problems”. But there arise a question such as “at what point is
a problem regarded as hard?” and “who decides which problem is hard?” A problem
remains hard as long as one does not know how to go about solving it and the moment it
is solved it becomes easy.
15
Schwartz (2006) therefore regards intelligent any organism or system that is able to make
decisions. Decisions are vital ingredients of survival and as long as there are goals to be
achieved decisions must be made in order to achieve them. In his opinion, any proposed
definition of intelligence should not rely on comparisons to individual organism.
According to Carne (1965), as cited by Schwartz (2006), the basic attribute of an
intelligent organism is its capability to learn to perform various functions within a
changing environment so as to survive and to prosper.
Several definitions have also been offered for artificial intelligence. Artificial intelligence
(AI) is the study of how to make computers do things which, at the moment, people are
better (Rich, 1983). Artificial intelligence can be referred to as an information-processing
program, the information-processing element which can be likened to human thinking.
Simon (1966), according Frantz (2003), identified three operations that are peculiar to
human thinking and information-processing programs. He noted that human thinking and
information-processing programs scan data for patterns, store the patterns in memory, and
then apply the patterns to make inferences or extrapolations.
After a thorough examination of some definitions of artificial intelligence Russell and
Norvig (2003) observed a pattern along the definitions. The definitions he examined
described artificial intelligence along four main dimensions: thinking rationally, acting
rationally, thinking humanly, and acting humanly
16
Systems that think like humans“The exciting new effort makes computers think…machines with minds, in the full and literal sense.” (Haugeland, 1985)“[the automation of] activities that we associate with human thinking, activities such as decision-making, problem solving, learning..” (Bellman, 1978)
Systems that think rationally“The study of mental faculties through the use of computational models.” (Chamiak and McDermott, 1985)“The study of the computation that make it possible to perceive, reason, and act.” (Winston, 1992)
Systems that act like humans“The art of creating machines that perform functions that require intelligence when performed by people.” (Kurzweil, 1990)“The study of how to make computers do things at which, at the moment, people are better.” (Rich and Knight, 1991)
Systems that act rationally“Computational Intelligent is the study of the design of intelligent agents.” (Poole et al., 1998)“AI …is concerned with intelligent behavior in artifacts.” (Nilsson, 1998)
Artificial intelligence has roots in a number of disciplines. These disciplines include
Philosophy, Logic/Mathematics, Computation, Psychology/Cognitive Science,
Biology/Neuroscience, and Evolution.
2.2 Artificial General Intelligence and Narrow Intelligence
The original notion behind artificial intelligence was to create machines that simulate
human reasoning in solving problems, that is, a machine that thinks. This attracted the use
of the terms “Artificial Intelligence” and “Artificial General Intelligence (AGI)”
interchangeably. Attempts were made to develop machines that could solve variety of
complex problems in different domains. Some of the AGI systems that were developed
are:
General Problem Solver
Fifth Generation Computer Systems
DARPA’s Strategic Computing
17
Wang (2007) recorded that despite the ambitiousness of the AGI projects, they all failed.
Due to these failures, artificial intelligence aim was redirected to solving domain-specific
problems and providing special purpose solutions. Thus, “Narrow Intelligence”.
Narrow artificial intelligent systems are systems that demonstrate intelligence in
specialized domains. Artificial intelligence has been applied in the following areas:
Game: Game Playing is one of the oldest and well-studied domains of artificial
intelligence. a basic feature of game in artificial intelligence is its mixture of different
approaches of representing in intelligence (Wexler, 2002).
Natural Language Processing: This area of artificial intelligence tries to take on
one of the inherent capabilities of human beings – Understanding language. In natural
language processing machines are made in such a way that they can understand
natural language. A machine that understands natural language carries out the
following steps consecutively: speech recognition, syntactic analysis, semantic
analysis and pragmatic analysis.
Computer Vision: This is an area of artificial intelligence that deals with the
perception of objects through the artificial eyes of an agent, such as a camera
Machine Learning: Machine Learning, as the name implies, involves teaching
machine to complete tasks. It emphasizes automatic methods, that is, the goal of
machine learning is to device learning algorithms that do the learning automatically
without human intervention or assistance. It is an area of artificial intelligence which
intersects broadly with other fields such as statistics, mathematics, physics, and so on.
Examples of machine learning problems are Face detection, Spam filtering, and Topic
spotting.
Neural Networks: a neural network is a massively parallel distributed processor that
has a natural propensity for storing experiential knowledge and making it available for
18
use. It is a machine that is designed to model the way in which the brain performs a
particular task or function of interest; the neural network is usually implemented using
electronic components or simulated in software on a digital computer (Hajek, 2005).
Expert Systems: Expert systems are computer programs that are designed to replicate
knowledge and skills of human experts in specific narrow domains.
2.3 Expert Systems
Expert systems are computer software which are developed to provide solutions to
problems in narrow domains. The solutions provided by the expert system should be the
same, if not better, as would be provided by the domain-expert if he was to solve such
problem. Expert system, though takes roots in cognitive science, has been a significant
aspect of artificial intelligence research and quite a number of systems have been
developed. Expert systems, according to Anjaneyulu (1998), encode human expertise in
limited domains.
Armstrong (2002) defines expert system as a program that emulates the interaction a user
might have with a human expert to solve a problem. Expert systems do not make
significant use of algorithms rather they use rules of thumb (heuristics), as an expert
normally will do.
Expert systems are beneficial in a number of ways.
Expert systems, unlike human experts, are readily available when needed.
Human experts may get tired or forget things but experts systems do not exhibit such
frailties
Expert systems can be used to train experts and pass knowledge to non-experts
19
Due to the various distractions in the environment human experts may be inconsistent
in carry out their task. An expert system is consistent.
Expert systems are usually the result of the pooling of resources of various experts.
Expert systems produce results faster than humans
Expert systems, in the long run, are cheap.
The process of designing expert systems is called Knowledge Engineering. The
knowledge engineering process consists of sub-processes which are knowledge
acquisition and knowledge representation.
2.4 Knowledge Acquisition and Representation
Knowledge acquisition is a process which involves gathering of knowledge form books,
journals, databases and most importantly experts in a domain of expertise. The
knowledge engineer irrespective of whether he has a deep knowledge of the domain or
not is charged with the responsibility of gathering the knowledge required to build a
knowledge system. This process is one which needs the elicitors’ keen attention so as to
ensure that knowledge is captured in the sense that the expert means it to be. Collecting
knowledge from secondary sources may not be as challenging as collecting from primary
sources, i.e. the knowledge experts. The major challenges a knowledge engineer might
encounter in this process is either the unwillingness of the experts to share the knowledge
or the lack of awareness. Knowledge engineers should beforehand equip themselves with
the knowledge eliciting skills and general domain awareness before engaging with the
experts, thus, Knowledge Elicitation.
Knowledge elicitation, according to Regoczie and Hirst (1992) as cited by Cooke (1999),
is a sub process of knowledge acquisition which is further a sub-process of knowledge
engineering. Shadbolt and Murton (1995) refer to knowledge elicitation as a subtask of
20
gathering information from experts. Knowledge elicitation asks the question, how do we
get experts to say exactly what they do and why?
Shadbolt and Burton (1995) expatiated on the different methods of eliciting knowledge
from experts. Some of the methods of knowledge elicitation are:
Structured interview: This is an organized and planned discussion format for
knowledge elicitation. The knowledge engineer must have planned the whole session.
The advantage of using structured interview is that it provides structured transcripts
that are easier to analyse. Shadbolt and Borton (1989)
Protocol Analysis (PA): In PA the knowledge engineer makes video or audio records
of the expert. Protocols are made from the records and the knowledge engineer further
extracts meaningful rules from the protocols. Shadbolt and Borton (1989) The
knowledge engineer could record the expert while he (expert) solves a problem; the
experts in the process will give commentary concurrently describing what he is doing
as he solves the problem. This is called On-line PA. When the expert comments
retrospectively on the problem solving session the process is called Off-line PA.
Shadbolt and Borton (2006)
Concept sorting: The concept sorting method is used to reveal how an expert relates
different concepts in his domain of expertise. The expert is presented with cards on
which is written different concepts. The cards are shuffled and the expert is told sort
the cards into piles he finds appropriate.
Laddered grids: This process requires that the expert and knowledge engineer
construct a graphical representation of the domain terms of the relations between
domain elements.
21
The choice of which method to use depends on the expert from whom the knowledge
will be elicited and the type of knowledge to be elicited. The knowledge engineer is
allowed to use more than one method in the knowledge eliciting process.
As earlier stated knowledge representation is one of the processes that a knowledge
engineer must pay keen attention to in designing an expert system. The time and effort
that a knowledge engineer put into eliciting knowledge from experts will not be fully
credited if the knowledge engineer does not represent the knowledge acquired in such a
way that it enables effective automated reasoning. In an attempt to proffer solution to real
life problems, an expert first observes the problem and then internalizes it in a language
that will assist his reasoning about the problem. Reasoning is a thought process based on
what the expert has been able to internalize and from which he/she draws inferences or
makes conclusion. The computer program is also expected to work in this same way but
is deficient in the area of observing and representing the real life problem in its own
language. The knowledge engineer is thus faced with the responsibility of representing
knowledge in the language the computer is designed to understand.
The knowledge acquisition phase is succeeded by the knowledge representation phase.
Knowledge representation is the way knowledge is encoded. Copping (2004), identifies
knowledge representation as a very core of Artificial Intelligence (AI). Symbols, whether
character strings or numbers, are ways AI Programmers represent and manipulate
knowledge on computers in order to generate information. Information described in this
contexts refers to the advice generated by an expert system based on the knowledge
which has been well represented and intelligently manipulated. This differs from
information generated from data as in the case of statistical information. Data is raw
22
information which ordinarily might not make much sense until it is processed into
information. Data is also represented by symbols but it should not be confused with
knowledge. Data is the lowest stage or state of describing or representing reality; at that
stage or state a person cannot make meaning of the representation because it is without a
context. Knowledge on the other hand has an understanding pattern.
Knowledge, if represented appropriately, should enable fast and accurate access to
knowledge and an understanding of the content. A good knowledge representation model
should have the following capabilities:
Representational adequacy: this is the ability of the system to represent the
knowledge in the domain it is being used.
Inferential efficiency: is the system’s ability to manipulate the structures that have
been represented within it in order to produce new knowledge inferred from the old
ones. It is the system’s ability to reason with the knowledge provided to produce
new knowledge.
Inferential adequacy: is the system’s ability to incorporate additional knowledge
structure that can be can be used to direct the focus of the inference mechanisms in
the most promising direction.
Acquisitional efficiency: is the ability of the system to acquire knowledge using
automatic methods wherever possible rather than rely on human intervention.
Literature however revealed that, so far, no single representational formalism optimizes
all the capacities.
Knowledge can be represented through different mechanisms/models namely: Rules,
Frames, O-A-V triplet (Objects, Attributes, and Values), Semantic net, and Logic. Each
of these models is briefly explained below.
23
Rules: this model of representation usually takes the “IF, THEN” form. Knowledge is
represented in condition-action pair, (Haq). In the rule-based system, according to
Giarratano (2004), the inference engine determines which rule antecedents are satisfied
by the facts. The rules are there to assist the system draw conclusions based on the facts
provided.
Example:
IF X THEN Y; X being the antecedent and Y the consequence. Say, IF infected joints
THEN arthritis.
Frames: this model consists of a set of nodes, each representing objects, connected by
relations. The knowledge in the frame is divided into slots to which values are assigned.
Example
Figure 2.1: Frames
24
Bird Frame
Families: Robin
Government Protected Frame
Endangered species: robins, eagles
Robin Frame
Is a: Bird
Is an: Endangered species
Fly: Yes, Wings: yes
Mini: instance frame
Is a: robin
Lives in: nest
Facet
Location: pine tree
Facet:
Location: Wang’s yard
Instance of
An advantage of using the frame model is that information about an object is stored in
one place, however when the object to be described has a lot of properties and many
relationship need be reflected, it becomes complex.
O-A-V triplet: the Object, Attribute, and Values method simply represents knowledge
showing their characteristics and the measure of the attribute. Objects here could either be
physical or conceptual.
Example
Figure 2.2: O-A-V Triplet
Semantic Net: this system represents knowledge using graphs. The graphs are made up
of nodes (which represents objects), and edges/links (which represents the relationship
between the objects)
Figure 2.3: Semantic Net
Coppin (2004), noted that as much as semantic nets provide a very intuitive way to
represent knowledge about objects and existing relationships. Semantic nets being
graphical representation can get cumbersome when the graphs are too many. It also
cannot represent relationship between three or more objects.
25
Dog Weight, Colour, Breed
15kg, White, Poodle
Fish
Jerry
Phil
Blue
Water
Aquarium
colour
Is a
owns
inlives
Logic: this is concerned with reasoning and validity of arguments, Cooping (2004). It is
concerned about the validity of a statement rather than its truthfulness. Take for instance
the following statements:
Fishes live on land
Jerry is a Fish
Therefore, Jerry lives on land.
The concluding statement is logical based on the previous statements. The reasoning
process determines the conclusion based on the premises; thus, the validity of a piece of
reasoning is based on if it leads to a true conclusion in every situation where the premises
are true.
The types of logic representation are Propositional logic, Predicate logic, First order
logic, Temporal logic, and Fuzzy logic.
Irrespective of the knowledge representation model an engineer selects for a project
he/she should bear in mind the stages that must be followed, so as to enhance the desired
outcome. Poole (1999) developed a framework for representing knowledge.
Figure 2.4: Poole (1999) Framework for representing knowledge.
2.5 Agriculture and Indigenous Knowledge
26
Problem
Representation
Solution
Output
represent
compute
interpret informal
formal
solve
The agricultural sector has the potential to provide a jumping-off point for a nation’s
industrial and economic development. This is owed to the multiplier effect which springs
from the sector’s activities. A vibrant agricultural sector, according to Ogen (2007),
would enable a country to feed its growing population, generate employment, earn
foreign exchange and provide raw materials for industries. He further emphasizes that the
agricultural sector is the engine of growth in virtually all developed economies.
Of the79 million hectares of arable land which Nigeria has 32 million hectares are
cultivated. Eighty percent of all farm produce in the country is produced mostly by
subsistence farmers, thus, leaving crop and livestock production below potentials.
(Nwajiuba, 2012)
Indigenous knowledge (IK) is accumulated store of cultural knowledge that is generated
and transmitted by communities from one generation to another. This knowledge
encompasses how to adapt to, make use of, and act upon physical environments and the
material resources in order to satisfy human wants and needs (Gbenda, 2010).
Indigenous knowledge, according to Workineh et. al (2010), stands out. This is because it
is an integral part of culture and unique to every given society, and it was developed
outside the formal educational system. Due to inter-cultural relationships indigenous
knowledge in some communities has been modified.
Quite a number of terminologies have been used to refer to indigenous knowledge. Atte
(1986), as cited by Williams and Muchena (2000), listed some terms which are
synonymous to indigenous knowledge. These terms include indigenous knowledge
systems, indigenous technical knowledge, ethno-science, local science, traditional
science, people’s science, and village science. Irrespective of its size every community
27
has its own local knowledge, as the local knowledge is the keystone for decision making
to ensure harmonious survival with nature.
There are increasing numbers of literatures on indigenous knowledge in recent times.
This is not to say that indigenous knowledge is a new area of research. Anthropologists
have been in the “business” of studying and documenting people’s culture, practices,
beliefs, and customs for years (Schneider 2000). They have traditionally been academic
loners, spending long periods, ranging from months to several years, for field work and
data analysis. Schneider highlighted three new areas of interest indigenous knowledge as:
The interest in indigenous technologies
The involvement of non-anthropologists and development professionals in recording
indigenous knowledge
The speed with which it is now being accomplished.
This shows that indigenous knowledge is gradually gaining the long expected
significance in the modern society. Agrawal (2004) noted that earlier theorists saw
indigenous knowledge and institutions as obstacles to development.
Williams and Muchena (2000) identified the unique, dynamic and creative features of
indigenous knowledge. It is unique in that it is generated in response to the natural and
human conditions of a particular environment and context. It is dynamic and creative in
that experimentation and evaluation are continually stimulated by both adaptation
requirements and external influences. Elen and Harris (1996), according to Senanayake
(2006), provided more characteristics of indigenous knowledge. These comprehensive
and conclusive characteristics are as follows.
28
Indigenous knowledge is local. It originates from a particular place based on several
experiences of people living in that particular place.
Indigenous knowledge is transmitted orally, or through imitation and demonstration
Indigenous knowledge is the consequence of practical engagement in everyday life
and is constantly reinforced by experience and trial and error.
Indigenous knowledge is empirical rather than theoretical knowledge.
Repetition is a vital characteristic of tradition even when new knowledge is added.
This is because repetition aids retention and reinforces ideas.
Tradition could be considered as ‘a fluid and transforming agent with no real end’
when applied to knowledge and its central concept is negotiation. Indigenous
knowledge is not static as it is often represented; it is rather constantly changing as
well as reproduced; discovered as well as lost.
Indigenous knowledge is mainly shared to a much greater degree than other forms of
knowledge. Its distribution is, however, still segmentary and socially clustered.
Although indigenous knowledge may be focused on particular individuals and
knowledge may be focused on particular individual and may be focused on particular
individuals and may achieve a degree of coherence in rituals and other symbolic
constructs, its distribution is always fragmentary. It generally does not exist in its
totality in any one place or individual. It is developed in the practices and interactions
in which people themselves engage.
Indigenous knowledge is characteristically situated within broader cultural traditions;
separating the technical from the non-technical, the rational from the non-rational is
problematic.
Indigenous knowledge is an invaluable asset for sustainable development. It offers
new models for development that are both ecologically and socially sound.
29
(Senanayake, 2006). A World Bank report noted the relevance of indigenous
knowledge on three levels for development processes.
Firstly, indigenous knowledge is important for the local communities in which those
who bear such live and produce.
Development agents such as NGO’s, government, donors, local leaders, private sector
initiatives also need to recognize, value and appreciate the knowledge as they interact
with the local communities. A thorough understanding of a community’s indigenous
knowledge will result in a successful incorporation of it into development projects.
Thirdly, indigenous knowledge forms part of the global knowledge. Indigenous
knowledge in itself is valuable and relevant. It can be preserved, transferred, or
adopted and adapted elsewhere.
Agricultural indigenous knowledge is local and traditional knowledge used by farmers in
farming, dairy and poultry production, raising livestock, land evaluation, and soil fertility
to mention a few. It is the means by which farmers adapt to their environment so as to
achieve food, income, and livelihood in the midst of changing agricultural environment.
Farmers, over the years, have gained knowledge of crops and animals around them. This
has given them knowledge about uses and usefulness of specific plant and animals. These
farmers have been, traditionally, the managers of crop germs plasm and its diversity for
generations, through the testing, preservation and exchange of seeds through informal
networks. Their special knowledge of the values and diverse uses of plants for food
security, health and nutrition is very vital. (Upreti and Upretu, 2000)
Farmer’s use of indigenous knowledge is in an unorganized manner, they search for
solutions for their local farming problems through indigenous knowledge. This kind
30
technology is user-derived and time-tested. Senanayake (2006) noted a critical strength
of the indigenous knowledge; its ability to see the interrelation of disciplines, and then
integrate them meaningfully. This holistic perspective and the resulting synergism show
higher levels of developmental impact, adaptability and sustainability than Western
modern knowledge.
Bamigboye and Kuponiyi (2010) in their study of indigenous knowledge systems for rice
production in Ekiti state identified some reasons why most of the farmers preferred the
knowledge. The farmers use indigenous knowledge for its Affordability: For instance
grass cutter is controlled by digging trench round the farm and setting of traps,
Environmental-friendliness: most of the techniques were also considered
environmentally friendly, if not they would have been long forgotten, Effectiveness, and
Communicability: A large number of the farmers considered the knowledge easily
communicable.
2.6 Expert Systems Application in Agriculture
The production of agricultural products, whether crops or animals, has evolved into a
complex business requiring the accumulation and integration of knowledge (indigenous
knowledge inclusive) and information from many diverse sources. In order to survive
intense competition, the modern farmer often relies on agricultural specialists and
advisors to provide information for decision making. Unfortunately, agricultural specialist
assistance is not always available when the farmer needs it. In order to alleviate this
problem, expert systems were identified as a powerful tool with extensive potential in
agriculture.
31
Prasad and Babu (2006) highlighted three features of an agricultural expert system.
It simulates human reasoning about a problem domain, rather than simulating the
domain itself
It performs reasoning over representations of human knowledge
It solves problem by heuristics or approximate methods
Early expert systems in agriculture include:
POMME: This is a system which is used for apple orchid management. It offers advices
to farmers on the appropriate time to spray their apples and what to spray in order to
avoid infestation. Additionally, it also provides advice regarding treatment of winter
injuries, drought control and multiple insect problems.
CUPTEX: An expert system for Cucumber Crop Production. It has subsystems on
Disorder diagnosis, Disorder Treatment, Irrigation Scheduling, Fertilization Scheduling,
and Plant care.
CITEX: An expert system for Orange Production. It has subsystems on farm assessment,
Irrigation Scheduling, Fertilizer Scheduling, Disorder diagnosis, and Disorder treatment.
TOMATEX: An expert system for Tomatoes. The disorder diagnosis subsystem provides
information about the causes of user complain and it verifies user assumption, while the
disorder treatment offers the user advice about the treatment operation of the infected
plant.
LIMEX: A multimedia expert system for Lime Production.
CHAPTER THREE
SYSTEM ANALYSIS
32
3.0 Introduction
System analysis describes in detail the existing system, thereby identifying the
deficiencies of the system as justification for the need of an improved system.
Additionally, this section will describe the alternative system briefly with emphasis on
how it will overcome the problems posed by the existing system. A thorough analysis of
the alternative system will be given in the succeeding chapter. The methods used for data
collection will also be described.
3.1 Existing System
Crop protection is a very significant aspect of agriculture which draws on the strategies to
prevent and control problems posed by pests, diseases, and weed in crop production.
Pests, diseases and weed may attack crops in either similar or dissimilar ways, their
effects on crops, however, are constant. The damages caused by pests, diseases, and weed
results in reduction of yields and low quality of yields, which consequently reduces the
profit margins for commercial farmers.
An invaluable asset in crop management is indigenous agricultural knowledge; it has
served as a means of survival through several generations. Sadly to say, indigenous
agricultural knowledge is fast disappearing. The documentation and distribution of
indigenous knowledge, according to Abioye et al. (2011), remain a big challenge
confronting librarians and other information professionals, particularly in Africa where
cultural practices are prevalent.
33
In the course of this present project it was found out there are no indigenous agricultural
knowledge databases and inquiry systems which could aid knowledge sharing,
distribution and preservation. There are documentations of general agricultural topics but
there is no documentation of agricultural indigenous knowledge, whether in print or
electronically. The importance of agricultural indigenous knowledge is widely
acknowledged by researchers but little has been done to document it.
Rural farmers who possess this knowledge merely share with their colleagues orally when
the need for it arises. Some institutions such as Organic Farmers Association also partake
in sharing some indigenous knowledge among interested farmers, but how much of
sharing and preservation can be done by such institutions considering the fact that these
institutions have roots in rural areas and they have limited resources, in terms of
Information and Communication Technologies (ICT). The existing system is highly
limited, if it is left unattended to the available indigenous agricultural knowledge may
become extinct.
3.2 Problems of the Existing System
The problems associated with the existing system include:
Limited knowledge sharing: it is important to know that no matter how relevant
knowledge is to the society they cannot benefit from it if it is not well distributed to
members of the society. In the existing system knowledge cannot be easily shared
among farmers, researchers and other stakeholders.
Knowledge loss: farmers (in this sense, experts) who possess this knowledge are most
elderly people who are fast approaching their dying days. The existing system does
34
not have a documentation sub-system for the knowledge, thus posing a greater risk of
knowledge extinction.
Considering the physical state of the experts (elderly farmers) much cannot be done in
the existing system.
3.3 The Proposed System
The proposed alternative system is a knowledge-based system, also called an expert
system. A knowledge-based system is a computer program designed to solve problems, in
specific narrow domains, in the manner in which human expert would. A knowledge
based system has features that will enable it store, share, and process knowledge.
Expert system in the agricultural environment is necessitated by the limitations associated
with conventional human decision-making processes. These limitations include:
1. Human expertise is very scarce. Farmers who practice indigenous agriculture are
not as many as in the early years of farming. Most of them have taken to modern
farming.
2. Humans get tired from physical or mental workload and this may cause them to
forget crucial details of solutions.
3. Humans are inconsistent in their day-to-day decisions.
4. Humans have limited working memory.
5. Humans are unable to retain large amounts of data in memory and may be slow in
recalling information stored in memory.
6. Humans die.
The system is designed to capture data such as the name of pests and diseases, treatment
for the pests and diseases, preparation of treatment solution (where necessary) and storage
35
methods.
Fig 3.1: An overview of the knowledge-based system
3.4 Benefits of the Proposed System
The knowledge-based system will capture data which will be processed to produce
results. Expert systems in the agricultural environment will offer benefits which are
solutions to the aforementioned problems. The system will:
1. Increase the probability, frequency, and consistency of making good decisions
2. Help distribute human expertise
3. Facilitate real-time, low-cost expert-level decisions by the non-expert
4. Permit objectivity by weighing evidence without bias and without regard for the
user’s personal and emotional reactions
5. Free up the mind and time of the human expert to enable him or her to
concentrate on more creative activities.
36
Knowledge Acquisition
Knowledge Verifications and Validation
Knowledge Representation
Know
ledg
e Ba
se a
nd o
ther
Com
pone
nts
Experts
Users
D
evel
oper
’s In
terf
ace
Knowledge Engineer
3.5 Methods of Data Collection
The data needed for this present project is indigenous knowledge used for pest and
disease control, symptoms of pest and disease attack, and storage methods. The
researcher started out by gathering data from the farming community of Ijero Ekiti in
Ekiti state. At the end of the process the data gathered was not substantial enough to
develop a knowledge-based system. The researcher, faced with the financial challenges
and limited time, resorted to gather more data from secondary sources.
Thus, data was collected from primary sources, through interview sessions, and secondary
source such as agricultural books, journals and publications. The data required for the
proposed system includes:
Name of Crops
Name of Pests
Name of diseases
Ingredients used for treatments
Methods of preparing treatment solutions (where necessary) and application
CHAPTER FOUR
SYSTEM DESIGN
37
4.0 Introduction
This chapter contains a detailed description of the proposed system. The description
includes objective of the system, the entities involved in the system, and the processing
procedure used by the system.
4.1 Objectives of the system
The main objective of the alternative system is to provide expert services in indigenous
pest and disease control and storage methods. Its sub objectives include knowledge
storage and knowledge sharing.
4.2 Expert System at Work
The functioning of the expert system requires a number of elements or subject. This
begins with the knowledge expert. The knowledge expert is responsible for the
coordination of other elements required to make it work.
Secondly is the domain expert. Domain experts are those who possess the knowledge in
the domain for which the system is built. In this present study farmers are the domain
experts.
The users of the expert system are farmers, extension officers, students and other
stakeholders in the agriculture industry.
The user interface is the front end through which the user will interrogate the system.
The expert system has an explanation facility which documents the reasoning steps of the
system. It also contains trace facility to trace the reasoning behavior in the system
38
The knowledge base component captures the domain knowledge. The names of crops,
pests, and diseases, descriptions of pest and disease control, descriptions of symptoms
and storage methods which were elicited from farmers and gathered from books are
contained in this component of system.
The inference engine consists of algorithms that process the knowledge which is
represented in the knowledge base.
4.3 Stages of Developing an Expert System
There are some basic steps to be followed in development of an expert system.
1. Identify a problem in a domain. The development of an expert system must be
justified by a real problem that needs to be solved. This system seeks to enhance
the use of agricultural indigenous knowledge in crop protection. Additionally, it
would create a platform to protect the indigenous knowledge.
2. Outline and describe the knowledge required for the system.
3. Select development tools. These are software and hardware components required
for the system development.
4. There are a number of methods that can be used to elicit knowledge. The
method(s) to be used can be chosen based its suitability to the type of knowledge
and convenience of the domain expert.
5. The knowledge engineer acquires the knowledge with the chosen method.
6. After the knowledge has been elicited the knowledge engineer analyzes. He
organizes the knowledge into the format which will suit the knowledge
representation method.
7. The design is done; it entails write of source codes. The logical and physical
views are also linked.
39
8. When the design has been completed the system should be tested to ensure that it
is working. By testing bugs can be detected and fixed.
9. Trainings of users and necessary structures should be put in place to make the
system ready for use.
10. In order to ensure that the functioning of the system is not interrupted, constant
checks should be carried out. Expert systems primarily need to be updated.
40
Identify domain
Fig 4.1: Processes of Expert System Development
4.4 COMPUTING ENVIRONMENT
41
Outline the
knowledge required
Select method for
knowledge acquisition
Acquire knowledge
Recode and organize knowledge
Select Development Tool
Design
Testing and Validation
Implementation
Maintenance
This comprises description of the hardware and software component required in the
development of the system.
4.4.1 Software
1. The design is based on SWI-PROLOG 6.1.2, thus, the need for a personal
computer
The system was developed with SWI-Prolog (6.1.2 version) because it offers some good
facilities.
It has a good environment: This includes ‘Do What I Mean’ (DWIM), automatic
completion of atom names, history mechanism and a tracer that operates on single
key-strokes. Interfaces to some standard editors are provided (and can be
extended), as well as a facility to maintain programs.
It has very fast compiler: Even very large applications can be loaded in seconds
on most machines. If this is not enough, there is a Quick Load Format that is
slightly more compact and loading is almost always I/O bound.
Transparent compiled code: SWI-Prolog compiled code can be treated just as
interpreted code: you can list it, trace it, etc. This implies you do not have to
decide beforehand whether a module should be loaded for debugging or not. Also,
performance is much better than the performance of most interpreters.
Profiling: SWI-Prolog offers tools for performance analysis, which can be very
useful to optimize programs.
Flexibility: SWI-Prolog can easily be integrated with C, supporting non-
determinism in Prolog calling C as well as C calling Prolog. It can also be
embedded in external programs. System predicates can be redefined locally to
provide compatibility with other Prolog systems.
42
Integration with XPCE: SWI-Prolog offers a tight integration to the Object
Oriented Package for User Interface Development, called XPCE. XPCE allows
you to implement graphical user interfaces that are source-code compatible over
Unix/X11, Windows and Mac OS X using X11.
Prolog was designed by Alain Colmerauer and Robert Kowalski, and is used in artificial
intelligence (AI) and computational linguistics. Prolog stands for “Programming in
Logic”. It helps to create logic models that describe the world in which a problem exists.
It is a declarative language whose code may be interpreted procedurally for the benefit of
programs steeped in procedural thinking.
Prolog is declarative language in that facts about the problem to be solved are stated
along with its rules. The inference engine uses the stated facts and rules to reason out
solutions to problems. Its procedural feature stems from the process by which it
accomplishes a task.
According to Merrit (2002), there are three main features which influence the
expressiveness of Prolog. These features are the rule-based programming, built-in pattern
matching, and backtracking execution. The rule-based programming allows the program
code be written in a more declarative form while the built-in provides for the flow of
control in the program. Backtracking is search process used by prolog. Whenever a non-
deterministic choice is made the program is made to go back and choose the next
alternative branch. This continues until it there is a match but if after all the nodes have
been searched and there is no match, it displays an output “no” or “false”.
A Prolog program basically consists of facts and rules. A fact is a prolog statement which
consists of an identifier (mostly referred to as Predicates) followed by an n-tuple of
43
constants (also called Arguments). For example:
Line 1 pest(rice,case_worm).
Line 2 pest(rice,stem_borer).
Line 3 pest(rice,grasscutter).
Line 4 pest(wheat,aphids).
Line 5 pest(wheat,mites).
Line 6 pest(Crop,Pest):-
Crop(Crop,Pest).
Lines 1 to 5 are facts. In the facts stated “pest” is the predicate while the other parts of the
statement (in parenthesis) are the arguments. Note that facts must always be ended with a
period in prolog. The facts states that rice has pests such as case worm, stem borer, and
grasscutter while wheat has pests such as aphids and mites. Lines 1 to 3 and lines 4 to 5
can be restated in the form of lists.
Line 7 pest(rice,[‘case_worm’,’stem_borer’,’grasscutter’]).
Line 8 pest(wheat,[‘aphids’,’mites’]).
Line 6 is a rule which consists of a head and a body separated by “:-“. The symbol “:-“
means “if”. The head of the rule is true if all predicates in the body can be proved to be
true. The head of the rule is the conclusion or goal to be achieved while the body is the
condition(s) which must be fulfilled in order for the goal to be achieved.
Prolog was chosen for the development of this system because it is well suited for solving
problems that involve objects and relations between objects.
2. NetBeans IDE: NetBeans is an integrated development environment (IDE) for
developing primarily with Java, but also with other languages, in particular PHP, C/C++,
44
and HTML5. It is also an application platform framework for Java desktop applications
and others.
The NetBeans IDE is written in Java and can run on Windows, OS X, Linux, Solaris and
other platforms supporting a compatible JVM.
The NetBeans Platform allows applications to be developed from a set of modular
software components called modules. Applications based on the NetBeans Platform
(including the NetBeans IDE itself) can be extended by third party developers.
Java Program Execution
The Java byte-code compiler translates a Java source file into machine independent byte
code. The byte code for each publicly visible class is placed in a separate file, so that the
Java runtime system can easily find it. If the program instantiates an object of class A, for
example, the class loader searches the directories listed in your CLASSPATH
environment variable for a file called A.class that contains the class definition and byte
code for class A. There is no link phase for Java programs; all linking is done
dynamically at runtime.
4.5 Information Flow
Below is the breakdown of information flow within the system:
i. Input
Crop selection form
Pest/Disease/Storage/Symptoms selection form
ii. Output
Treatment display form
45
Fig 4.2: Logical View Chart
The logical view above highlights the components of the front end of the knowledge-
based system. The view consists combo box such as that from which a choice of crop is
made, radio buttons which can be checked to make a choice of pest, or disease or
storage, list area which contains a list of pests or diseases (this is dependent or the choice
made with the radio buttons), text area which displays results, and buttons which enable
processing such as analyze, refresh and close. The view also contains a progress bar and
a form label. The menu bar has file and help labels.
A program flowchart describes what takes place in a program; it displays specific
operations and decisions, their sequences within the program run or phase.
46
Start
Crops Pest/Disease/Storage Analyze Display Box
Refresh
Close
Fig 4.3: Program Flow Chart
The user selects the crop for which he wants information about and further selects of pest,
disease or storage depending on what he wants to know about the crop he selected. He
sends the information into the system by clicking on the analyze button. The system
processes the information supplied and returns answers into the text area. The user can
47
Select Crop
Select either Pest or Disease or Storage
Pest Storage Disease
Symptoms and Control
Storage methods
Symptoms and Control
Refresh
refresh the system if he wants to interrogate the system again and he can close the
application at the end of the session.
CHAPTER FIVE
SYSTEM DEVELOPMENT
48
5.1 Introduction
This chapter describes the implementation of the Rule Based System. The program
development necessitates the transformation of system design specifications into
functional applications accessible to users. It describes the actual processes of
specification, programming, compilation, installations, and testing.
5.2 Programming
As stated earlier in the previous chapter, the Rule-Based System was implemented
in SWI Prolog. The language was chosen because it permits express declaration of
information and the rules that would be applied to the information so as to generate
knowledge. Unlike procedural languages where the programmer writes instructions
that tell the computer what to do and how to do it, declarative languages, one of
which Prolog is, only requires a database of facts and rules and the system will
provide the answers to queries based on the facts and rules given.
The following tasks were carried were carried out:
Input and Edit: The acquired knowledge was systematically entered into the
knowledge-base as prolog declaratives. This approach makes it feasible to edit the
knowledge-base by removing, correcting or adding rules to the knowledge-base.
Testing and Debugging: In order to confirm that the system is working according
to specification there is need to test and remove bugs which could hinder its efficient
performance. An added advantage to the use of SWI-Prolog is that the programming
environment offers the possibility for interactive edit and reload of a program.
5.3 Compilation
Fast compilation is very important during the interactive development of large
applications.
49
SWI-Prolog supports the commonly found set of compiler warnings: syntax errors,
singleton variables, predicate redefinition, system predicate redefinition and predicates.
Messages are processed by the hookable print message/2 predicate and where possible
associated with a file and line number. The graphics system contains a tool that exploits
the message hooks to create a window with error messages and warnings that can be
selected to open the associated source location.
5.4 Specifications
The Knowledge-Based System was developed on a system with the specifications
in the table below. However, it does not imply that the system will not work if it
is developed on a system with lower specification. The system described below is
a guarantees proper functioning of the Knowledge-Based System.
Processor Intel Core 2Duo Processor 1.60GHz
Operating System Genuine Windows 7 Ultimate 32-bits
Operating System
System memory 2.00 GB
Display 15.4-inch diagonal WXGA
Pointing Device Touchpad with scroll zone
5.5 Pseudocodes for the System
Start session
50
Select Crop
Select Pest OR Disease OR Storage
If Pest is selected
Then display treatment
If Disease is selected
Then display treatment
If Storage is selected
Then display method
End of session
Diagnosis
If Symptoms
Load Pest OR Disease
Then display treatment
End of session.
5.6 Program testing and debugging
The essence of testing and debugging the system is to ensure that it delivers fully
the service it is designed for. The knowledge-based system was tested at two
stages.
The first was carried out by the researcher on the knowledge-based system. The
system carries out task through the processes of pattern matching and
unification.
Secondly, ten people were purposively selected to use the system after which they
filled the assessment form. The result of the assessment is discussed in the
succeeding chapter.
The ten people selected for the assessment of the knowledge-based system
comprised of people within and outside the academia in order to achieve a
51
balance in the assessment. The respondents included a mix of present and past
students from the researcher’s department (African Regional Center for
Information Science); this is because they have insights into knowledge
management, knowledge-based system, information systems and other related
concepts. There was also a mix of students, research assistant and lecturer from
the Faculty of Agriculture and Forestry because of their expertise agricultural
practices. Finally, there were two respondents who are not in the academe.
CHAPTER SIX
SYSTEM IMPLEMENTATION AND EVALUATION
6.0 Introduction
52
This chapter is aimed at describing the ease of use of the knowledge-based system. A
usability test was carried out with a 5-point Likert scale (Poor, Fair, Satisfactory, Very
Satisfactory, and Excellent) questionnaire.
6.1 System Implementation
6.1.1 System Installation
System installation is the process of setting up the system so that it can be ready for use.
The expert system installation requires the transfer of files between prospective users.
When files have been transferred to the computer to be used, the expert system is ready
for use. The user is only required to open the file by either clicking twice on the expert
system icon or right-click once, then select “Open” from the box which pops up.
6.1.2 System Testing
System testing involves putting the system in order to discover errors and bugs in the
system, and most importantly to determine if it meets its requirement and functional
specifications. The system was tested in units and overall.
6.1.3 System Conversion Plan
System conversion is the process of changing form an old system to an improved new
system. A conversion plan helps ensure that no stakeholder is left out of the transition
process. System conversion is carried out using either the Direct conversion method or
the Parallel conversion method. In Direct conversion the new system instantly replaces
the old while the Parallel conversion method permits the old and the new system to be
used simultaneously until the new system is proven to work effectively.
53
The methods of conversion mentioned above may not perfectly fit for this present study.
This is because the oral means of transferring knowledge cannot be totally done away
with; the new system, therefore, is designed to complement the old in its efforts to share
the knowledge and motivate the use of agricultural indigenous knowledge.
6.1.4 User training
The report from the test shows that the intuitive GUI aids easily understanding of the
program usage. There is little or no need for training to use the system. The requirement
is that the application be transferred to a personal computer. After the transfer, open the
application for use by double-clicking on the application icon.
6.2 System Evaluation
As stated earlier questionnaires were used gather the opinions of persons who participated
in the testing of the expert system. The questionnaire has two sections- the background
information and usability information. The background information section retrieves
information about the user’s gender, age, education background, and years of computer
literacy while the usability information retrieves information on the ease of use of the
application. The instrument also tested the extent to which the system enhances
knowledge sharing, protection of agricultural indigenous knowledge, and increase the use
of AIK.
The test was conducted outside and within the academic environment to show that the use
of the application is not limited. Ten questionnaires were administered to both male and
female respondents. Below is the report on the responses.
54
Ease of use of the application: The participant’s responses were between ‘satisfactory’
and ‘excellent’. They easily understood the texts and the paths to the information on the
application.
Usefulness of the application: The usefulness of the system was measured in terms of
enhancement of the use of AIK, sharing and protection of AIK. The responses from the
ten participants varied based on the scale given (1=poor, 2=fair, 3=satisfactory, 4=very
satisfactory, 5=excellent).
Table 6.1: The Result of the Usability Test
Participant
s
Knowledge sharing Increase use of AIK Protection of AIK
1 Fair Fair Satisfactory
2 Excellent Very satisfactory Excellent
3 Excellent Excellent Very satisfactory
4 Excellent Very satisfactory Very satisfactory
5 Very satisfactory Very satisfactory Excellent
6 Very satisfactory Excellent Very satisfactory
7 Satisfactory Very satisfactory Very satisfactory
8 Very satisfactory Not emphatic enough Very satisfactory
9 Excellent Excellent Excellent
10 Very satisfactory Excellent Excellent
55
The tables below show the result of the usability test with respect to the basic
features of the knowledge-based system.
Table 6.2: Access
Frequency Percent Valid PercentCumulative
Percent
Valid Satisfactory 2 20.0 22.2 22.2
Very satisfactory
4 40.0 44.4 66.7
Excellent 3 30.0 33.3 100.0
Total 9 90.0 100.0
Missing System 1 10.0
Total 10 100.0
Twenty percent rated the accessibility features ‘Satisfactory’, forty percent rated ‘Very
satisfactory’ and thirty percent rated it ‘Excellent’.
Table 6.3: Identity
Frequency Percent Valid PercentCumulative
Percent
Valid Fair 1 10.0 12.5 12.5
Satisfactory 1 10.0 12.5 25.0
Very satisfactory
4 40.0 50.0 75.0
Excellent 2 20.0 25.0 100.0
Total 8 80.0 100.0
Missing System 2 20.0
Total 10 100.0
Ten percent of the respondents rated the ease of identifying functions of the system ‘Fair’,
ten percent rated ‘Satisfactory’, forty percent rated ‘Very satisfactory’ and two percent
rated it ‘Excellent’.
56
Table 6.4: Navigation
Frequency Percent Valid PercentCumulative
Percent
Valid Fair 1 10.0 11.1 11.1
Satisfactory 1 10.0 11.1 22.2
Very satisfactory
2 20.0 22.2 44.4
Excellent 5 50.0 55.6 100.0
Total 9 90.0 100.0
Missing System 1 10.0
Total 10 100.0
Ten percent of the respondents rated the ease of navigating around the system ‘Fair’, ten
percent rated ‘Satisfactory’, twenty percent rated ‘Very satisfactory’ and fifty percent
rated it ‘Excellent’.
Table 6.5: Content
Frequency Percent Valid PercentCumulative
Percent
Valid Fair 1 10.0 11.1 11.1
Satisfactory 1 10.0 11.1 22.2
Very satisfactory
6 60.0 66.7 88.9
Excellent 1 10.0 11.1 100.0
Total 9 90.0 100.0
Missing System 1 10.0
Total 10 100.0
Ten percent of the respondents rated the clarity of contents in the system ‘Fair’, ten
percent rated ‘Satisfactory’, sixty percent rated ‘Very satisfactory’ and ten percent rated it
‘Excellent’.
57
Table 6.6: Usage
Frequency Percent Valid PercentCumulative
Percent
Valid Fair 1 10.0 12.5 12.5
Satisfactory 2 20.0 25.0 37.5
Very satisfactory
3 30.0 37.5 75.0
Excellent 2 20.0 25.0 100.0
Total 8 80.0 100.0
Missing System 2 20.0
Total 10 100.0
Ten percent of the respondents rated the ease of use of the system ‘Fair’, twenty percent
rated ‘Satisfactory’, thirty percent rated ‘Very satisfactory’ and twenty percent rated it
‘Excellent’.
Participants were also allowed to give their opinion about the system and to make
suggestions for improvement on the experts systems. The report is given below.
58
Table 6.7: Participants Opinion about the System
Participan
t
Suggestions
1 Adequate information should be considered in setting up the system
There should be a collaborative work or a recommendation to
extension officers/agriculturist to enable ease of setting up the
system
2 It will be nice if local names can be translated for easy
understanding of all tribes or origins
3 Make interface more attractive with colors
Proofread for errors in sentences
4 Efforts should be made to reduce the number of areas where there
are no information in the analysis report
5 Adopt use of graphics to drive home the message intended
6 Nil
7 The designer should upgrade the interface for readability
Perfect the background environment to enhance quick access to data
8 Be more in-depth with information
Allow an interface for question or FAQ and feedback
9 Nil
10 More indigenous knowledge for more crops to be investigated at the
famers base
Agricultural researchers and extension officers to be contracted
Funds should be provided for the indigenous knowledge program
CHAPTER SEVEN
59
SUMMARY, CONCLUSON AND RECOMMENDATION
7.0 Summary
The focus of this study has been to make a computer an expert by providing indigenous
knowledge on symptoms of pest and disease attack in crops, indigenous solutions for
pests and diseases in crops and indigenous storage methods. The study also sheds more
light on the integration of information systems into the agricultural system in order to
preserve indigenous knowledge, and enhance knowledge sharing.
The software used in building the system were SWI-Prolog version 6.1.2 and NetBeans.
The knowledge base was developed majorly from secondary resources such as books,
journals, and publications. Knowledge was also elicited from farmers. A review of the
existing system made clear the need for a knowledge-based system for indigenous pest
and disease control, and storage methods.
7.1 Conclusion
There is a popular saying that “when an old man dies in Africa, a whole library perishes
with him”. The common means of transferring indigenous knowledge has been the oral
method and as soon as the person who has the knowledge dies the method of transference
is terminated. This emphasizes the urgent need for the documentation of indigenous
knowledge.
Thus, there is need to develop strong systems to enhance the use of indigenous
knowledge. It would accelerate the diffusion of indigenous knowledge and prevents its
extinction.
7.2 Recommendations
60
The recommendations from this research are based on the researchers experience in the
course of the study and comments given during the evaluation process.
1. Thorough documentation and management of agricultural indigenous knowledge
in Nigeria
A very significant part of this study that requires further research is documentation
of agricultural indigenous knowledge. In the process of data acquisition it was found out
that indigenous knowledge is not documented. There are quite a number of
literatures on indigenous knowledge but much effort has not being given to documenting
the knowledge. The researcher encountered huge difficulties in the process of data
acquisition.
2. Collaboration between research institutes and libraries of departments of
agriculture in the universities should be boosted.
3. Literature reveals that inadequate funding is a major obstacle faced in
documenting and sharing of indigenous knowledge. It is suggested that government and
private institutions should collaborate to fund such projects.
4. National agricultural indigenous knowledge resource centers should be
established. This would serve as a home for agricultural indigenous knowledge where
researchers can easily find knowledge required for research and development.
5. Based on comments about expanding the functionality of the system, it is suggested
that a web-based indigenous knowledge system should be developed.
REFERENCES
Abebe, S., Bereket, D., Kahsay, B., Azage, T,. and Dirk, H. (2008). Recognizing Farmers’ Knowledge in Development Initiatives: Indigenous Bee-keeping in Alaba Special Woreda, Southern Ethiopia.
Adedipe, N. O., Okuneye, P. A., Ayinde, I. A. (2004). The Relevance of Local and Indigenous for Nigerian Agricuture. International Conference on Bridging Scales
61
& Epistemologies: Linking Local Knowledge With Global Science in Multi-Scale Assessments, Alexandria, Egypt.
Adesiji, G.B, Ogunlade,I., Adisa, R. S., Adefalu, L. L., and Raji, M. K. (2009). Indigenous Methods of Controlling Pests among Rice Farmers in Patigi Local Government Area of Kwara State, Nigeria.
Akegbejo-Samsons Yemi (2009). Promoting Local and Indigenous Knowledge in Enhancing Adaptive Capacities under Extreme Events in Nigeria. University of Agriculture, Department of Aquaculture and Fisheries Management, Abeokuta, Nigeria.
Arum Agrawal (2004). Indigenous and Scientific Knowledge: Some Critical Comments. University of Florida, Department of Political Science.
Ashok Jashapara (2011). Knowledge Management: An Integrated Approach. pg 18
Bamigboye, E. O. and Kuponiyi, F. A. (2010). The Characteristics of Indigenous Knowledge Systems Influencing Their Use In Rice Production By Farmers In Ekiti State, Nigeria. Ozean Journal of Social Sciences 3(1), 2010, ISSN 1943-2577, 2010 Ozean Publication.
Böck, Heiko (2009). The Definitive Guide to NetBeans Platform (First ed.). Apress. pp. 450. ISBN 1-4302-2417-7.
Boudreau, Tim; Glick, Jesse; Greene, Simeon; Woehr, Jack; Spurlin, Vaughn (2002). NetBeans: The Definitive Guide (First ed.). O'Reilly Media. pp. 672. ISBN 0-596-00280-7.
Cooperative Extension Work in Agriculture and Home Economics, The University of Tennessee Cotton Disease (2000).
Dahiya, P. S., Khatan, V. S., Ilangantileke, and Dabas, J. P. S. (1997). Potato Storage Patterns and Practices in Meerut District, Western Uttar Pradesh, India.
David B. Fogel and Paul Schwartz (2006). Evolutionary Computation. The Institute of Electrical and Electronics Engineers, Inc.
David Poole (1999). Logic, Knowledge Representation and Bayesian Decision Theory. Pg 2.
Elaine Rich (2003). Artificial Intelligence: Our Attempt to Build Models of Ourselves Fundamentals of Expert Systems. Available at: www.media.wiley.com. Assessed on 15th March 2012.
Global Change System for Analysis Research, and Training (START) http://start.org/programs/africangec/2011-grants/indigenous-knowledge-adaptation-nigeria.
Hagedorn, D. J., Inglis, D. A. (1998). Handbook of Beans Diseases.
62
Hajek M. (2005). Neural Networks.
Heffelfinger, David (2008). Java EE 5 Development with NetBeans 6 (First ed.). Packt Publishing. pp. 400. ISBN 1-84719-546-6.http://www.csse.uwa.edu.au/programming/swi-prlog/sec-3.13.html#assert/1. Assessed 29 th November 2012 .
Identification, symptoms and nature of damage: potato tuber moth and cut worm. http://agropedialabs.iitk.ac.in/agrilore/?q=node/2408 assessed on 15th November 2012.
International Potato Center, Apartado (1996). Major Potato Diseases, Insects, and Nematodes.
Ipoola Olabiyi Timothy (2004). Diseases of Food Crops and their Control Principles.
James Wexler (2007). Artificial Intelligence in Games: A look at the smarts behind Lionhead Studio’s “Black and White” and where it can and will go in the future.
Keegan, Patrick; Champenois, Ludovic; Crawley, Gregory; Hunt, Charlie; Webster, Christopher (2006). NetBeans IDE Field Guide: Developing Desktop, Web, Enterprise, and Mobile Applications (Second ed.). Prentice Hall. pp. 424. ISBN 978-0-13-239552-6.
Myatt, Adam (February 21, 2008). Pro Netbeans IDE 6 Rich Client Platform Edition (First ed.). Apress. pp. 491. ISBN 1-59059-895-4.
Nancy J. Cooke (1999). Handbook of Applied Cognition: Knowledge Elicitation. Pg. 2.
Nwajiuba Chiedum (2012). Nigeria’s Agricultural and Food Security Challenges.
Paul, S (1996). Myers Knowledge Management and Organizational design. pg1
Peter Lucas (2012). Artificial Intelligence- Expert Systems.
Prasad G.N.R. and Babu A. V. (2006). A Study on Various Expert Systems in AgricultureRob Schapire (2003). Foundations of Machine Learning. Retreieved on 28th November
2012 from http://www.cs.princeton.edu.
Roman V. Belavkin. Lecture 6: Introduction to Expert Systems. Available at: www.eis.mdx.ac.uk. Assessed: 17th March 2012
Russell, S., Norvig, P (2003). Artificial Intelligence- A Modern Approach 2Ed,Ph,2003.
Senanayake S.G.J.N. (2006). Indigenous Knowledge as a Key to Sustainable Development.
Shadbolt, N.; Burton, A. M. (1989). The empirical Study of Knowledge Elicitation Techniques.
63
Shale Legg and Marcus Hutter (2006). A Collection of Definitions of Intelligence.
Sharon B. Le Gall (2009). An Introduction to Core Concepts and Objectives: What are Traditional Knowledge, Genetic Resources and Traditional Cultural Expressions and Why Should They Receive Legal Protection? Pg 18
Studley John (1998). Dominant Knowledge Systems and Local Knowledge.
Upreti Y. G. and Upreti B. R. (2000). Indigenous Knowledge, Agricultural Practices and Food Security in Developing Countries: Opportunities and Challenges.
Wang Pei (2007). Artificial General Intelligence: a Gentle Introduction.
William D. L. and Muchena N. O. (2000). Utilizing Indigenous Knowledge Systems in Agricultural Education to Promote Sustainable Agriculture.
Workineh M. Y, Garfield M. J, and Boudreau M (2010). Indigenous Knowledge Creation Practices: The Case of Ethiopia.
APPENDIX I
African Regional
Center for
Information
Science
64
University of Ibadan
Dear Respondent,Application Usability Survey
This questionnaire is an application usability test for a knowledge-based system for Indigenous
Knowledge for Crop Protection. The overall aim of the research is identify the ease of use of the
application in querying for the recommendation on storage and its usefulness in providing
indigenous knowledge for crop protection.
The survey is completed anonymously by possible users of the system; no personal data is asked
for or retained (no respondent name or address required). Please note that all data collected in this
survey will be held anonymously and securely. During data analysis and report presentation, all
responses will be kept confidential.
Thank you for your time. Boriowo, Oluwadamilola HannahSection 1: Background Information
A) Gender:
Male Female
B) Which age range do you belong?
20 years & below 41 – 50 years
21 – 30 years 51 years & above
31 – 40 years
C) Education BackgroundUn-educated SSCE
Primary level ND/HND/TCE
JSCE BSc or higher
D) Computer Literacy:
1 Month less Above 1 year
2 – 6 Month
6 months– 1 year
65
Section B: Usability Information
Using a scale shown below, kindly fill in your assessment of the application against each usability factor
Rating
1 Poor2 Fair3 Satisfactory4 Very Satisfactory5 Excellent
S/no. Usability Factor RatingAccessibility 1 2 3 4 5
1 Application load‐time is reasonable
2 Adequate text‐to‐background contrast
3 Meaning of text is clear4 Font size/spacing is easy to read
Identity
5 Interface makes purpose of the application clear6 Application interface is digestible in 5 secs7 Clear path to application information8 Clear path to application contact information
Navigation9 Main navigation is easily identifiable
10 Navigation labels are clear & concise11 Number of buttons is reasonable12 Buttons are consistent & easy to identify
Content13 Major headings are clear & descriptive
66
14 Emphasis (bold, etc.) is used sparingly15 Styles & colors are consistent16 Content layout is meaningful & user‐friendly
Usage17 Crop Selection is Intuitive18 Displayed analysis report is informative and useful19 Application crashes/hangs during use20 Sequence of flow is consistent with regular practice
The knowledge system was developed to aid knowledge sharing, enhance the use of agricultural
indigenous knowledge, and protect agricultural indigenous knowledge. Please use the scale above
to rate the effectiveness of this system in the areas listed below
a. Knowledge sharing
b. Enhance use of agricultural indigenous knowledge
c. Protect agricultural indigenous knowledge
What is your suggestion?
a. ___________________________________________
b. ___________________________________________
67
APPENDIX II
A knowledge-based system for indigenous pests and disease control, and storage Submitted in
partial fulfillment of the requirements for M.Inf. Sc Degree of the Africa Regional Centre for
Information Science, University of Ibadan, Ibadan.
optionsview(disease,Crop):-
diseaseview(Crop),
write('Enter corresponding number to disease : '),
read(DiseaseNumber),
nth1(DiseaseNumber,Diseases,Disease),
disease(Crop,Diseases),
member(Disease,Diseases),
symptom(Crop,Disease,Symptom),
write('The symptoms of '),write(Disease),write(' are '),nl,
writelist(Symptom),
diseasecontrol(Crop,Disease,Control),
write(Disease),write(' can be controlled in the following ways : '),nl,
writelist(Control),nl,nl,
main.
optionsview(pest,Crop):-
pestview(Crop),
write('Enter corresponding number to pest : '),
68
read(PestNumber),
nth1(PestNumber,Pests,Pest),
pest(Crop,Pests),
member(Pest,Pests),
symptom(Crop,Pest,Symptom),
write('The symptoms of '),write(Pest),write(' are '),nl,
writelist(Symptom),
pestcontrol(Crop,Pest,Control),
write(Pest),write(' can be controlled in the following ways : '),nl,
writelist(Control),nl,
main.
optionsview(storage,Crop):-
storage(Crop,Storage),
writelist(Storage),nl,
main.
indexedmenu([],_).
indexedmenu([H|T],Index1):-
write('Type '),write(Index1),write(' for '),write(H),nl,
succ(Index1,Index2),
indexedmenu(T,Index2).
diseaseview(Crop):-
disease(Crop,Diseases),
indexedmenu(Diseases,1).
pestview(Crop):-
pest(Crop,Pests),
69
indexedmenu(Pests,1).
cropview:-
crops(Crops),
indexedmenu(Crops,1).
optionsview(Info_options):-
info_options(Info_options),
indexedmenu(Info_options,1).
dcontrolview(Crop,Disease,Control):-
diseasecontrol(Crop,Disease,Control),
indexedmenu(Control,1).
writelist([]):-
nl.
writelist([H|T]):-
write(H),nl,
writelist(T).
main:-
write('Main Menu'),nl,
cropview,
write('Enter corresponding number to desired crop: '),
read(CropNumber),nl,
crops(Crops),
nth1(CropNumber,Crops,Crop),
info_options(Options),
70
indexedmenu(Options,1),
write('Enter corresponding number to desired option: '),
read(OptionNumber),
nth1(OptionNumber,Options,Option),
optionsview(Option,Crop).
71