Closed pi8027 closed 3 years ago
@pi8027 If conversions between Elpi's int
and Coq's nat
, positive
, Z
are a bottleneck, I can surely add them to the API (and implement these functions in OCaml). Would that help?
As well as APIs to test if a term is a literal (eg, you find {{ S lp:X }}
and you want to know if X
is a closed nat
fast).
@pi8027 If conversions between Elpi's
int
and Coq'snat
,positive
,Z
are a bottleneck, I can surely add them to the API (and implement these functions in OCaml). Would that help?
Thanks, but I think we first have to identify some real bottlenecks. I don't think these conversions are not a bottleneck now. FYI, there is a performance issue worth investigating in apery.
As well as APIs to test if a term is a literal (eg, you find
{{ S lp:X }}
and you want to know ifX
is a closednat
fast).
I think this one is very useful to normalize exponents!
nat-constant
predicate was too slow. Now we have two predicates:quote.nat
predicate now reifies{{ S (S (..(S lp:N)..)) }}
to{{ NatAdd (NatX lp:M) lp:N' }}
whereM
is the number of nested successors in the input andN'
is the reified term ofN
. This way, we can avoidvm_compute
to detect constants of typenat
. Note that this translation heavily relies on the specific implementation ofaddn
.