SolverState

data class SolverState(    baseDirectory: String,     outputFileCreator: (String) -> Writer,     val names: NameProvider = NameProvider(),     val solver: Solver = Solver(names),     val prover: ProverEnvironment = solver.newProverEnvironment( SolverContext.ProverOptions.GENERATE_MODELS, SolverContext.ProverOptions.GENERATE_UNSAT_CORE ),     val callableConstraints: MutableMap<FqName, MutableList<DeclarationConstraints>> = mutableMapOf(),     val solverTrace: MutableList<String> = mutableListOf(),     val fieldProvider: FieldProvider = FieldProvider(solver, prover),     reportedErrors: MutableSet<ReportedError> = mutableSetOf())

Constructors

Link copied to clipboard
fun SolverState(    baseDirectory: String,     outputFileCreator: (String) -> Writer,     names: NameProvider = NameProvider(),     solver: Solver = Solver(names),     prover: ProverEnvironment = solver.newProverEnvironment( SolverContext.ProverOptions.GENERATE_MODELS, SolverContext.ProverOptions.GENERATE_UNSAT_CORE ),     callableConstraints: MutableMap<FqName, MutableList<DeclarationConstraints>> = mutableMapOf(),     solverTrace: MutableList<String> = mutableListOf(),     fieldProvider: FieldProvider = FieldProvider(solver, prover),     reportedErrors: MutableSet<ReportedError> = mutableSetOf())

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