پرولوگ

(تم التحويل من Prolog)

پرولوگ (Prolog) هي لغة برمجة منطقية (logic programming) . الأسم مأخوذ من الفرنسية programmation en logique (برمجة المنطق)، تم أختراع اللغة بواسطة ألين كولميرايور حوالي العام 1972. كانت محاولة لجعل لغة البرمجة قادرة على أستخدام عبارات منطقية بدل أن تكون تعليمات محددة تلقن إلى الحاسوب. صممت اللغة أساساً لتستخدام في عمل برامج معالجة اللغات الطبيعية.

پرولوگ
Paradigmبرمجة منطقية
Designed byآلان كولمراور، روبرت كوالسكي
First appeared1972
الإصدار المستقر
Part 1: General core-Edition 1 (يونيو 1995; 28 years ago (1995-06)
Part 2: Modules-Edition 1 (يونيو 2000; 23 years ago (2000-06)
Filename extensions.pl, .pro, .P
WebsitePart 1: www.iso.org/standard/21413.html
Part 2: www.iso.org/standard/20775.html
Major implementations
B-Prolog, Ciao, ECLiPSe, GNU Prolog, Jekejeke Prolog, Poplog Prolog, P#, Quintus Prolog, SICStus, Strawberry, SWI-Prolog, Tau Prolog, tuProlog, WIN-PROLOG, XSB, YAP.
اللهجات
ISO Prolog, Edinburgh Prolog
Influenced by
Planner
Influenced
CHR, Clojure, Datalog, Erlang, KL0, KL1, Mercury, Oz, Strand, Visual Prolog, XSB

تستخدم لغة الپرولوگ في العديد من برامج الذكاء الإصطناعي (artificial intelligence) و برامج معالجة اللغات الطبيعبة. عبارات وقواعد اللغة تعبتر بسيطة جداً وواضحة (يتم كتابة البرنامج بالكامل بأستخدام الحقائق و القواعد). العديد من الباحثين الذين يقودون تطبيقات حديثة للبرلوغ التي جاءت نتيجة أستخدام نسخات مختلفة من البرلوغ كنواة في مشاريع أنظمة حاسوب الجيل الخامس (fifth generation computer systems أختصاراً FGCS).

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

الحقائق Facts

تختلف طريقة البرمجة في برلوغ عن اللغات التقليدية. في برلوغ يتم كتابة الحقائق (Facts) والقواعد (Rules) في قاعدة بيانات، ثم يتم كتابة أستفسارت queries من قاعدة البيانات. الحقية عبارة عن سند (predicate) (الوحدة الأساسية للبرلوغ). يتكون السند من رأس (head) وعدد من الوسائط (arguments). مثال


cat(tom).

في هذا المثال نقول بباسطة أن هناك توم 'tom' وهو قط 'cat'،بتعبير أدق 'cat' هو رأس (head) السند و 'tom' هو وسيطة (argument). هنا عدد من الأستفسارات التي يمكن سؤالها بناء على هذه الخقيقة:

هل توم قط (is tom a cat)؟


?- cat(tom).  
     yes.

ببساطة هنا نسأل إذا توم قط ويجيبنا برلوغ بنعم (yes).

ماهي الأشياء التي هي قط (what things are cats)؟


?- cat(X).  
     X = tom;
     yes


القواعد Rules

لغات برمجة
لغات كائنية
سي++
++C
سي شارپ
#C
دلفي (لغة برمجة)
Delphi
ادا 95
Ada
جاڤا
Java
سمولتوك
Smalltalk
روبي
Ruby
اوبجكت پاسكال
Object Pascal
لغات تقليدية
بيسيك
Basic
سي
C
باسكال
Pascal
كوبول
COBOL
فورتران
FORTRAN
أسمبلي
Assembly
لغات وظيفية
ليسپ
Lisp
پرولوگ
Prolog
پايثون
Python
پاريس
Paris
هندسة برامج

أن النوع الثاني من العبارت في برلوغ هي القواعد:


father(X,Y) :- parent(X,Y),male(X).


أنواع المعلومات Data types

لاتحتوي لغة البرلوغ على أنواع معلومات (Data types) تقليدية كلغات البرمجة التقليدية الأخرى. ولكن على عناصر تركيبية (lexical elements) .

الذرات Atoms

يعرف النص الثابت في برلوغ بمعنى الذرات Atoms. الذرة عبارة عن سلسة من الحروف،الأرقام و رمز شرطة-السفلية (_) (underscores) على أن يبدأ النص بحرف أنجليزي صغير (lower-case). عادة، عادة اذا كان هناك رمز ليس بحرف أو رقم فأنه يوضع بين (علامة التنصيص الأحادية) (مثال '+' يعتبر ذرة، في حين + يعتبر معامل)

الأرقام

معظم نسخ البرلوغ لاتميز بين الأعداد الصحيحة و الأعداد الحقيقية.

المتغيرات Variables

يعبر المتغيرات Variables عن نص يتكون من الحروف،الأرقام و رمز شرطة-السفلية (_) على أن يبدأ النص بحرف أنجليزي كبير (upper-case). عللى عكس اللغات القولية (imperative programming languages) في بيئة البرلوغ المتغير ليس مكان في الذاكرة (مستوعب) يمكن تخزين االقيم فيه. تصرف المتغيرات يتبع النمط لأيجاد القيمة.

التاريخ

The name Prolog was chosen by Philippe Roussel as an abbreviation for programmation en logique (French for programming in logic). It was created around 1972 by Alain Colmerauer with Philippe Roussel, based on Robert Kowalski's procedural interpretation of Horn clauses. It was motivated in part by the desire to reconcile the use of logic as a declarative knowledge representation language with the procedural representation of knowledge that was popular in North America in the late 1960s and early 1970s. According to Robert Kowalski, the first Prolog system was developed in 1972 by Colmerauer and Phillipe Roussel.[1] The first implementation of Prolog was an interpreter written in Fortran by Gerard Battani and Henri Meloni. David H. D. Warren took this interpreter to Edinburgh, and there implemented an alternative front-end, which came to define the “Edinburgh Prolog” syntax used by most modern implementations. Warren also implemented the first compiler for Prolog, creating the influential DEC-10 Prolog in collaboration with Fernando Pereira. Warren later generalised the ideas behind DEC-10 Prolog, to create the Warren Abstract Machine.

European AI researchers favored Prolog while Americans favored Lisp, reportedly causing many nationalistic debates on the merits of the languages.[2] Much of the modern development of Prolog came from the impetus of the Fifth Generation Computer Systems project (FGCS), which developed a variant of Prolog named Kernel Language for its first operating system.

Pure Prolog was originally restricted to the use of a resolution theorem prover with Horn clauses of the form:

H :- B1, ..., Bn.

The application of the theorem-prover treats such clauses as procedures:

to show/solve H, show/solve B1 and ... and Bn.

Pure Prolog was soon extended, however, to include negation as failure, in which negative conditions of the form not(Bi) are shown by trying and failing to solve the corresponding positive conditions Bi.

Subsequent extensions of Prolog by the original team introduced constraint logic programming abilities into the implementations.

الاستخدام في الصناعة

Prolog has been used in Watson. Watson uses IBM's DeepQA software and the Apache UIMA (Unstructured Information Management Architecture) framework. The system was written in various languages, including Java, C++, and Prolog, and runs on the SUSE Linux Enterprise Server 11 operating system using Apache Hadoop framework to provide distributed computing. Prolog is used for pattern matching over natural language parse trees. The developers have stated: "We required a language in which we could conveniently express pattern matching rules over the parse trees and other annotations (such as named entity recognition results), and a technology that could execute these rules very efficiently. We found that Prolog was the ideal choice for the language due to its simplicity and expressiveness."[3] Prolog is being used in the Low-Code Development Platform GeneXus, which is focused around AI.[4]

انظر أيضاً

لغات ذات صلة

  • The Gödel language is a strongly typed implementation of concurrent constraint logic programming. It is built on SICStus Prolog.
  • Visual Prolog, formerly known as PDC Prolog and Turbo Prolog, is a strongly typed object-oriented dialect of Prolog, which is very different from standard Prolog. As Turbo Prolog, it was marketed by Borland, but it is now developed and marketed by the Danish firm PDC (Prolog Development Center) that originally produced it.
  • Datalog is a subset of Prolog. It is limited to relationships that may be stratified and does not allow compound terms. In contrast to Prolog, Datalog is not Turing-complete.
  • Mercury is an offshoot of Prolog geared toward software engineering in the large with a static, polymorphic type system, as well as a mode and determinism system.
  • GraphTalk is a proprietary implementation of Warren's Abstract Machine, with additional object-oriented properties.
  • In some ways[which?] Prolog is a subset of Planner. The ideas in Planner were later further developed in the Scientific Community Metaphor.
  • AgentSpeak is a variant of Prolog for programming agent behavior in multi-agent systems.
  • Erlang began life with a Prolog-based implementation and maintains much of Prolog's unification-based syntax.
  • Pilog is a declarative language built on top of PicoLisp, that has the semantics of Prolog, but uses the syntax of Lisp.

الهامش

  1. ^ خطأ استشهاد: وسم <ref> غير صحيح؛ لا نص تم توفيره للمراجع المسماة Kowalski
  2. ^ Pountain, Dick (October 1984). "POP and SNAP". BYTE. p. 381. Retrieved 23 October 2013.
  3. ^ خطأ استشهاد: وسم <ref> غير صحيح؛ لا نص تم توفيره للمراجع المسماة lally
  4. ^ "Wikipedia GeneXus Page".

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

للاستزادة

هناك كتاب ، [[b:{{{1}}}|{{{1}}}]]، في معرفة الكتب.


الكلمات الدالة: