ArgumentPositionMaps.java

// FILE. . . . . d:/hak/hlt/src/hlt/fot/fuz/ArgumentPositionMaps.java
// EDIT BY . . . Hassan Ait-Kaci
// ON MACHINE. . Hak-Laptop
// STARTED ON. . Sun Jul 15 07:37:57 2018

package hlt.fot.fuz;



This represents a fuzzy set of ArgumentPositionMapping objects. Given sim, a SignatureSimilarity on sig a SimilarFunctorSignature, an instance of this class (call it maps) specifies, for each approximation degree α in sim.degrees(), the following information:
  • for each pair of distinct but α-similar Functors f and g in sig, it specifies a set of elements of the form i:j, where i and i are positive natural numbers such that 1 ≤ i ≤ f.arity() and 1 ≤ j ≤ g.arity();
  • each i:j indicates that f's argument position i is mapped to g's argument position j (and vice versa);
  • the number of such pairs per mapping may not exceed the minimum of f's arity and g's arity, and determines the size of the mapping;
  • for any approximation degree α in sim.degrees() and α-similarity class of functors [f]α, this number is constant and can only decrease as α decreases (click here for details);
  • such a set is represented as an ArgumentPositionMapping object.

See also:  /Functor, /Signature, SignatureSimilarity, SimilarFunctorSignature, ArgumentPositionMapping
Copyright:  © by the author
Author:  Hassan Aït-Kaci
Version:  Last modified on Sun Aug 12 06:11:54 2018 by hak



import hlt.fot.Functor;

import hlt.language.util.ArrayList;
import hlt.language.util.IntArrayList;
import hlt.language.util.DoubleArrayList;

public class ArgumentPositionMaps
{
  

The signature similarity of this ArgumentPositionMaps object.


  private SignatureSimilarity similarity;

  

Returns the signature similarity of this ArgumentPositionMaps object.


  public SignatureSimilarity similarity ()
  {
    return similarity;
  }

  

Returns this ArgumentPositionMaps object's similarity's signature.


  public SimilarFunctorSignature signature ()
  {
    return similarity.signature();
  }

  

Returns the list of doubles that are the fuzzy approximation degrees of the mappings that constitute this ArgumentPositionMaps object as a DoubleArrayList. By construction, it will always be sorted in strictly increasing order; i.e., if 0i < j < size(), then degrees().get(i) < degrees().get(j).


  public DoubleArrayList degrees ()
  {
    return similarity.degrees();
  }

  

Returns the number of maps.


  public int size ()
  {
    return degrees().size();
  }
  

The list argumentMappings is an ArrayList of ArgumentPositionMapping objects. It has the same size as degrees(). For each fuzzy degree α in degrees(), it associates to each pair ⟨f,g⟩ of distinct but α-similar functors an argument position mapping in the form of a list of pairs of argument positions i:j, where 1if.arity() and 1jg.arity().


  private ArrayList argumentMappings = new ArrayList(size());

  

Returns the list of ArgumentPositionMapping objects. This is an ArrayList that has the same size as the DoubleArrayList degrees(). An ArgumentPositionMapping specifies a set of pairs of argument positions for a given approximation degree α in degrees() and a pair of distinct but α-similar functors ⟨f,g⟩.


  public ArrayList argumentMappings ()
  {
    return argumentMappings;
  }

  

This defines an argument position mapping for the approximation degree at specified index, functors, and list of position pairs.


  public void defineArgumentMapping (int index,
				     Functor f, Functor g,
				     IntArrayList positionPairs)
  {
    argumentMappings.add(new ArgumentPositionMapping(this,index,f,g)
			 .defineMapping(positionPairs));
  }

  /* ************************************************************************ */

  

In order to take into account a signature similarity during unification and generalization, for each similarity degree α in degrees() (i.e., in similarity().degrees() inherited from hlt.math.fuzzy.FuzzyMatrix that returns them a DoubleArrayList sorted in increasing order), we must specify for any pair of distinct but α-similar functors ⟨f,g⟩ the number and order of argument positions to take into account to propagate the operations to their respective corresponding subterms. There are conditions that must be verified such that these mappings be consistent with the reflexivity, symmetry, and transitivity of the similarity (click here for details). This is what the method checkConsistencyAndCompleteness() on a set


  public boolean checkConsistencyAndCompleteness ()
  {
    return true; // no-op - not used nor implemented for now
  }

  /* ************************************************************************ */

      
}


This file was generated on Sat Aug 25 08:03:09 CEST 2018 from file ArgumentPositionMaps.java
by the hlt.language.tools.Hilite Java tool written by Hassan Aït-Kaci