[ringLib] RING_TAC|RULE ported from HOL-Light #1240
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This PR ports the ring decision procedure (
RING_TAC
andRING_RULE
) from HOL-Light (ringtheory.ml
). The ring decision procedure, currently located atexamples/algebra/ring/ringLib.sml
, can be used to decide equations about ring arithmetics, e.g. (more cases can be found inexamples/algebra/ring/selftest.ml
):Notice that, the output theorems contain extra antecedents requiring all involved ring elements are in the carrier. Notice also that the ring decision procedure doesn't know anything of
ring_inv
(andring_div
, etc.), thusring_inv r y1
is treated as an atom (that's whyring_inv r y1 IN ring_carrier r
is put into the antecedents. The tactic version,RING_TAC
, can automatically retrieve the needed antecedents from the assumptions.This decision procedure can expand the ring expressions as multivariate polynomials (with a default ordering) and sometimes uses Grobner basis algorithm to solve common factors. It accepts input language described in
examples/algebra/ring/ringLibScript.sml
(ringLibTheory
), which is a partial port of HOL-Light's ring theory. This ring theory port is based on HOL4's existing ring theory (now atsrc/algebra/construction/ringTheory
) and theorems can be transported between the two ring theories.Most number types or number-like objects (e.g. vector and matrix) in HOL4's core library can form a ring (actually mostly a field), and the present ring decision procedure can be later specialized to give a "default" decision procedure for all of them.
P.S. There is a dedicate
GROUP_TAC
(group decision procedure) in HOL-Light, which may be useful for cryptographic theories in HOL4. And there's also aFIELD_TAC
(which understands divisions) in HOL-Light'sringtheory.ml
that can be ported (but refined to use dedicated type) to HOL4, in the future.--Chun