anoma / geb

A Categorical View of Computation
https://anoma.github.io/geb/
GNU General Public License v3.0
28 stars 10 forks source link

Introduce Compilation Through Maybe Monad #163

Closed agureev closed 1 year ago

agureev commented 1 year ago

Assuming 24-bit integer inputs as well as a reduced Lambda term, improves the compiler for Lambda objects with error terms by wrapping the compilation in an actual Maybe monad rather than a recursive one.

mariari commented 1 year ago

@agureev the tests do not seem to pass.

;; Failures:
   3/  13 tests failed in GEB-TEST::GEB-TEST-SUITE
   1/  14 tests failed in GEB-TEST::GEB.LAMBDA
   3/   3 tests failed in GEB-TEST::APP-TEST
The test form   (type-of-term () (app lamb-term (list pair-of-units-term)))
evaluated to    [no-applicable-method-exists] There is no applicable method for the generic function:
  #<standard-generic-function geb.utils:mcadr #x3020024C3B2F>
when called with arguments:
  (nil)
when            s-1
was expected to be equal under OBJ-EQUALP.
type of function application term

The test form   (type-of-term () (fun (annotated-term () app-term)))
evaluated to    [no-applicable-method-exists] There is no applicable method for the generic function:
  #<standard-generic-function geb.utils:mcadr #x3020024C3B2F>
when called with arguments:
  (nil)
when            s-1
was expected to be equal under OBJ-EQUALP.
test annotated fun term

The test form   (type-of-term () (car (term (annotated-term () app-term))))
evaluated to    [no-applicable-method-exists] There is no applicable method for the generic function:
  #<standard-generic-function geb.utils:mcadr #x3020024C3B2F>
when called with arguments:
  (nil)
when            (× s-1 s-1)
was expected to be equal under OBJ-EQUALP.

   1/   1 tests failed in GEB-TEST::GEB-PIPELINE
   1/   2 tests failed in GEB-TEST::PIPELINE-WORKS-FOR-STLC-TO-VAMPIR
The test form   (finish (compile-down :stlc t :entry "geb-test::*entry*"))
exited by       [simple-error] not a well-defined #<app #x30200862608D> in said nil

   2/   4 tests failed in GEB-TEST::GEB.LAMBDA.TRANS
   1/   1 tests failed in GEB-TEST::ISSUE-94-COMPILES
The test form   (finish (compile-down :stlc t :entry "geb-test::*issue-94-circuit*" :stream ()))
exited by       [simple-error] not a well-defined #<app #x3020086058DD> in said nil

   1/   6 tests failed in GEB-TEST::LAMBDA.TRANS-EVAL
   1/   5 tests failed in GEB-TEST::ERROR-HANDLING-CASE
The test form   (gapply (to-cat (list (coprod so1 so1)) context-dependent-case) (list (right (left (right so1))) so1))
evaluated to    (right s-1)
when            (left s-1)
was expected to be equal under OBJ-EQUALP.

is what I get back

mariari commented 1 year ago

I assume another topic has to be in it for it to work?