RISC JKU

at.jku.risc.stout.urauc.data

Class Hedge

    • Field Detail

      • nullHedge

        public static final Hedge nullHedge
      • PRINT_PARAM_END

        public static String PRINT_PARAM_END
      • PRINT_PARAM_SEPARATOR

        public static String PRINT_PARAM_SEPARATOR
      • PRINT_PARAM_START

        public static String PRINT_PARAM_START
    • Constructor Detail

      • Hedge

        public Hedge()
        Create an empty hedge
      • Hedge

        public Hedge(boolean commutative)
        Create an empty hedge
      • Hedge

        public Hedge(int capacity)
        Create an empty hedge with the given initial capacity.
      • Hedge

        public Hedge(int capacity,
             boolean commutative)
        Create an empty hedge with the given initial capacity.
      • Hedge

        public Hedge(List<TermNode> sequence)
        Create a hedge with the specified sequence of TermNodes in it. Changes in the hedge are reflected in this list, and vice-versa.
      • Hedge

        public Hedge(List<TermNode> sequence,
             boolean commutative)
      • Hedge

        public Hedge(TermAtom... atoms)
        Create a hedge with TermNodes which encapsulate the specified TermAtoms in it.
      • Hedge

        public Hedge(TermNode... tNodes)
        Create a hedge with the specified TermNodes in it.
    • Method Detail

      • addAll

        public void addAll(Hedge other)
      • addAll

        public void addAll(TermAtom... atoms)
      • addAll

        public void addAll(TermNode... tNodes)
      • get

        public TermAtom get(int[] position,
                   int idx)
      • getHoleHedge

        public Hedge getHoleHedge()
      • getHoleIdx

        public int getHoleIdx()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • initPosition

        public void initPosition(int[] parentIndex)
      • isCommutative

        public boolean isCommutative()
      • isEmpty

        public boolean isEmpty()
      • isHole

        public boolean isHole()
      • makeAssociative

        public void makeAssociative(Set<TermAtom> associativeSymbols,
                           TermAtom associativeParent)
      • makeCommutative

        public void makeCommutative(Set<TermAtom> commutativeSymbols,
                           boolean commutative)
      • nextCommutativeArrangement

        public boolean nextCommutativeArrangement()
      • normalizeVarNames

        public void normalizeVarNames(Map<String,String> renaming)
      • replace

        public int replace(int idx,
                  Hedge toHedge)
        Attention: Breaks the position indexes!
        Replaces the TermNode at the given position by the given sequence.
        Returns:
        Returns the amount of nodes inserted instead of the old one.
        See Also:
        initPosition(int[])
      • replace

        public int replace(int idx,
                  TermNode toTerm)
        Replaces the TermNode at the given position with a new TermNode if the TermAtom of the new node is not null. Otherwise the old TermNode will be replaced by the given sequence.
        Returns:
        Returns the amount of nodes inserted instead of the old one.
      • replaceHole

        public boolean replaceHole(Hedge plugIn)
        Replaces the hole in this hedge with the given other hedge.Returns true if a hole has been found.
      • setCommutative

        public void setCommutative(boolean commutative)
      • setTo

        public void setTo(TermNode singleNode)
      • size

        public int size()
      • sortCommutative

        public void sortCommutative(boolean sortAll)
      • subHedge

        public Hedge subHedge(int fromIndex)
        Returns a view of the tail of this hedge starting at the specified fromIndex, inclusive.
        See Also:
        subHedge(int, int)
      • subHedge

        public Hedge subHedge(int fromIndex,
                     int toIndex)
        Returns a view of the portion of this hedge between the specified fromIndex, inclusive, and toIndex, exclusive.
        See Also:
        List.subList(int, int)
      • word

        public TermAtomList word()
        Returns the word representation of this hedge
      • word

        public void word(TermAtomList atomList)
        Adds the word representation of this hedge at the end of the list