Class TypedStructureAdapter

    • Constructor Detail

      • TypedStructureAdapter

        public TypedStructureAdapter()
        Default-Ctor: Creating empty typed structure
      • TypedStructureAdapter

        public TypedStructureAdapter​(String name)
        Initializes a structure of arity zero with the given name;
        Parameters:
        name - the name of the structure
      • TypedStructureAdapter

        public TypedStructureAdapter​(String name,
                                     int arity)
        Initializes a structure with the given name and of the given arity. Every argument gets the sort Sort.THING.
        Parameters:
        name - the name of the structure
        arity - the arity of this structure
      • TypedStructureAdapter

        public TypedStructureAdapter​(String name,
                                     List<Sort> arguments)
        Initializes a structure with the given name and the given list of argument sorts.
        Parameters:
        name - the name of the structure
        arguments - the sorts of the arguments
    • Method Detail

      • setName

        public void setName​(String name)
        Description copied from interface: TypedStructure
        Changes the name of the Structure
        Specified by:
        setName in interface TypedStructure
        Parameters:
        name - The new name of the structure
      • getArity

        public int getArity()
        Specified by:
        getArity in interface TypedStructure
        Returns:
        the arity of this structure
      • getArgumentTypes

        public List<Sort> getArgumentTypes()
        Specified by:
        getArgumentTypes in interface TypedStructure
        Returns:
        An unmodifiable list which length equals the arity of the predicate if the structure isComplete().
      • addArgumentType

        public void addArgumentType​(Sort argType)
        Description copied from interface: TypedStructure
        Adds the given Sort as argument type to the typed Structure
        Specified by:
        addArgumentType in interface TypedStructure
        Parameters:
        argType - The Sort descibing the argument type
      • removeArgumentType

        public Sort removeArgumentType​(int index)
        Description copied from interface: TypedStructure
        Removes the argument type at the specified index
        Specified by:
        removeArgumentType in interface TypedStructure
        Parameters:
        index - The index
        Returns:
        A reference to the sort that has been remove or null if no sort has been removed.
      • removeArgumentType

        public boolean removeArgumentType​(Sort argType)
        Description copied from interface: TypedStructure
        Removes the given Sort from the list of argument types
        Specified by:
        removeArgumentType in interface TypedStructure
        Parameters:
        argType - The Sort which is removed
        Returns:
        true if the Sort exists in the list of argument types and is successfully removed, false otherwise.
      • isTyped

        public boolean isTyped()
        Specified by:
        isTyped in interface TypedStructure
        Returns:
        true if at least one sort for an argument is not "Thing".
      • isComplete

        public boolean isComplete()
        Specified by:
        isComplete in interface TypedStructure
        Returns:
        true if the arity of this structure matches the length of it's arguments, false if the arity is bigger than the length of it's arguments.
      • hashCode

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

        protected List<Sort> copyArgumentTypes()