Commits

Anonymous committed d8bf318

length-with-literal take f18a param

Comments (0)

Files changed (2)

machine/cegis.rkt

 (provide estimate-time program-length perf-mode)
 (provide z3 read-sexps)
 
-(define debug #t)
+(define debug #f)
 (define demo #t)
 (define current-step 0) ; the number of the current cegis step
 (define current-run 0)  ; the number of the current call to cegis.
 
 (define comm-length 1)
 (define all-pairs '())
-(define timeout 3000) ;600
+(define timeout 3000) ;3000
 
 (define (initialize)
   (system "mkdir debug")

machine/programs.rkt

 #lang racket
 ;;; Some useful functions for working with programs.
 
-(require rackunit)
+(require rackunit
+	 "../ArrayForth/compiler.rkt")
 
 (provide (all-defined-out))
 
                              (filter (lambda (x) (vector-member x choice-id))
                                      (map string->symbol (program->instructions program)))))))
 
-(define (length-with-literal program)
+(define (length-with-literal program #:f18a [f18a #t])
+  (unless f18a
+	  (set! program (compile-to-string program)))
   (define inst-list (drop-trailing-nops (string-split program)))
   (define total (length inst-list))
   (define count-@p (count (lambda (x) (or (equal? x "@p") (equal? x `@p)))
   (when (string? program)
         (set! program (string-split program)))
   (string-join (nop-last-slot (nop-before-plus program) 0)))
-      
+