Did you know ... | Search Documentation: |
Pack logtalk -- logtalk-3.86.0/examples/permutations/SCRIPT.txt |
This file is part of Logtalk https://logtalk.org/ SPDX-FileCopyrightText: 1998-2024 Paulo Moura <pmoura@logtalk.org> SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
% load the example:
| ?- logtalk_load(permutations(loader))
.
...
% some example benchmark queries for backend Prolog compilers implementing % the time/1 timing predicate (e.g., SWI-Prolog, Trealla Prolog, YAP, XVM, % and others);:
?- time(true)
. % auto-load the predicate in the case of SWI-Prolog
true.
?- time(permutations::backtracking(7)
).
% 5,945 inferences, 0.001 CPU in 0.001 seconds (99% CPU, 11388889 Lips)
true.
?- time(permutations::list(7, _)
).
% 24,029 inferences, 0.002 CPU in 0.003 seconds (78% CPU, 11150348 Lips)
true.
?- time(permutations::all(7, _)
).
% 10,993 inferences, 0.002 CPU in 0.003 seconds (79% CPU, 5091709 Lips)
true.
?- time(permutations::map(7, _)
).
% 44,190 inferences, 0.006 CPU in 0.007 seconds (80% CPU, 7770353 Lips)
true.
?- time(permutations::copy(7)
).
% 34,110 inferences, 0.005 CPU in 0.006 seconds (79% CPU, 7558165 Lips)
true.