Class PBody
java.lang.Object
tools.refinery.interpreter.matchers.psystem.PBody
- All Implemented Interfaces:
PTraceable
A set of constraints representing a pattern body
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAll unary input keys directly prescribed by constraints, grouped by variable.<ConstraintType>
Set<ConstraintType> getConstraintsOfType
(Class<ConstraintType> constraintClass) Returns the disjunction the body is contained with.Finds and returns a PVariable by name.Returns the exported parameter constraints of the body.Returns the symbolic parameters of the body.Find a PVariable by nameboolean
newConstantVariable
(Object value) newVirtualVariable
(String name) void
setContainerDisjunction
(PDisjunction containerDisjunction) void
setStatus
(PQuery.PQueryStatus status) Sets a specific status for the body.void
setSymbolicParameters
(List<ExportedParameter> symbolicParameters) Sets the exported parameter constraints of the body, if this instance is mutable.
-
Field Details
-
VIRTUAL_VARIABLE_PREFIX
- See Also:
-
-
Constructor Details
-
PBody
-
-
Method Details
-
getConstraintsOfType
-
newVirtualVariable
-
newVirtualVariable
-
newConstantVariable
-
getAllVariables
-
getUniqueVariables
-
getVariableByNameChecked
Find a PVariable by name- Parameters:
name
-- Returns:
- the found variable
- Throws:
IllegalArgumentException
- if no PVariable is found with the selected name
-
getOrCreateVariableByName
Finds and returns a PVariable by name. If no PVariable exists with the name in the body, a new one is created. If the name of the variable starts with ".virtual", the created variable will be considered virtual.- Parameters:
name
-- Returns:
- a PVariable with the selected name; never null
-
getConstraints
-
getPattern
-
getSymbolicParameterVariables
Returns the symbolic parameters of the body.Warning: if two PVariables are unified, the returned list changes. If you want to have a stable version, consider using
getSymbolicParameters()
.- Returns:
- a non-null, but possibly empty list
-
getSymbolicParameters
Returns the exported parameter constraints of the body.- Returns:
- a non-null, but possibly empty list
-
setSymbolicParameters
Sets the exported parameter constraints of the body, if this instance is mutable.- Parameters:
symbolicParameters
- the new value
-
setStatus
Sets a specific status for the body. If set, the parent PQuery status will not be checked; if set to null, its corresponding PQuery status is checked for mutability.- Parameters:
status
- the status to set
-
isMutable
public boolean isMutable() -
getContainerDisjunction
Returns the disjunction the body is contained with. This disjunction may either be thecanonical disjunction of the corresponding query
or something equivalent.- Returns:
- the container disjunction of the body. Can be null if body is not in a disjunction yet.
-
setContainerDisjunction
- Parameters:
containerDisjunction
- the containerDisjunction to set
-
getAllUnaryTypeRestrictions
All unary input keys directly prescribed by constraints, grouped by variable.to supertype inference or subsumption applied at this point.
-