I read the tutorial online (rems-project.github.io/cn-tutorial) and used the exercises.zip file linked there (../getting-started/tutorials), consulting the solutions in src/examples of this repo (which I had to find independently of the online tutorial).
Installation
Basic usage
Pointers and simple ownership
Ownership of compound objects
Arrays and loops
Defining predicates
Allocating and deallocating memory
Lists
Working with external lemmas
Imperative queues
Doubly-linked lists
Airport simulation
I read the tutorial online (rems-project.github.io/cn-tutorial) and used the
exercises.zipfile linked there (../getting-started/tutorials), consulting the solutions in src/examples of this repo (which I had to find independently of the online tutorial).Installation
Basic usage
Pointers and simple ownership
v1should bePBlock"has no meaningful output" but in CN we still writetake X = Block<T>(x)which can be confusing; perhaps clarify thatXis unconstrained or such?Ownership of compound objects
cn verify exercises/transpose2.cgives:exercises/transpose2.c:19:9: error: Pointer
pneeds allocation ID...
(UB missing short message): UB_CERB004_unspecified__pointer_add
The "needs allocation ID" error message is different than the usual "Missing resource" error we see earlier in the tutorial, and I don't see allocation IDs explained in the tutorial. I'm also wondering what the last line (with "UB missing short message") means?
Arrays and loops
array_shiftkeywordQ" to "quantifiedQ" or "(universally) quantified variableQ" or sucharray_load.broken.cprecondition description, "between0andn" should be "between0andn - 1"extractkeywordadd_two_array.c, emphasize the need to assumei != j...split_case i == jis needed and why (perhaps unrelated to the tutorial itself: can the "Out of bounds" error message be improved when thei != jassumption is omitted?)Defining predicates
ptr_eqkeywordAllocating and deallocating memory
src/examples/slf_ref_greater.csrc/exercises/slf_ref_greater.csolution should haveP < RnotP <= RLists
is_nullkeywordexercises/slf_length_acc.cneeds no additional annotation (?)Working with external lemmas
exercises/slf_sized_stack.cdoes not seem to need toapplyany external lemmasOmittingThe problem was using Z3 version 4.8.12: updating it to 4.8.14 (as recommended by the installation instructions for CN) fixed this./*@ unfold Length(...); @*/frompush,pop, ortopin the solution yields an uncaught exception (might want to make this its own issue in the CN repo)Imperative queues
C.nextshould beF.nextaddr_eqkeywordaddr_eqcould use some explanationQueuePTR" should be "part ofQueuePtr_At"push.cexample works without anyreturn. It is thepop.cexample where thereturns cannot be factored out (though it looks like there is a "unified" solution refactoring the code for onereturn)applykeywordalloc_idkeywordalloc_idcould use some explanationsnocin the main text should beSnocto agree with the code listingsInqQueueFBshould beQueueFBInqQueueAuxshould beQueueAuxsrc/examples/queue/pop_unified.c)?pop.cusingalloc_idseems not to have any effectDoubly-linked lists
Imperative Queues" doesn't need to be in code font"Dll data structure itself""DlList data structure itself": add code font to DllAirport simulation
Constantssection above": which section?Constantsdoesn't need code font