core.logic

A conde clause that beings with a fresh expression will initially fail

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    tested against HEAD (0.8.0-rc3-SNAPSHOT) and CLJ 1.5.0-RC15

Description

(ns test                                                                                                                                                                          
  (:refer-clojure :exclude [==])                                                                                                                                                  
  (:require                                                                                                                                                                       
   [clojure.core.logic :refer :all]))                                                                                                                                             

;; This expression should evaluate to true, but it does not, 
;; because the second run* returns (2 1) instead of (1 2).
                                                                                                                                                                                  
(= (run* [q]                                                                                                                                                                      
     (conde                                                                                                                                                                       
       [(== q 1)]                                                                                                                                                                 
       [(== q 2)]))                                                                                                                                                               
   (run* [q]                                                                                                                                                                      
     (conde                                                                                                                                                                       
       [(fresh [a] (== q 1))]                                                                                                                                                     
       [(== q 2)])))

Activity

David Nolen made changes -
Field Original Value New Value
Description (ns test
  (:refer-clojure :exclude [==])
  (:require
   [clojure.core.logic :refer :all]))

;; This expression should evaluate to true, but it does not,
;; because the second run* returns (2 1) instead of (1 2).
                                                                                                                                                                                  
(= (run* [q]
     (conde
       [(== q 1)]
       [(== q 2)]))
   (run* [q]
     (conde
       [(fresh [a] (== q 1))]
       [(== q 2)])))
{code}
(ns test
  (:refer-clojure :exclude [==])
  (:require
   [clojure.core.logic :refer :all]))

;; This expression should evaluate to true, but it does not,
;; because the second run* returns (2 1) instead of (1 2).
                                                                                                                                                                                  
(= (run* [q]
     (conde
       [(== q 1)]
       [(== q 2)]))
   (run* [q]
     (conde
       [(fresh [a] (== q 1))]
       [(== q 2)])))
{code}
David Nolen made changes -
Resolution Declined [ 2 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: