Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

build open-axiom

54512 views

((*
  ((S #1=(|Integer|) S)
   ((|RepeatedDoubling| S) (|double| S (|PositiveInteger|) S))
   (#2=(|Integer|) (|zero?| #3=(|Boolean|) #2#) (|positive?| #3# #2#)
    (- #2# #2#))
   (|locals| (#:G541 . #3#) (#:G540 . #3#)) (|arguments| (|x| . S) (|n| . #1#))
   (S (|Zero| S) (- . #4=(S S))))
  ((S #5=(|NonNegativeInteger|) S) (|arguments| (|x| . S) (|n| . #5#))
   (S (* S (|Integer|) S))))
 (- ((S S S) (|arguments| (|y| . S) (|x| . S)) (S (- . #4#) (+ S S S))))
 (|opposite?|
  (((|Boolean|) S S) (|arguments| (|y| . S) (|x| . S))
   (S (= (|Boolean|) S S) (- . #4#))))
 (|subtractIfCan|
  ((#6=(|Maybe| S) S S) (#6# (|just| #6# S)) (|arguments| (|y| . S) (|x| . S))
   (S (- S S S)))))