توضیحات
ABSTRACT
The Prolog programs presented so far are declarative since they admit a dual reading as a formula. The treatment of arithmetic in Prolog compromises to some extent itsdeclarative underpinnings. However, it is difficult to come up with a better solution than the one offered by the original designers of the language. The shortcomings of Prolog’s treatment of arithmetic are overcome in the constraint logic programming languages.
INTRODUCTION
Prolog provides integers and floating point numbers as built-in data structures, with the typical operations on them. These operations include the usual arithmetic operators such as +, -, ∗ (multiplication), and // (integer division) .Now, according to the usual notational convention of logic programming and Prolog, the relation and function symbols are written in the prefix form, that is in front of the arguments. In contrast, in accordance with their usage in arithmetic, the binary arithmetic operators are written in infix form, that is between the arguments. Moreover, negation of a natural number can be written in the bracketless prefix form ,that is, without brackets surrounding its argument .This discrepancy in the syntax is resolved by considering the arithmetic operators as built-in function symbols written in the infix or bracketless prefix form with information about their associativity and binding power that allows us to disambiguate the arithmetic expressions . Actually, Prolog provides a means to declare an arbitrary function symbol as an infix binary symbol or as a bracketless prefix unary symbol, with a fixed priority that determines its binding power and a certain mnemonics that implies some (or no) form of associativity. An example of such a declaration was the line :- op(1100, yfx ,arrow). used in the above-type assignment program. Function symbols declared in this way are called operators. Arithmetic operators can be thus viewed as operators predeclared in the language “prelude .” In addition to the arithmetic operators we also have at our disposal infinitely many integer constants and infinitely many floating point numbers. In what follows, by a number, we mean either an integer constant or a floating point number. The arithmetic operators and the set of all numbers uniquely determine a set of terms. We call terms defined in this language arithmetic expressions and introduce the abbreviation gae for ground (i.e., variable free) arithmetic expressions.
چکیده
برنامه های Prolog که تا کنون ارائه شده اند، اعلامیه ای هستند، زیرا خواندن دوگانه را به عنوان یک فرمول پذیرفته اند. درمان محاسبات در Prolog، تا حدودی پایه های آن را تضعیف می کند. با این وجود، راه حلی بهتر از آنچه طراحان اصلی زبان ارائه می دهند دشوار است. کاستی های پرولوگ در مورد ریاضیات در زبان برنامه نویسی منطق محدودیت غلبه می کند.
مقدمه
Prolog عدد صحیح و اعداد شناور را به عنوان ساختارهای داده ای ارائه می دهد و عملیات معمولی بر روی آنها انجام می شود. این عملیات عبارتند از اپراتورهای ریاضی معمولی مانند +، -، * (ضرب) و // (تقسیم عدد صحیح). در حال حاضر، با توجه به کنوانسیون علامت گذاری معمولی برنامه نویسی منطقی و پرولگ، نمادهای رابطه و عملکرد در پیشوند نوشته می شوند فرم، در مقابل استدلال است. در مقابل، با توجه به استفاده از آنها در حساب، اپراتورهای ریاضی دودویی در شکل infix نوشته میشوند، که بین استدلال است. علاوه بر این، نفی یک عدد طبیعی را می توان در فرم پیشوند bracketless، یعنی بدون براکت در اطراف آن بحث کرد، نوشته می شود. این اختلاف در نحو با در نظر گرفتن اپراتورهای ریاضی به عنوان نمادهای تابع ساخته شده در prefix infix یا bracketless فرم را با اطلاعات مربوط به وابستگی و قدرت اتصال خود که به ما اجازه می دهد ابهام برآمده از عبارات ریاضی را بیابیم. در واقع، Prolog یک وسیله برای اعلام یک نماد تابع دلخواه به عنوان یک نماد باینری infix یا به عنوان یک پیشوند بدون علامت غیرمعمول با یک اولویت ثابت است که قدرت اتصال آن را تعیین می کند و یک مونونیک مشخصی که برخی از (و یا هیچ) نوع وابستگی را تعیین می کند. یک مثال از چنین اعلامیه خط: – op (1100، yfx، arrow). در برنامه تخصیص فوق نوع استفاده می شود. نمادهای عملکردی که به این شکل اعلام شده اند، اپراتورها هستند. اپراتورهای ریاضی را می توان به عنوان اپراتورهای پیشینی که در زبان پیشینی زبان خوانده می شوند، مشاهده می کنند. علاوه بر اپراتورهای محاسباتی، ما همچنین دارای تعداد بی شماری ثابت های عدد صحیح و تعداد بی شماری از اعداد شناور است. در ادامه، به وسیله یک عدد، به معنای ثابت یا عدد شناور است. اپراتورهای محاسباتی و مجموعه ای از تمام اعداد منحصر به فرد مجموعه ای از اصطلاحات را تعیین می کند. ما شرایطی را که در این اصطلاحات ریاضی زبان تعریف شده است نام می بریم و عبارت GAE اختصار را برای اصطلاحات حسابی به جای زمین (یعنی متغیر آزاد) معرفی می کنیم.
Year: 2001
Publisher : IEEE
By : Krzysztof R. Apt
File Information: English Language/ 12 Page / size: 636 KB
Only site members can download free of charge after registering and adding to the cart
سال : 1380
ناشر : IEEE
کاری از : Krzysztof R. Apt
اطلاعات فایل : زبان انگلیسی / 12 صفحه / حجم : KB 636
نقد و بررسیها
هنوز بررسیای ثبت نشده است.