ANSI INCITS ISO IEC 13211-1-1995 Information technology - Programming languages - Prolog - Part 1 General core.pdf
《ANSI INCITS ISO IEC 13211-1-1995 Information technology - Programming languages - Prolog - Part 1 General core.pdf》由会员分享,可在线阅读,更多相关《ANSI INCITS ISO IEC 13211-1-1995 Information technology - Programming languages - Prolog - Part 1 General core.pdf(207页珍藏版)》请在麦多课文档分享上搜索。
1、INTERNATIONAL STANDARD ISO/IEC 1321 l-l First edition 1995-06-01 Information technology - Programming languages - Prolog - Part 1: General core Technologies de /information - Langages de programmation - Prolog - Partie 7: Noyau g)/2 - disjunction 47 7.8.7 (-)/2 - if-then 49 7.8.8 (;)/2 - if-then-els
2、e 50 7.8.9 catch/3 51 7.8.10 throw/l . 53 7.9 Evaluating an expression. 54 7.9.1 Description . 54 7.9.2 Errors 54 7.10 Input/output. . 54 7.10.1 Sources and sinks 54 7.10.2 Streams . 55 7.10.3 Read-options list . 58 7.10.4 Write-options list 58 7.10.5 Writing a term 59 7.11 Flags 60 7.11.1 Flags def
3、ining integer type I 60 7.11.2 Other flags. 61 7.12 Errors. . 61 7.12.1 The effect of an error . 62 7.12.2 Error classification . 62 8 Built-in predicates 63 8.1 The format of built-in predicate definitions 63 8.1.1 Description . 63 8.1.2 Template and modes 64 8.1.3 Errors 64 iv ISO/IEC 1995 ISO/IEC
4、 13211-l : 1995(E) 81.4 Examples 8.1.5 Bootstrapped built-in predicates 8.2 Term unification. 8.2.1 (=)/2 - Prolog unify 8.2.2 unify-with-occurschecW2 - unify . 8.2.3 (=)/2 - not Prolog unifiable 8.3 Type testing . 8.3.1 var/l . 8.3.2 atom/l 8.3.3 integer/l . 8.3.4 float/l 8.3.5 atomic/l 8.3.6 compo
5、und/l 8.3.7 nonvarll . 8.3.8 number/l 8.4 Term comparison 8.4.1 (I=)/2 - term greater than, (=)/2 - term greater than or equal . 8.5 Term creation and decomposition. 8.5.1 functor/3 8.5.2 argJ3 . 8.5.3 (=)/ 2 - univ . 8.5.4 copy-term/2 8.6 Arithmetic evaluation . 8.6.1 (is)/2 - evaluate expression .
6、 8.7 Arithmetic comparison 8.7.1 (=:=)/2 - arithmetic equal, (=)/2 - arithmetic not equal, (c)/2 - arithmetic less than, (=)/2 - arithmetic greater than, (=)/2 - arithmetic greater than or equal 8.8 Clause retrieval and information . 8.8.1 clause/2 . 8.8.2 current-predicate/l 8.9 Clause creation and
7、 destruction 8.9.1 assertafl . 8.9.2 assertz/l . 8.9.3 retract/l . 8.9.4 abolish/l 8.10 All solutions . 8.10.1 findall/ . 8.10.2 bagoff . 8.10.3 setofl3 8.11 Stream selection and control 8.11.1 currentinput/l 8.11.2 current-output/l 8.11.3 set-input/l . 8.11.4 set-output/l 8.11.5 openl4, open/3 8.11
8、.6 close/2, close/l 8.11.7 flush-output/l, flush-output/O 8.11.8 stream_property/2, at-end-of-stream/O, at-end-of-stream/l . 8.11.9 set-stream-position/2 8.12 Character input/output 8.12.1 getcharl2, get-char/l, get-code/l, get-code/2 . 8.12.2 peek-charI2, peek-char/l, peek-code/l, peek-code12 65 65
9、 65 65 66 67 67 67 68 68 68 68 69 69 69 70 70 71 71 72 72 73 74 74 74 76 77 77 78 78 78 79 80 81 82 82 83 84 86 86 86 87 87 87 88 89 89 90 91 91 92 V ISO/IEC 13211-l : 1995(E) ISO/IEC 1995 8.12.3 put-charl2, put-char/l, put-code/l, put-codel2, nl/O, nl/l . 94 8.13 Byte input/output 95 8.13.1 get_byt
10、e/2, get-byte/l 95 8.13.2 peek-bytel2, peek-byte/l . 96 8.13.3 put-bytel2, put-byte/l . 97 8.14 Term input/output. . 98 8.14.1 read-terml3, read-termi2, read/l, read/2 . 98 8.14.2 write-terml3, write-terml2, write/l, writel2, writeqll, writeql2, write-canonical/l, write-canonical/2 . 99 8.14.3 op/3
11、101 8.14.4 current-op/3 102 8.14.5 char-conversion/2 103 8.14.6 current-char-conversion/2 . 103 8.15 Logic and control . 104 8.15.1 (+)/l - not provable . 104 8.15.2 once/l 105 8.15.3 repeat/O . 105 8.16 Atomic term processing . 105 8.16.1 atom-length/2 . 106 8.16.2 atom_concat/3 . 106 8.16.3 sub-at
12、om/5 . 107 8.16.4 atom-chars/:! 108 8.16.5 atom-codes/2 . 109 8.16.6 char-cede/2. 109 8.16.7 number-chars/2 110 8.16.8 number_codes/2. . 111 8.17 Implementation defined hooks . 112 8.17.1 setprologflag/:! . 112 8.17.2 currentprologflag/2 112 8.17.3 halt/O. 113 8.17.4 halt/l . 113 9 Evaluable functor
13、s . 9.1 The simple arithmetic functors . 9.1.1 Evaluable functors and operations 9.1.2 Exceptional values. 9.1.3 Integer operations and axioms 9.1.4 Floating point operations and axioms . 9.1.5 Mixed mode operations and axioms 9.1.6 Type conversion operations 9.1.7 Examples . 9.2 The format of other
14、 evaluable functor definitions . 9.2.1 Description 9.2.2 Template and modes . 9.2.3 Errors . 9.2.4 Examples . 9.3 Other arithmetic functors . 9.3.1 (*)/2 - power . 9.3.2 sin/l 9.3.3 cosll 9.3.4 atanll . 9.3.5 expll 9.3.6 log/l 9.3.7 sqrt/l 9.4 Bitwise functors 9.4.1 ()/2 - bitwise right shift. 9.4.2
15、 ( R, x R -+ B greater + RXR+R addition - RXR-+R subtraction ; RXR-R multiplication R x R + R division 4.1.3 Other functions 4.1.3.1 Substitution composition Signature: 0 : Substitution x Substitution -+ Substitution Axiom: f o g = h where h(x) = f(g(x) 4.1.3.2 1x1 - abs x Signature: 1 ) : R + R Axi
16、om: 1x1 = if x 0 then x else -2 4.1.3.3 1x1 - floor x The notation 1x1 designates the largest integer not greater than x. Signature: 1 1 : R -+ 2 Axiom: lx = n where (x - 1 0 then dx is the positive square root of x else undefined 4.1.3.6 Maximum of real set Signature: max : R-set + R Axiom: max(S)
17、= x if x E S A x 2 y for all y E S 4.1.3.7 Minimum of real set Signature: min : R-set -+ R Axiom: min(S) = 2 if x E S A z 5 y for all y E S 4.2 Abstract data type: stack For all a, a, b, 6 E T, m E MT, the following axioms shall apply: apply-mappingT(a, identity-mappingT) = a wh-maPPiWT(a, mappingT(
18、a, 6, m) = b if a = a = apply-mappingT( a, m) if a # a update-mappingT(a, b, identity-mappingT) = identity-mappingT if a = b = mappingT(a, b, identity_mappingT) if a # b update-mappingT(a, b, mappingT(a, b, m) = mappingT(a, b, update-mappingT(a, b, m) if a # a = mappingT(a, b, m) if a = a and a # b
19、=m if a = a and a = b NOTE - Convc (3.46) is a mapping. The following functions are specified for a stack So where D is a data type: 5 Compliance pushD : D X SD 4 SD topD : SD + D u el.TOr POpD : SD -f SD u error newstackD : -i SD isemptyD : SD -+ Boolean For all d E D, s E SD, the following axioms
20、shall apply: twD (Pusho (6 s) = d topD(newstUCkD) = error POPD (pusho (4 s) = s popD (newstackD) = error isemptyr (newstacko) = true isemptyD (pusho (d, s) = false NOTE - Stacks are used in the definition of executing a goal (7.7) and control constructs (7.8). 4.3 Abstract data type: mapping The fol
21、lowing functions are specified for a mapping MT where T is a data type: identity-mappingT : + MT ?nappingT : T X T X MT + MT apply-mappingT : T X MT + T update-mappingT : T x T x MT + MT 5.1 Prolog processor A conforming Prolog processor shall: a) Correctly prepare for execution Prolog text which co
22、nforms to: 1) the requirements of this part of ISO/IEC 13211, and 2) the implementation defined and implementation specific features of the Prolog processor, b) Correctly execute Prolog goals which have been prepared for execution and which conform to: 1) the requirements of this part of ISO/IEC 132
23、11, and 2) the implementation defined and implementation specific features of the Prolog processor, c) Reject any Prolog text or read-term whose syntax fails to conform to: 1) the requirements of this part of ISO/IEC 13211, and 2) the implementation defined and implementation specific features of th
24、e Prolog processor, 11 ISO/IEC 13211-1 : 1995(E) ISO/IEC 1995 d) Specify all permitted variations from this part of ISO/IEC 13211 in the manner prescribed by this part of ISO/IEC 132 11, and e) Offer a strictly conforming mode which shall reject the use of an implementation specific feature in Prolo
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
10000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ANSIINCITSISOIEC1321111995INFORMATIONTECHNOLOGYPROGRAMMINGLANGUAGESPROLOGPART1GENERALCOREPDF

链接地址:http://www.mydoc123.com/p-436083.html