fixes pr1
This is a potentially weird case and decision on what to do about it. In general, when we print out answers, we try to make sure that they look like valid datalog. In this case, a Racket value is being used a Datalog constant (which is legal and part of the #lang datalog embedding), so we can't know what syntax was used to get it in the first place... so by using a ~v we get a distinctive printing that shows it isn't datalog. On the other hand, I could change #lang datalog so that it's environment is empty and this program wouldn't be referring to '()
This commit is contained in:
parent
437a53717c
commit
84a3b742ae
|
@ -14,7 +14,9 @@
|
|||
[(? string? s)
|
||||
(text (format "~S" s))]
|
||||
[(? number? s)
|
||||
(text (format "~S" s))]))
|
||||
(text (format "~S" s))]
|
||||
[x
|
||||
(text (format "~v" x))]))
|
||||
(define (format-variable v)
|
||||
(format-datum (variable-sym v)))
|
||||
(define (format-constant c)
|
||||
|
|
16
tests/pr/1.rkt
Normal file
16
tests/pr/1.rkt
Normal file
|
@ -0,0 +1,16 @@
|
|||
#lang datalog
|
||||
|
||||
type(z, tz).
|
||||
|
||||
listof(tz, ez).
|
||||
|
||||
int(ez).
|
||||
|
||||
casepair(z, za, tza, zb, tzb).
|
||||
|
||||
pair(TA, TE, null) :-
|
||||
casepair(V, VA, TA, VB, TB),
|
||||
type(V, TV),
|
||||
listof(TV, TE).
|
||||
|
||||
pair(A, B, C)?
|
Loading…
Reference in New Issue
Block a user