President Trump reportedly plans to give notice Tuesday that he’ll end the Obama program for “Dreamers” in six months, giving Congress time (and a deadline) to pass a law to resolve one of the toughest immigration issues.

Trump thus keeps his campaign promise to reverse his predecessor’s clearly illegal action, while showing heart for people stuck in a bind through no fault of their own.

The Dreamers are people brought into the country illegally as children. They’ve grown up as Americans, but they have no legal right to be in this country, or even to work here.

President Barack Obama spent most of his first term warning that he couldn’t do anything about the issue: Congress has to change the law. But it didn’t, even under Democratic control.

So, with an eye on the 2012 election, Obama decided first to use executive discretion to not enforce the law in these cases, and then to grant Dreamers a “legal” OK to work in the US. The former was arguably within his power; the latter, clearly not.

Trump vowed to end the illegal program, and the Republican platform incorporated language supporting the action. But he’s put off following through because he has a heart.

The thing is, while the bind they’re in isn’t the Dreamers’ fault, simply legalizing them would reward their parents’ breaking of the law — and encourage future law-breaking.

The situation cries out for compromise: some mechanism that allows all who clearly contribute to society to stay, without letting them totally “jump the line” to permanent legal residence and/or citizenship.

Republicans in Congress (North Carolina Sen. Thom Tillis, Miami Rep. Carlos Curbelo) are working on just such a “fair but rigorous” middle ground. The purists in both parties will oppose it; the question is whether enough Democrats will come on board.

If Congress is ever to find a way to function again, this is a good start.