This file is indexed.

/usr/share/racket/pkgs/datalog/serialize.rkt is in racket-common 6.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#lang racket/base
(require racket/contract
         racket/match
         racket/list
         "runtime.rkt"
         "ast.rkt")

(define remove-paths
  (match-lambda
    [(? hash? ht)
     (for/hash ([(k v) (in-hash ht)])
       (values k (remove-paths v)))]
    [(? cons? c)
     (cons (remove-paths (car c))
           (remove-paths (cdr c)))]
    [(? prefab-struct-key s)
     (apply make-prefab-struct
            (prefab-struct-key s)
            (remove-paths (rest (vector->list (struct->vector s)))))]
    [(? path? s)
     #f]
    [x x]))

(define (write-theory t)
  (write (remove-paths t)))

(define (hash->hash! ht)
  (define ht! (make-hash))
  (for ([(k v) (in-hash ht)])
    (hash-set! ht! k v))
  ht!)

(define (read-theory)
  (hash->hash! (read)))

(provide/contract
 [write-theory (-> theory/c void)]
 [read-theory (-> theory/c)])