There is a slight continuation error in the client file Program.cs while taking input, so after you press option "1", and give your input, you will get your answer. However to try out a new sample, please exit and restart the program again! Did not have time to fix this :)
Download the repo and open "prose.soln" in Visual Studio 2017. The folder "ProseTutorial" contains my grammar, semantics and witness function code files.
Code repository containing my assignment content for the RF task on PROSE.
Your goal is to take a list of positive integers and check if you can operate on them to get a desired value. The only operators you have are Add, Multiply, Divide and ElementAt. Also, we do not care if all the numbers in the list are used or not; and a number can be used multiple times as well. As an example, say you have {[1, 2, 3, 4], 7} then your output can consists of programs like :
- Add(Element(2), Mul(Element(1), Element(1))
- Add(Element(2), Element(3)) You need to design a DSL for this, write the Semantics and Witness functions.
Select one of the options:
- 1 - provide new example
- 3 - exit
- Please follow the format given as {[1, 2, 3, 4], 7} including exact whitespaces.
- Since our goal above is to just produce the programs that lead to that desired value, in the above menu option 1 is sufficient to provide top Programs.
- If program list is empty, we conclude that the desired value using the given operations is not possible.
- Since need for ranking of programs wasn't specified, in the Ranking Score file, only 1 was returned everywhere.
- Top 50 programs are returned, however this can be changed in Program.Cs.
- There are some places where I've reduced the input space, this might not be needed apart from efficiency purposes.