Open TurtlePU opened 1 month ago
While this is great, there's still room for improvement: notably, when we run the circuit, the Layout
and Payload
part have to be provided separately, and this looks like a possible source of mistakes.
Agree with the change to ArithmeticCircuit
. Would it be better to make the payload a part of the context?
- pieces :: d -> Support d -> Context d (Layout d)
+ pieces :: Context d ~ c => d -> Support d -> c (Layout d) (Payload d)
- restore :: (Support d -> Context d (Layout d)) -> d
+ restore :: Context d ~ c => (Support d -> c (Layout d) (Payload d)) -> d
Agree with the change to
ArithmeticCircuit
. Would it be better to make the payload a part of the context?
The "modes" of payload do not agree, sadly: arithmetic circuit is contravariant with respect to payload, while in pieces
/restore
it has to be covariant
Symbolic
List
, as designed, requires a separate list (Haskell's[]
) of witnesses to function properly. The problem is, we cannot write a goodSymbolicData
instance forList
as defined currently; however, this can be solved by the following additions:Setting
Payload
for lists of typex
to be aStream :.: (Layout x :*: Payload x)
(whereStream
is an infinite list withRep Stream = Natural
), we get aSymbolicData
instance forList
s. Note that the signature forcompile
function stays (almost) the same: we only need to provide a correct parameter forp
, which isPayload (Support f)
.Subtasks:
Payload
type family (maybe it's better to wait for #299 to be merged first)SymbolicData
forList