rodrigogribeiro
2017-8-16 23:06:15

Hi @leafac! I’m trying to formalize typed arithmetic expressions from types and programming languages book.


rodrigogribeiro
2017-8-16 23:06:50

rodrigogribeiro
2017-8-16 23:07:37

My problem is on improve the test coverage from progress and preservation properties


rodrigogribeiro
2017-8-16 23:08:14

Currently, all my tries doesn’t trigger any evaluation rules.


rodrigogribeiro
2017-8-16 23:08:44

I had used the same function for coverage stats from the amb tutorial


rodrigogribeiro
2017-8-16 23:09:11

and also I had tried to use #:satisfying clause to test progress and preservation only on well typed terms


rodrigogribeiro
2017-8-16 23:10:06

If anyone could provide me any clue on how could I improve such coverage or what mistake I’m doing, it would be great


leafac
2017-8-16 23:31:41

Something strikes me as weird in line 118: https://gist.github.com/rodrigogribeiro/e0fd3e1e3ff017b614dcfeee9f9154e0#file-tyexp-rkt-L118 Why the extra parentheses around e? It causes the following strange behavior: > (apply-reduction-relation red (term zero)) '() > (reduces? (term zero)) . . reduction-relation: relation not defined for (zero)


leafac
2017-8-16 23:33:48

I’d expect that reduces? would fail only iff apply-reduction-relation failed for any given term.


leafac
2017-8-16 23:34:33

I tried removing the parentheses and got something that looks better:

> (apply-reduction-relation red (term zero))
'()
> (reduces? (term zero))
#f

leafac
2017-8-16 23:35:23

I don’t think this fully explains your problem. But maybe it’s a start?