1、Reference numberISO/IEC 13211-2:2000(E)ISO/IEC 2000Information technology Programminglanguages Prolog Part 2:ModulesTechnologies de linformation Langages de programmation Prolog Partie 2: ModulesNational Standard of CanadaCAN/CSA-ISO/IEC 13211-2:02(ISO/IEC 13211-2:2000)International Standard ISO/IEC
2、 13211-2:2000 (first edition, 2000-06-01) has been adopted withoutmodification (IDT) as CSA Standard CAN/CSA-ISO/IEC 13211-2:02, which has been approved as a NationalStandard of Canada by the Standards Council of Canada.ISBN 1-55324-957-7 December 2002The Canadian Standards Association (CSA), The St
3、andards Council of Canada is theunder whose auspices this National Standard has been coordinating body of the National Standards system, produced, was chartered in 1919 and accredited by a federation of independent, autonomousthe Standards Council of Canada to the National organizations working towa
4、rds the furtherStandards system in 1973. It is a not-for-profit, development and improvement of voluntarynonstatutory, voluntary membership association standardization in the national interest.engaged in standards development and certification The principal objects of the Council are to foster activ
5、ities. and promote voluntary standardization as a means CSA standards reflect a national consensus of of advancing the national economy, benefiting theproducers and users including manufacturers, health, safety, and welfare of the public, assisting consumers, retailers, unions and professional and p
6、rotecting the consumer, facilitating domestic organizations, and governmental agencies. The and international trade, and furthering internationalstandards are used widely by industry and commerce cooperation in the field of standards.and often adopted by municipal, provincial, and A National Standar
7、d of Canada is a standard whichfederal governments in their regulations, particularly has been approved by the Standards Council ofin the fields of health, safety, building and Canada and one which reflects a reasonableconstruction, and the environment. agreement among the views of a number of capab
8、leIndividuals, companies, and associations across individuals whose collective interests provide to theCanada indicate their support for CSAs standards greatest practicable extent a balance ofdevelopment by volunteering their time and skills to representation of producers, users, consumers, andCSA C
9、ommittee work and supporting the Associations others with relevant interests, as may be appropriateobjectives through sustaining memberships. The to the subject in hand. It normally is a standardmore than 7000 committee volunteers and the 2000 which is capable of making a significant and timelysusta
10、ining memberships together form CSAs total contribution to the national interest.membership from which its Directors are chosen. Approval of a standard as a National Standard ofSustaining memberships represent a major source of Canada indicates that a standard conforms to theincome for CSAs standard
11、s development activities. criteria and procedures established by the StandardsThe Association offers certification and testing Council of Canada. Approval does not refer to theservices in support of and as an extension to its technical content of the standard; this remains thestandards development a
12、ctivities. To ensure the continuing responsibility of the accreditedintegrity of its certification process, the Association standards-development organization.regularly and continually audits and inspects products Those who have a need to apply standards arethat bear the CSA Mark. encouraged to use
13、National Standards of CanadaIn addition to its head office and laboratory complex whenever practicable. These standards are subject in Toronto, CSA has regional branch offices in major to periodic review; therefore, users are cautioned centres across Canada and inspection and testing to obtain the l
14、atest edition from the organizationagencies in eight countries. Since 1919, the preparing the standard.Association has developed the necessary expertise to The responsibility for approving National Standards meet its corporate mission: CSA is an independent of Canada rests with theservice organizati
15、on whose mission is to provide an Standards Council of Canadaopen and effective forum for activities facilitating the 270 Albert Street, Suite 200exchange of goods and services through the use of Ottawa, Ontario, K1P 6N7standards, certification and related services to meet Canadanational and interna
16、tional needs.For further information on CSA services, write toCanadian Standards Association5060 Spectrum Way, Suite 100Mississauga, Ontario, L4W 5N6CanadaAlthough the intended primary application of this Standard is stated in its Scope, it is importantto note that it remains the responsibility of t
17、he users to judge its suitability for their particular purpose.Registered trade-mark of Canadian Standards AssociationCAN/CSA-ISO/IEC 13211-2:02 languages Prolog Part 2: ModulesInformation technology ProgrammingDecember 2002 Canadian Standards Association CSA/1CAN/CSA-ISO/IEC 13211-2:02Information t
18、echnology Programming languages Prolog Part 2: ModulesCSA PrefaceStandards development within the Information Technology sector is harmonized with internationalstandards development. Through the CSA Technical Committee on Information Technology (TCIT),Canadians serve as the Canadian Advisory Committ
19、ee (CAC) on ISO/IEC Joint Technical Committee 1 onInformation Technology (ISO/IEC JTC1) for the Standards Council of Canada (SCC), the ISO memberbody for Canada and sponsor of the Canadian National Committee of the IEC. Also, as a member of theInternational Telecommunication Union (ITU), Canada part
20、icipates in the International Telegraph andTelephone Consultative Committee (ITU-T).This International Standard was reviewed by the CSA TCIT under the jurisdiction of the StrategicSteering Committee on Information Technology and deemed acceptable for use in Canada. (Acommittee membership list is ava
21、ilable on request from the CSA Project Manager.) From time to time,ISO/IEC may publish addenda, corrigenda, etc. The CSA TCIT will review these documents for approvaland publication. For a listing, refer to the CSA Information Products catalogue or CSA Info Update orcontact a CSA Sales representativ
22、e. This Standard has been formally approved, without modification, bythe Technical Committee and has been approved as a National Standard of Canada by the StandardsCouncil of Canada.December 2002 Canadian Standards Association 2002All rights reserved. No part of this publication may be reproduced in
23、 any form whatsoever without the priorpermission of the publisher. ISO/IEC material is reprinted with permission. Where the words “thisInternational Standard” appear in the text, they should be interpreted as “this National Standard ofCanada”. Inquiries regarding this National Standard of Canada sho
24、uld be addressed to Canadian Standards Association 5060 Spectrum Way, Suite 100, Mississauga, Ontario, Canada L4W 5N6 1-800-463-6727 416-747-4044www.csa.caReference numberISO/IEC 13211-2:2000(E)ISO/IEC 2000INTERNATIONALSTANDARDISO/IEC13211-2First edition2000-06-01Information technology Programmingla
25、nguages Prolog Part 2:ModulesTechnologies de linformation Langages de programmation Prolog Partie 2: ModulesISO/IEC 13211-2:2000(E)PDF disclaimerThis PDF file may contain embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall notbe edited unless
26、the typefaces which are embedded are licensed to and installed on the computer performing the editing. In downloading thisfile, parties accept therein the responsibility of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in thisarea.Adobe is a trademark of Ad
27、obe Systems Incorporated.Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation parameterswere optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unl
28、ikely eventthat a problem relating to it is found, please inform the Central Secretariat at the address given below. ISO/IEC 2000All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronicor mechanical, including
29、photocopying and microfilm, without permission in writing from either ISO at the address below or ISOs member bodyin the country of the requester.ISO copyright officeCase postale 56 Gb7 CH-1211 Geneva 20Tel. + 41 22 749 01 11Fax + 41 22 734 10 79E-mail copyrightiso.chWeb www.iso.chii ISO/IEC 2000 Al
30、l rights reservedISO/IEC 13211-2:2000(E)Contents PageForeword vIntroduction vi1ScopeBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBM 11.1 Notes. 12 Normative reference BMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBM
31、BMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBM 13 Terms and definitions BMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBM 14 Compliance BMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMB
32、MBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBM 34.1 Prologprocessor. 34.2 Module text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.3 Prologgoal 34.4
33、Prolog modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.4.1 Prolog text without modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.4.2 The m
34、odule user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44.5 Documentation 44.5.1 Dynamic Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44.5.
35、2 Inaccessible Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45SyntaxBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBM 45.1 Mo
36、dule text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45.2 Terms 45.2.1 Operators 46 Language concepts and semantics BMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMB
37、MBMBMBMBMBMBMBMBMBM 46.1 Relatedterms. 56.1.1 Qualified and unqualified terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56.2 Module text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38、 . . . . . . . . . . . . . . . . . 56.2.1 Module user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56.2.2 Procedure Visibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39、. . . . . . . . . . . . . . 56.2.3 Module interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56.2.4 Module directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40、 . . . . . . . . . 66.2.5 Module body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76.2.6 Clauses 76.3 Completedatabase . 86.3.1 Visibledatabase . 86.3.2 Examples 86.4 Contextsensitive predicates. 86.4.1 Metapredicate b
41、uilt-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86.4.2 Context sensitive built-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96.4.3 Module name expansion . . .
42、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96.4.4 Examples: Metapredicates 96.5 Convertingaterm toaclause, andaclause toaterm 106.5.1 Convertingaterm tothehead ofa clause 106.5.2 Converting a module qualified term to a body . . . . . . .
43、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106.5.3 Converting the body of a clause to a term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116.6 ExecutingaProloggoal. 12iiiISO/IEC 2000 All rights reservedISO/IEC 13211-2:2000(E)6.6.1 Data typ
44、es forthe executionmodel. 126.6.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126.6.3 Searchingthe complete database . 136.6.4 Selectingaclause forexecution 136.6.5 Backtracking 146.6.6 Executing auser
45、-definedprocedure:. 146.6.7 Executing a built-in predicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.7 Executinga control construct . 146.7.1 call/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
46、 . . . . . . . . . . . . . . . . . . . . . . . . . 146.7.2 catch/3 156.7.3 throw/1 156.8 Predicate properties. 166.9 Flags . 166.9.1 Flag: colon sets calling context 166.10 Errors 166.10.1 Errorclassification 167 Built-in predicates BMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMB
47、MBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBMBM 167.1 The format of built-in predicate definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167.1.1 Type of anargument 167.2 Module predicates . . . . . . . . . . . . . . . . . . . .
48、. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167.2.1 current module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177.2.2 predicate property/2. 177.3 Clause retrievalandinformat
49、ion . 187.3.1 clause/2 . 187.3.2 current predicate/1 197.4 Database access and modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207.4.1 asserta/1 . 207.4.2 assertz/1 . 217.4.3 retract/1 . 217.4.4 abolish/1. 22iv ISO/IEC 2000 All rights reservedISO/IEC 13211-2:2000(E)vISO/IEC 2000 All rights reservedForewordISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specializedsystem for worldwi
copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1