interactive-lp icon indicating copy to clipboard operation
interactive-lp copied to clipboard

bwd and lists?

Open Cazadorro opened this issue 3 years ago • 0 comments

I looked through the tutorial and it seems incomplete. Looking through the examples (ie garden-small.cep) I guess you can declare new types of a certain kind via

plant_phase : type.
seed : plant_phase.
seedling : plant_phase.
mature : plant_phase.

but I'm confused about syntax like this:

next plant_phase plant_phase : bwd.
next seed seedling.
next seedling mature.

bwd looks to be like its creating a predicate with typing, but I don't understand why this is necessary, shouldn't this also work?

next seed seedling :pred.
next seedling mature :pred.

or is bwd like a forward declaration covering for some sort of language limitation?

I also don't understand $ and its purpose:

get_seeds : $step * harvested Type -o have_seed Type * have_seed Type.

I'm having a hard time finding explanations for this syntax in other parts. Is this part of ML or something? (I'm not familiar with any ML langauges).

I also don't understand what _ is supposed to mean outside the context of starting a program, according to the tutorial it was a standin for "time" or iterations or something, but here

clear : $step * plant Type _ dead -o soil_space.

it just doesn't make sense.

I also don't see what the syntax for lists is supposed to be, nor how numbers.cep works, built-in syntax was not explained, and its hard to tell what is a "type" and what isn't in this example due to order.

#builtin NAT nat.
#builtin NAT_ZERO z.
#builtin NAT_SUCC s.

can we get explanations of these things in the tutorial, even with out indepth examples? I'm not sure how to interpret these things otherwise, and I looked through the pdfs in docs and couldn't find anything more indepth for the syntax.

Cazadorro avatar Jul 23 '21 20:07 Cazadorro