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

Link copied to clipboard
fun addConstraint(constraint: NamedConstraint, context: ResolutionContext)
Link copied to clipboard
inline fun <A> bracket(f: () -> A): A
Link copied to clipboard
fun field(field: DeclarationDescriptor, formula: ObjectFormula): ObjectFormula
Link copied to clipboard
fun hadParseErrors(): Boolean
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
Link copied to clipboard
fun notifyModuleProcessed(moduleDescriptor: ModuleDescriptor)
Link copied to clipboard
fun notifySarifReport(id: ErrorIds, element: Element, msg: String)
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

Link copied to clipboard
fun signalParseErrors()

Properties

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

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

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

Extensions

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

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.

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.

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