View Javadoc

1   /*-
2    * #%L
3    * prolobjectlink-jpi
4    * %%
5    * Copyright (C) 2020 - 2021 Prolobjectlink Project
6    * %%
7    * Permission is hereby granted, free of charge, to any person obtaining a copy
8    * of this software and associated documentation files (the "Software"), to deal
9    * in the Software without restriction, including without limitation the rights
10   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11   * copies of the Software, and to permit persons to whom the Software is
12   * furnished to do so, subject to the following conditions:
13   * 
14   * The above copyright notice and this permission notice shall be included in
15   * all copies or substantial portions of the Software.
16   * 
17   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23   * THE SOFTWARE.
24   * #L%
25   */
26  package io.github.prolobjectlink.prolog;
27  
28  public abstract class PrologBuiltin implements PrologStructure {
29  
30  	// 7.4 directives
31  	static final String INCLUDE = "include";
32  	static final String DYNAMIC = "dynamic";
33  	static final String MULTIFILE = "multifile";
34  	static final String DISCONTIGUOUS = "discontiguous";
35  	static final String ENSURE_LOADED = "ensure_loaded";
36  	static final String INITIALIZATION = "initialization";
37  	static final String CHAR_CONVERSION = "char_conversion";
38  
39  	// 7.8 control constructs
40  	static final String CUT = "!";
41  	static final String NIL = "nil";
42  	static final String THROW = "throw";
43  	static final String CATCH = "catch";
44  	static final String EMPTY_FUNCTOR = "[]";
45  	static final String FAIL_FUNCTOR = "fail";
46  	static final String TRUE_FUNCTOR = "true";
47  	static final String FALSE_FUNCTOR = "false";
48  
49  	// 8.2 term unification
50  	static final String UNIFY_WITH_OCCURS_CHECK = "unify_with_occurs_check";
51  
52  	// 8.3 type testing
53  	static final String VAR = "var";
54  	static final String ATOM = "atom";
55  	static final String FLOAT = "float";
56  	static final String ATOMIC = "atomic";
57  	static final String NONVAR = "nonvar";
58  	static final String NUMBER = "number";
59  	static final String GROUND = "ground";
60  	static final String INTEGER = "integer";
61  	static final String COMPOUND = "compound";
62  	static final String CALLABLE = "callable";
63  	static final String CYCLIC_TERM = "cyclic_term";
64  	static final String ACYCLIC_TERM = "acyclic_term";
65  
66  	// 8.4 term comparison
67  	static final String SORT = "sort";
68  	static final String KEYSORT = "keysort";
69  	static final String COMPARE = "compare";
70  
71  	// 8.5 term creation and decomposition
72  	static final String ARG = "arg";
73  	static final String FUNCTOR = "functor";
74  	static final String COPY_TERM = "copy_term";
75  	static final String TERM_VARIABLES = "term_variables";
76  
77  	// 8.6 arithmetics evaluation (operator)
78  	// 8.7 arithmetic comparison (operator)
79  
80  	// 8.8 clause retrieval and information
81  	static final String CLAUSE = "clause";
82  	static final String CURRENT_PREDICATE = "current_predicate";
83  
84  	// 8.9 clause creation and destruction
85  	static final String ABOLISH = "abolish";
86  	static final String ASSERTA = "asserta";
87  	static final String ASSERTZ = "assertz";
88  	static final String RETRACT = "retract";
89  
90  	// 8.10 All solutions
91  	static final String BAGOF = "bagof";
92  	static final String SETOF = "setof";
93  	static final String FINDALL = "findall";
94  
95  	// 8.11 Stream Selection and Control
96  	static final String OPEN = "open";
97  	static final String CLOSE = "close";
98  	static final String SET_INPUT = "set_input";
99  	static final String SET_OUTPUT = "set_output";
100 	static final String CURRENT_INPUT = "current_input";
101 	static final String CURRENT_OUTPUT = "current_output";
102 
103 	// 8.12 character input/output
104 	// 8.13 byte input/output
105 
106 	// 8.14 Term input/output
107 	static final String NL = "nl";
108 	static final String READ = "read";
109 	static final String WRITE = "write";
110 
111 	// 8.15 logic and control
112 	static final String NOT = "\\+";
113 	static final String CALL = "call";
114 	static final String ONCE = "once";
115 	static final String REPEAT = "repeat";
116 
117 	// 8.16 atomic term processing
118 	static final String SUB_ATOM = "sub_atom";
119 	static final String ATOM_CHARS = "atom_chars";
120 	static final String ATOM_CODES = "atom_codes";
121 	static final String ATOM_LENGTH = "atom_length";
122 	static final String ATOM_CONCAT = "atom_concat";
123 	static final String NUMBER_CODES = "number_codes";
124 	static final String NUMBER_CHARS = "number_chars";
125 
126 	// 8.17 Implementation defined hooks
127 	static final String OP = "op";
128 	static final String HALT = "halt";
129 	static final String CHAR_CODE = "char_code";
130 	static final String CURRENT_OP = "current_op";
131 	static final String SET_PROLOG_FLAG = "set_prolog_flag";
132 	static final String CURRENT_PROLOG_FLAG = "current_prolog_flag";
133 	static final String CURRENT_CHAR_CONVERSION = "current_char_conversion";
134 
135 	// 9.1 simple arithmetic functors
136 	static final String ABS = "abs";
137 	static final String EXP = "exp";
138 	static final String LOG = "log";
139 	static final String CBRT = "cbrt";
140 	static final String SIGN = "sign";
141 	static final String SQRT = "sqrt";
142 	static final String ROUND = "round";
143 	static final String FLOOR = "floor";
144 	static final String CEILING = "ceiling";
145 	static final String FLOAT_INTEGER_PART = "float_integer_part";
146 	static final String FLOAT_FRACTIONAL_PART = "float_fractional_part";
147 	static final String TRUNCATE = "truncate";
148 
149 	// 9.3 other arithmetic functors
150 	static final String MAX = "max";
151 	static final String MIN = "min";
152 	static final String GCD = "gcd";
153 	static final String LCM = "lcm";
154 
155 	// 9.4 bitwise functors
156 
157 	// 9.5 trigonometric functors
158 	static final String SIN = "sin";
159 	static final String COS = "cos";
160 	static final String TAN = "tan";
161 	static final String ASIN = "asin";
162 	static final String ACOS = "acos";
163 	static final String ATAN = "atan";
164 
165 	// 9.6 mathematical constants
166 	static final String E = "e";
167 	static final String PI = "pi";
168 	static final String EPSILON = "epsilon";
169 
170 	// non ISO
171 
172 	// java foreign integration
173 	static final String GET = "get";
174 	static final String SET = "set";
175 	static final String CAST = "cast";
176 	static final String INVOKE = "invoke";
177 	static final String OBJECT = "object";
178 	static final String INSTANCE_OF = "instance_of";
179 	static final String NEW_INSTANCE = "new_instance";
180 	static final String LOAD_LIBRARY = "load_library";
181 	static final String OBJECT_CONVERSION = "object_conversion";
182 
183 	// java runtime reflection
184 	static final String CLASS_OF = "class_of";
185 	static final String FIELDS_OF = "fields_of";
186 	static final String METHODS_OF = "methods_of";
187 	static final String SUPER_CLASS_OF = "super_class_of";
188 	static final String CONSTRUCTORS_OF = "constructors_of";
189 
190 	// runtime statistics
191 	static final String STATISTICS = "statistics";
192 	static final String CURRENT_TIME = "current_time";
193 
194 	private PrologBuiltin() {
195 	}
196 
197 }