Did you know ... Search Documentation:
Pack logtalk -- logtalk-3.86.0/examples/includes/SCRIPT.txt

This file is part of Logtalk https://logtalk.org/ SPDX-FileCopyrightText: 1998-2023 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.

% start by loading the example:

| ?- logtalk_load(includes(loader)). ...

% test the use of the Logtalk include/1 directive as a file directive:

| ?- findall(Vowel, vowel(Vowel), Vowels).

Vowels = [a,e,i,o,u] yes

% test the use of the Logtalk include/1 directive as an entity directive % by getting a list of all capitals:

| ?- countries::capitals(Capitals).

Capitals = [berlim, lisbon, madrid, paris, varsovia] yes

% test the use of the Logtalk include/1 directive as an entity directive % by getting sets of countries with the same population:

| ?- setof(Countries, countries::same_population(Countries), Solutions).

Solutions = [[france, poland], [germany, spain], [portugal]] yes

% show the initial counter values, which may depend on previous runs:

| ?- counters::counter(Counter, Value).

Counter = a, Value = ... ; Counter = b, Value = ... ; Counter = c, Value = ... yes

% increment one of the counters and save the counters database:

| ?- counters::inc_counter(b).

yes

| ?- counters::save_counters.

yes