NotesFAQContact Us
Collection
Advanced
Search Tips
Back to results
Peer reviewed Peer reviewed
Direct linkDirect link
ERIC Number: EJ990988
Record Type: Journal
Publication Date: 2012
Pages: 24
Abstractor: As Provided
Reference Count: 8
ISBN: N/A
ISSN: ISSN-2165-3151
A Functional Programming Approach to AI Search Algorithms
Panovics, Janos
Journal of Information Technology Education: Innovations in Practice, v11 p353-376 2012
The theory and practice of search algorithms related to state-space represented problems form the major part of the introductory course of Artificial Intelligence at most of the universities and colleges offering a degree in the area of computer science. Students usually meet these algorithms only in some imperative or object-oriented language (e.g., Java or C#) during the seminars. In this paper, we introduce a new approach for presenting these algorithms to the students, which is programming them in a functional style using the F# programming language. A couple of years ago, we created a Java class hierarchy for use in our Artificial Intelligence seminars. This well-organized set of classes helps students better understand the operation of the various search algorithms. Since some parts of these algorithms can be more conveniently implemented using a functional approach, we present here the F# implementation of the same class hierarchy. F# proved to be a good choice of programming language because of its multi-paradigm nature. This way, the classes themselves were easy to adopt, and the instructors of the seminars may decide how much of the code they want to rewrite in a functional manner. Functional programming can provide tremendous benefit during the implementation of methods containing logical formulae in their bodies, such as the precondition of an operator. In summary, the power of F# lies not in the fact that it is a functional programming language, but that the developer can select the programming paradigm they want to use in different parts of the program. In the future, we would like to create a purely functional implementation of the main search algorithms with as much reusable code as possible. (Contains 3 figures.)
Informing Science Institute. 131 Brookhill Court, Santa Rosa, CA 95409. Tel: 707-531-4925; Fax: 480-247-5724; e-mail: contactus@informingscience.org; Web site: http://www.informingscience.us/icarus/journals/jiteiip
Publication Type: Journal Articles; Reports - Descriptive
Education Level: Higher Education; Postsecondary Education
Audience: N/A
Language: English
Sponsor: N/A
Authoring Institution: N/A
Identifiers - Location: Hungary