SolverState

data class SolverState(baseDirectory: String, outputFileCreator: (String) -> Writer, names: NameProvider, solver: Solver, prover: ProverEnvironment, callableConstraints: MutableMap<FqName, MutableList<DeclarationConstraints>>, solverTrace: MutableList<String>, fieldProvider: FieldProvider, reportedErrors: MutableSet<ReportedError>)

Functions

addConstraint
Link copied to clipboard
fun addConstraint(constraint: NamedConstraint, context: ResolutionContext)
bracket
Link copied to clipboard
inline fun <A> bracket(f: () -> A): A
field
Link copied to clipboard
fun field(field: DeclarationDescriptor, formula: ObjectFormula): ObjectFormula
hadParseErrors
Link copied to clipboard
fun hadParseErrors(): Boolean
newName
Link copied to clipboard
fun newName(context: ResolutionContext, prefix: String, element: Element?): String
fun newName(context: ResolutionContext, prefix: String, element: Element?, reference: Pair<ValueParameterDescriptor, ResolvedValueArgument>?): String
notifyModuleProcessed
Link copied to clipboard
fun notifyModuleProcessed(moduleDescriptor: ModuleDescriptor)
notifySarifReport
Link copied to clipboard
fun notifySarifReport(id: ErrorIds, element: Element, msg: String)
scopedBracket
Link copied to clipboard
fun <A> scopedBracket(cont: () -> ContSeq<A>): ContSeq<A>

This signals that part of the computation happens inside a push/pop bracket

signalParseErrors
Link copied to clipboard
fun signalParseErrors()

Properties

callableConstraints
Link copied to clipboard
continuationBracket
Link copied to clipboard
val continuationBracket: ContSeq<Unit>

This signals that the rest of the computation happens inside a push/pop bracket

fieldProvider
Link copied to clipboard
val fieldProvider: FieldProvider
names
Link copied to clipboard
val names: NameProvider
prover
Link copied to clipboard
val prover: ProverEnvironment
solver
Link copied to clipboard
val solver: Solver
solverTrace
Link copied to clipboard
val solverTrace: MutableList<String>

Extensions

checkDeclarationConstraints
Link copied to clipboard
fun SolverState.checkDeclarationConstraints(context: ResolutionContext, declaration: Declaration, descriptor: DeclarationDescriptor)

When the solver is in the prover state check this declaration body constraints

collectConstraintsFromAnnotations
Link copied to clipboard
fun SolverState.collectConstraintsFromAnnotations(localDeclarations: List<DeclarationDescriptor>, module: ModuleDescriptor, bindingTrace: ResolutionContext): Pair<AnalysisResult, Set<FqName>>

Collects constraints by harvesting annotations. There are two sources: local declarations, and the entire CLASSPATH.

findDescriptorFromLocalLaw
Link copied to clipboard
fun SolverState.findDescriptorFromLocalLaw(descriptor: DeclarationDescriptor, bindingContext: ResolutionContext): DeclarationDescriptor?

Finds the target of a particular law by looking at its last return, if marked with a arrow.analysis.Law annotation.

getConstraintsFor
Link copied to clipboard
fun SolverState.getConstraintsFor(resolvedCall: ResolvedCall): DeclarationConstraints?

Looks up in the solver state previously collected constraints and returns the constraints associated to this resolvedCall resulting descriptor if any

fun SolverState.getConstraintsFor(descriptor: DeclarationDescriptor): DeclarationConstraints?

Looks up in the solver state previously collected constraints and returns the constraints associated to this descriptor, or any of the declaration it has overridden, if any