LightJason - AgentSpeak(L++)
IUnifier.java
Go to the documentation of this file.
1 /*
2  * @cond LICENSE
3  * ######################################################################################
4  * # LGPL License #
5  * # #
6  * # This file is part of the LightJason AgentSpeak(L++) #
7  * # Copyright (c) 2015-19, LightJason (info@lightjason.org) #
8  * # This program is free software: you can redistribute it and/or modify #
9  * # it under the terms of the GNU Lesser General Public License as #
10  * # published by the Free Software Foundation, either version 3 of the #
11  * # License, or (at your option) any later version. #
12  * # #
13  * # This program is distributed in the hope that it will be useful, #
14  * # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15  * # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16  * # GNU Lesser General Public License for more details. #
17  * # #
18  * # You should have received a copy of the GNU Lesser General Public License #
19  * # along with this program. If not, see http://www.gnu.org/licenses/ #
20  * ######################################################################################
21  * @endcond
22  */
23 
24 package org.lightjason.agentspeak.language.unify;
25 
33 
34 import javax.annotation.Nonnull;
35 import java.util.Collections;
36 import java.util.Set;
37 import java.util.stream.Stream;
38 
39 
43 public interface IUnifier
44 {
49  {
50  @Nonnull
51  @Override
52  public final Set<IVariable<?>> unify( @Nonnull final ILiteral p_source, @Nonnull final ILiteral p_target )
53  {
54  return Collections.emptySet();
55  }
56 
57  @Nonnull
58  @Override
59  public final IFuzzyValue<Boolean> unify( @Nonnull final IContext p_context, @Nonnull final ILiteral p_literal, final long p_variables,
60  @Nonnull final IExpression p_expression, final boolean p_parallel )
61  {
62  return CFuzzyValue.from( false );
63  }
64  };
65 
66 
76  @Nonnull
77  Set<IVariable<?>> unify( @Nonnull final ILiteral p_source, @Nonnull final ILiteral p_target );
78 
89  @Nonnull
90  IFuzzyValue<Boolean> unify( @Nonnull final IContext p_context, @Nonnull final ILiteral p_literal, final long p_variables,
91  @Nonnull final IExpression p_expression, final boolean p_parallel );
92 
93 
97  interface IAlgorithm
98  {
99 
110  <T extends ITerm> boolean unify( final Set<IVariable<?>> p_variables, final Stream<T> p_source, final Stream<T> p_target );
111 
112  }
113 
114 }
Set< IVariable<?> > unify( @Nonnull final ILiteral p_source, @Nonnull final ILiteral p_target)
unifies a literal
< T extends ITerm > boolean unify(final Set< IVariable<?>> p_variables, final Stream< T > p_source, final Stream< T > p_target)
unify algorithm
static< N > IFuzzyValue< N > from( @Nonnull final N p_value)
factory
interface of an unification algorithm
Definition: IUnifier.java:43
execution context with local data
Definition: IContext.java:42
result for an immutable fuzzy value