________________________________________________________________________

This file is part of Logtalk <https://logtalk.org/>  
Copyright 1998-2020 Paulo Moura <pmoura@logtalk.org>

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(mi(loader)).
...


% set a point in the space-time:

| ?- xyzt::rotate(1, 2, 3).
yes

| ?- xyzt::translate(4).
yes


% verify it:

| ?- xyzt::xyzt(X, Y, Z, T).

T = 4,
X = 1,
Y = 2,
Z = 3 ? 
yes


% enumerate space_time public predicates:

| ?- xyzt::(current_predicate(Functor/Arity), functor(Pred, Functor, Arity), predicate_property(Pred, declared_in(Object))).

Pred = xyzt(_A,_B,_C,_D),
Arity = 4,
Object = space_time,
Functor = xyzt ? ;

Pred = xyz(_A,_B,_C),
Arity = 3,
Object = xyz,
Functor = xyz ? ;

Pred = rotate(_A,_B,_C),
Arity = 3,
Object = xyz,
Functor = rotate ? ;

Pred = t(_A),
Arity = 1,
Object = t,
Functor = t ? ;

Pred = translate(_A),
Arity = 1,
Object = t,
Functor = translate ? ;

no



% get the origin distance from a point in the space-time(_, _, _, _):

| ?- xyzt(2,3,4,7)::distance(D).

D = 5.385164807134504
yes

| ?- xyzt(2,3,4,7)::time(T).

T = 7
yes


% enumerate xyzt(_, _, _, _) public predicates:

| ?- xyzt(2,3,4,7)::(current_predicate(Functor/Arity), functor(Pred, Functor, Arity), predicate_property(Pred, declared_in(Object))).

Pred = distance(_A),
Arity = 1,
Object = xyz(_B,_C,_D),
Functor = distance ? ;

Pred = time(_A),
Arity = 1,
Object = t(_B),
Functor = time ? ;

no
