algebraic data types - In Agda is it possible to define a datatype that has equations? -
I want to describe the integer:
set the data integer: Z: Integer succ: integer - & gt; Integer Completed: Integer - & gt; Maximum Marks ?? Do not define the above integers and we need Succ (Pred x) = x and Pred (Succ x) = x, however, spReduce: (m: integer) - & gt; Succ (Pred m) = m psReduce: (m: integer) - & gt; Pred (Succ m) = m
Can not be added to the data type A better definition of integer is most definitely,
Data Integers: set Pauses: Net - & gt; Integer negative: Net - & gt; Integers
But I'm curious if there is a way to add equations to datat.
It looks like what you want to do, your Integers
equivalence relationship Type as a quotient type which recognizes m
with Succ (Pred M)
and so on. Now Agda does not support - an experimental library had tried to do this (it was defined through an auxiliary work to force all actions on the basis of a subsidiary, for which proof of the reciprocal invariance required ), But then someone came to know that the implementation was not enough and therefore could cause inconsistencies, a postulate that could not be reached from the outside. For kept), details to you can see:
We were not sure that this hack was sound or not. Now, thanks to Dan Dell, I know that it is not.
[...]
In view of these comments it is easy to prove that the above positions are unhealthy:
I think that Right now your best bet (if you want to tighten it to tighten with a similar representation with a similarity) define a setida
for your type ..
Comments
Post a Comment