Skip to content

Conversation

pi8027
Copy link
Collaborator

@pi8027 pi8027 commented Jun 30, 2023

This PR implements the Z_zmodule_simplify tactic. For example, it turns a goal of the form

(x + y + - z + y)%Z = (x + - z + y + y')%Z

into

y = y'.

This kind of reflexive tactic leaving a proof obligation needs to simplify the obligation carefully. I'm not sure whether the current implementation is the best way to do so.

Comment on lines +186 to +189
(forall zero add vm', zero = zeroG -> add = addG -> vm' = vm ->
let norm := ZMnorm (AGAdd e1 (AGOpp e2)) in
let '(xs, ys) := ZMsimpl_aux vm' norm in
sum zero add xs = sum zero add ys) ->
Copy link
Collaborator Author

@pi8027 pi8027 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the proof obligation of the Z_zmodule_simplify tactic: zero, add, and vm' are abstracted out to make sure that they will not be reduced. I thought that norm should be reduced by vm_compute, and the other part should be reduced by lazy or compute because its readback seems to be costly.

It is quite intricate, so should be documented in detail.

Comment on lines +67 to +69
intros zero add vm zeroE addE vmE norm;
vm_compute in norm; compute;
rewrite zeroE, addE, vmE; clear zero add vm zeroE addE vmE norm.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is the normalization of the proof obligation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant