Skip to content

what is the role of ParamProvider in EntryPoint and what are the principles for building a suitable ParamProvider?聽#141

Description

@galaxyzen

馃摑 Overall Description

I want to specify some custom entry methods in the PTA analysis (I have to do this, because there is no main-class in my java project).
Fortunately, the issue#9 has explained how to add a custom entry method.

I think the key point is: solver.addEntryPoint(new EntryPoint(jmethod, paramProvider). But, what is the role of paramProvider in EntryPoint and what are the principles for building a suitable ParamProvider?

With the two above questions in mind, I read the source code:

/**
 * @param method    the entry method.
 * @param heapModel the model for generating mock objects.
 * @param k         level of field/array accesses. If this is not 0,
 *                  the provider generates objects recursively along
 *                  k field/array accesses.
 */
public DeclaredParamProvider(JMethod method, HeapModel heapModel, int k) {
    generateObjs(method, heapModel, k);
}
public static EmptyParamProvider get() {
    return INSTANCE;
}
// SpecifiedParamProvider.Builder
public Builder(JMethod method) {
    this.delegate = EmptyParamProvider.get();
    this.method = method;
    this.paramObjs = (Set<Obj>[]) new Set[method.getParamCount()];
    this.fieldObjs = Maps.newTwoKeyMultiMap();
    this.arrayObjs = Maps.newMultiMap();
}

There are 3 ParamProvider in the Tai-e, how should I choose which provider to use and how to construct the provider instance appropriately?

馃幆 Expected Behavior

specify some custom entry methods with a suitable ParamProvider

馃悰 Current Behavior

I am new to Tai-e, so I may need your help.

馃攧 Reproducible Example

No response

鈿欙笍 Tai-e Arguments

馃攳 Click here to see Tai-e Options
{{The content of 'output/options.yml' file}}
馃攳 Click here to see Tai-e Analysis Plan
{{The content of 'output/tai-e-plan.yml' file}}

馃摐 Tai-e Log

馃攳 Click here to see Tai-e Log
{{The content of 'output/tai-e.log' file}}

鈩癸笍 Additional Information

No response

Activity

  1. changed the title [-]What is the impact of different `k` of `DeclaredParamProvider` on custom entry methods?[/-] [+]what is the role of `ParamProvider` in `EntryPoint` and what are the principles for building a suitable `ParamProvider`?[/+] on Mar 5, 2025
  2. zhangt2333 commented on Apr 17, 2025

    @zhangt2333
    Member

    Sorry for the delay.

    what is the role of paramProvider in EntryPoint and what are the principles for building a suitable ParamProvider? There are 3 ParamProvider in the Tai-e, how should I choose which provider to use and how to construct the provider instance appropriately?

    This PR comment covers our test case for customizing entry methods, including four detailed cases and the plugin implementation. Please refer to it, and feel free to ask if you have any further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions