Sei sulla pagina 1di 2

Constraint Functional Programming using Heterogenous Architectures

[Proposal]
Ral Valencia T.
Australian National University PhD Candidate Canberra, Australia

rhvall@gmail.com 2.

ABSTRACT
The purpose of this document is to outline a research initiative that joins tree branches of computer science: Articial Intelligence, Pure Functional Programming and Computer Architecture. By using a mediator (Haskell) that ease implementation of CSP algorithms (AI) into an architecture of many cores, abstraction of how things should work is taken away from the programmer, making his job to worry about what to get and not how to get it. With this project, libraries and documentation will be generated along with comparison charts of current procedural models and the functional approach.

INTRODUCTION

There has been more than 50 years since Object Oriented Programming has been around; about 20 years that it has been stablished as an industry standard, with Java as the main representative surrounded by C++, C# or ObjectiveC as companions[1]. On the other hand, the development of functional programming has its roots on mathematical foundations, specially considering the Lambda Calculus, where its rst former implementation was the language Lisp, in the late 70s[2]. Haskell, as a relatively modern language born in 1987[3], is supported by an active academic open community and, lately, industry driven applications: Web Server, Financial Analysis, Digital Signal Processing, Network Security, to mention few. Even it has been compared with other languages (C++ or Lisp) in terms of performance, documentation and developing time; where in every aspect performed surprisingly better than their counterparts for prototyping and bringing quality software to production environment[4]. Since processor manufacturers started to split task into cores instead of increasing clock speed due to physical constraints [5], software developed under Object Oriented paradigm has encounter diculties to distribute jobs among multiple resources, leveraging the responsibility of testing and debugging to the programmer, wasting more time on the specics implementation rather than the improvement of the overall system. At this stage, Functional Programming oers dierent approaches to deal with Parallel and Concurrent execution; considering that the main idea stands: separating actions that has side eects from those that always returns the same value for the same input, with this philosophy in mind, designs become more stable, less buggy and fewer code lines; having a direct implication of easier maintenance and more objective testing phases. This last statement is told to be Semi-Implicit Parallelism, in other words, evaluation of pure functions in parallel [6]. On the Articial Intelligent side, there are plenty of algorithms for a variety of applications, from simple search to complex neural networks, with a common pattern between all of them, they can be exploited from a multi core architecture, improving their behavior and execution time even exponentially, according to the resources available and mem-

Categories and Subject Descriptors


A [Functional Programming]: High Level Abstraction ; B [Articial Intelligence]: Algorithms ; C [Heterogenous Architectures]: Parallel Execution

General Terms
Parallel Execution of CSP algorithms

Keywords
Haskell, Parallel Data, CSP, OpenGL, CUDA

1.

RESEARCH PROBLEM

At the time of this writing, there are no programming tools that helps people implement Constraint Satisfaction Problems (CSP) using Haskell and, at the same time, analyze data in a parallel architecture. The pursuit of this research is to explore common CSP algorithms, implement them using Haskell and then create libraries that use multi core architectures to improve their serialized counterpart. Once results can be archived, comparison to other programming paradigms will be outlined.

ory footprint. Then having the horse power from a GPU that brings 330 GFLOPS of computability compared to a general purpose processor that oers 48 oating point operations[7]. Lastly, with Articial Intelligent having mathematical roots, then their algorithmic representation is easily translated into functional code rather than procedural or object oriented, then again, the separation of side eects functions from pure one, impacts on how code could be executed and not how it must run, lifting the programmer to a higher position, where algorithm results are more important rather than the specics of the architecture where it is running on [8]. And then, this is where everything comes into play: AI provides the algorithmic knowledge, Haskell stands as the platform of implementation and Heterogenous architectures where simulations take place. In a ideally world, a CSP procedure is implemented using functions and declarations, then compiled and, automatically, it exploits each platform capabilities, whereas it uses only one thread, dual core or even multiple processors (GPUs + CPUs), everything transparent to the user and only requiring high level design from the programmer.

3.

REFERENCES

[1] L. F. Capretz. A Brief History of the Object-Oriented Approach, University of Western Ontario, Department of Electrical & Computer Engineering; Ontario Canada; March 2003. [2] P. Hundak. Conception, Evolution, and Application of Functional Programming Languages, Yale University, Department of Computer Science; New Haven, Connecticut; September, 1989. [3] P. Hundak, J. Hughes, S.P. Jones, P. Wadler. A History of Haskell: Being Lazy With Class, Yale University, Charles University, Microsoft Research, University of Edimburg; April, 2007. [4] P. Hundak, M.P. Jones. Haskell vs Ada vs C++ vs Awk vs ... An Experiment in Software Prototyping Productivity, Yale University, Department of Computer Science; New Haven, Connecticut; July, 1994. S A Necessity, [5] B. Schauer. Multicore Processors a A ProQuest, Discovery Guides; Detroit, Michigan; September, 2008. [6] T. Harris, S. Singh. Feedback Directed Implicit Parallelism; Microsoft Research, Cambridge, UK; October 2007[7] A. Seoane, A. Jaspe. IA Algorithm Acceleration Using GPUs; University of A Coru na, Espain; 2009. [8] J. P anovics. A Functional Programming Approach to AI Search Algorithms; University of Debrecen, Department of Information Technology; Debrecen, Hungary. November, 2012.

Potrebbero piacerti anche