Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish implementation of zipWith #419

Closed
kushti opened this issue Mar 7, 2019 · 2 comments
Closed

Finish implementation of zipWith #419

kushti opened this issue Mar 7, 2019 · 2 comments
Labels
soft-fork Implementation requires soft-fork

Comments

@kushti
Copy link
Member

kushti commented Mar 7, 2019

It seems that .zipWith is implemented in parser but no further:

see e.g. "prover enriching context - xor" example:

def Xor(c1: Coll[Byte], c2: Coll[Byte]): Coll[Byte] = c1.zipWith(c2, { (x, y) => x ^ y })
^
Cannot find method 'zipWith' in in the object Ident(c1,NoType) of Product type with methods List(SMethod(sigmastate.SCollection$@41bf79da,size,(Coll[IV]) => SInt,1,None), SMethod(sigmastate.SCollection$@41bf79da,getOrElse,IV => IV,2,Some()), SMethod(sigmastate.SCollection$@41bf79da,map,[IV,OV](Coll[IV],(IV) => OV) => Coll[OV],3,None), SMethod(sigmastate.SCollection$@41bf79da,exists,[IV](Coll[IV],(IV) => SBoolean) => SBoolean,4,None), SMethod(sigmastate.SCollection$@41bf79da,fold,[IV,OV](Coll[IV],OV,(OV,IV) => OV) => OV,5,None), SMethod(sigmastate.SCollection$@41bf79da,forall,[IV](Coll[IV],(IV) => SBoolean) => SBoolean,6,None), SMethod(sigmastate.SCollection$@41bf79da,slice,IV => Coll[IV],7,None), SMethod(sigmastate.SCollection$@41bf79da,filter,[IV](Coll[IV],(IV) => SBoolean) => Coll[IV],8,None), SMethod(sigmastate.SCollection$@41bf79da,append,IV => Coll[IV],9,None), SMethod(sigmastate.SCollection$@41bf79da,apply,IV => IV,10,None), SMethod(sigmastate.SCollection$@41bf79da,<<,IV => Coll[IV],11,None), SMethod(sigmastate.SCollection$@41bf79da,>>,IV => Coll[IV],12,None), SMethod(sigmastate.SCollection$@41bf79da,>>>,(Coll[SBoolean],SInt) => Coll[SBoolean],13,None), SMethod(sigmastate.SCollection$@41bf79da,indices,(Coll[IV]) => Coll[SInt],14,Some()), SMethod(sigmastate.SCollection$@41bf79da,flatMap,[IV,OV](Coll[IV],(IV) => Coll[OV]) => Coll[OV],15,Some()), SMethod(sigmastate.SCollection$@41bf79da,segmentLength,[IV](Coll[IV],(IV) => SBoolean,SInt) => SInt,16,Some()), SMethod(sigmastate.SCollection$@41bf79da,indexWhere,[IV](Coll[IV],(IV) => SBoolean,SInt) => SInt,17,Some()), SMethod(sigmastate.SCollection$@41bf79da,lastIndexWhere,[IV](Coll[IV],(IV) => SBoolean,SInt) => SInt,18,Some()), SMethod(sigmastate.SCollection$@41bf79da,patch,IV => Coll[IV],19,Some()), SMethod(sigmastate.SCollection$@41bf79da,updated,IV => Coll[IV],20,Some()), SMethod(sigmastate.SCollection$@41bf79da,updateMany,IV => Coll[IV],21,Some()), SMethod(sigmastate.SCollection$@41bf79da,unionSets,IV => Coll[IV],22,Some()), SMethod(sigmastate.SCollection$@41bf79da,diff,IV => Coll[IV],23,Some()), SMethod(sigmastate.SCollection$@41bf79da,intersect,IV => Coll[IV],24,Some()), SMethod(sigmastate.SCollection$@41bf79da,prefixLength,[IV](Coll[IV],(IV) => SBoolean) => SInt,25,Some()), SMethod(sigmastate.SCollection$@41bf79da,indexOf,IV => SInt,26,Some()), SMethod(sigmastate.SCollection$@41bf79da,lastIndexOf,IV => SInt,27,Some()), SMethod(sigmastate.SCollection$@41bf79da,find,[IV](Coll[IV],(IV) => SBoolean) => Option[IV],28,Some()), SMethod(sigmastate.SCollection$@41bf79da,zip,IV,OV => Coll[(IV,OV)],29,Some()), SMethod(sigmastate.SCollection$@41bf79da,distinct,IV => Coll[IV],30,Some()), SMethod(sigmastate.SCollection$@41bf79da,startsWith,IV => SBoolean,31,Some()), SMethod(sigmastate.SCollection$@41bf79da,endsWith,IV => SBoolean,32,Some()), SMethod(sigmastate.SCollection$@41bf79da,partition,[IV](Coll[IV],(IV) => SBoolean) => (Coll[IV],Coll[IV]),33,Some()), SMethod(sigmastate.SCollection$@41bf79da,mapReduce,[IV,K,V](Coll[IV],(IV) => (K,V),((V,V)) => V) => Coll[(K,V)],34,Some()))
sigmastate.lang.exceptions.MethodNotFound:
line 3: def Xor(c1: Coll[Byte], c2: Coll[Byte]): Coll[Byte] = c1.zipWith(c2, { (x, y) => x ^ y })

@kushti kushti added this to the Mainnet milestone Mar 7, 2019
@kushti kushti assigned ergomorphic and aslesarenko and unassigned ergomorphic Mar 7, 2019
@aslesarenko aslesarenko removed their assignment May 7, 2019
@aslesarenko aslesarenko added the soft-fork Implementation requires soft-fork label May 7, 2019
@aslesarenko aslesarenko changed the title Finish implementation of zipWith, or abandon the method Finish implementation of zipWith May 7, 2019
@greenhat
Copy link
Member

greenhat commented May 8, 2019

We don't have Coll.zipWith implementation anywhere in the pipeline. There is a lonely parser test to check if it's parsed as Apply term. Nor do we have zipWith planned in https://github.com/ScorexFoundation/sigmastate-interpreter/blob/0bc2c2b1bf2a8f05b38df2f62ac1fa282ee84387/docs/LangSpec.md#L465

@greenhat greenhat removed their assignment Oct 8, 2021
@kushti kushti removed this from the v6.0 milestone Jun 10, 2024
@kushti
Copy link
Member Author

kushti commented Jun 10, 2024

This method will not be implemented (at least for now), see #1004 for reasoning

@kushti kushti closed this as completed Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
soft-fork Implementation requires soft-fork
Projects
None yet
Development

No branches or pull requests

4 participants