Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
galaxyzen opened this issue Mar 5, 2025 · 1 comment

Comments

@galaxyzen
Copy link

📝 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

@galaxyzen galaxyzen 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? Mar 5, 2025
@zhangt2333
Copy link
Member

zhangt2333 commented Apr 17, 2025

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
Projects
None yet
Development

No branches or pull requests

2 participants