<commit_before>#lang scheme/base

(provide contract?
	 contract-name contract-syntax
	 contract-arbitrary set-contract-arbitrary!
	 contract-info-promise
	 contract-violation
	 contract-violation-proc call-with-contract-violation-proc
	 make-delayed-contract
	 make-call-contract
	 make-property-contract
	 make-predicate-contract
	 make-type-variable-contract
	 make-list-contract
	 make-mixed-contract
	 make-combined-contract
	 make-case-contract
	 make-procedure-contract
	 contract-update-syntax contract-update-info-promise
	 apply-contract apply-contract/blame
	 procedure-contract-info? 
	 procedure-contract-info-arg-contracts procedure-contract-info-return-contract
	 make-lazy-wrap-info lazy-wrap-info-constructor lazy-wrap-info-raw-accessors
	 prop:lazy-wrap lazy-wrap? lazy-wrap-ref
	 make-struct-wrap-contract
	 check-struct-wraps!
	 contract=? contract<=?)

(require scheme/promise
	 mzlib/struct
	 (for-syntax scheme/base)
	 (for-syntax stepper/private/shared))

(require deinprogramm/quickcheck/quickcheck)

(define (contract=? c1 c2)
  (or (eq? c1 c2)
      (eq? (contract-enforcer c1) (contract-enforcer c2))
      (and (contract-=?-proc c1)
	   ((contract-=?-proc c1)
	    (force (contract-info-promise c1)) 
	    (force (contract-info-promise c2))))))

; name may be #f
; enforcer: contract val -> val
; 
; syntax: syntax data from where the contract was defined

(define-struct contract (name enforcer syntax-promise (arbitrary-promise #:mutable) info-promise <=?-proc =?-proc)
  #:constructor-name really-make-contract
  #:transparent ; #### for debugging, remove
  #:property prop:equal+hash
  (list (lambda (c1 c2 equal?) (contract=? c1 c2)) ; #### use equal?
	void void)) ; hash procs
<commit_msg>Fix interaction between new DMdA contract representation and stepper.<commit_after>#lang scheme/base

(provide contract?
	 contract-name contract-syntax
	 contract-arbitrary set-contract-arbitrary!
	 contract-info-promise
	 contract-violation
	 contract-violation-proc call-with-contract-violation-proc
	 make-delayed-contract
	 make-call-contract
	 make-property-contract
	 make-predicate-contract
	 make-type-variable-contract
	 make-list-contract
	 make-mixed-contract
	 make-combined-contract
	 make-case-contract
	 make-procedure-contract
	 contract-update-syntax contract-update-info-promise
	 apply-contract apply-contract/blame
	 procedure-contract-info? 
	 procedure-contract-info-arg-contracts procedure-contract-info-return-contract
	 make-lazy-wrap-info lazy-wrap-info-constructor lazy-wrap-info-raw-accessors
	 prop:lazy-wrap lazy-wrap? lazy-wrap-ref
	 make-struct-wrap-contract
	 check-struct-wraps!
	 contract=? contract<=?)

(require scheme/promise
	 mzlib/struct
	 (for-syntax scheme/base)
	 (for-syntax stepper/private/shared))

(require deinprogramm/quickcheck/quickcheck)

(define (contract=? c1 c2)
  (or (eq? c1 c2)
      (eq? (contract-enforcer c1) (contract-enforcer c2))
      (and (contract-=?-proc c1)
	   ((contract-=?-proc c1)
	    (force (contract-info-promise c1)) 
	    (force (contract-info-promise c2))))))

; name may be #f
; enforcer: contract val -> val
; 
; syntax: syntax data from where the contract was defined

(define-struct contract (name enforcer syntax-promise (arbitrary-promise #:mutable) info-promise <=?-proc =?-proc)
  #:constructor-name really-make-contract
  #:property prop:equal+hash
  (list (lambda (c1 c2 equal?) (contract=? c1 c2)) ; #### use equal?
	(lambda (r recur)
	  (+ (recur (contract-name r))
	     (* 33 (recur (contract-enforcer r)))))
	(lambda (r recur)
	  (+ (* 33 (recur (contract-name r)))
	     (recur (contract-enforcer r)))))
  #:property prop:custom-write
  (lambda (r port write?)
    (cond
     ((contract-name r)
      => (lambda (name)
	   (display "#<contract " port)
	   (display name port)
	   (display "#>" port)))
     (else
      (display "#<contract>" port)))))

{'fraction_non_alphanumeric': 0.1324896694214876, 'fraction_numerical': 0.008264462809917356, 'mean_word_length': 3.9653846153846155, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6949574', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1230, 'n_words': 285}