Code Monkey home page Code Monkey logo

Comments (2)

fehrenbach avatar fehrenbach commented on September 13, 2024

I have a Links version of the XPath evaluator from the ICFP'13 paper here:
https://github.com/fehrenbach/links-playground/blob/d5adbef68d720b05ee50d3671e1c61ed81cafc86/xpath.links
which fails for all the examples.

James ran the F# version for me, producing this for xp0:

SELECT [t1].[ID]
FROM [dbo].[Data] AS [t0], [dbo].[Data] AS [t1]
WHERE ([t0].[Parent] = @p0) AND ([t0].[Entry] = @p1) AND (EXISTS(
     SELECT NULL AS [EMPTY]
     FROM [dbo].[Data] AS [t2]
     WHERE ([t0].[Entry] = [t2].[Entry]) AND ([t0].[ID] =  
[t2].[Parent]) AND ([t2].[Entry] = [t1].[Entry]) AND ([t2].[ID] =  
[t1].[Parent])
     ))

Whereas my Links version produces this:

select (t1755."id") as "id"
  from xml as t1754,xml as t1755
 where ((t1752."parent") = (-(1))) -- t1752 is not bound, but t1754 is
   and (exists (select 0 as dummy
                  from xml as t1759
                 where ((t1752."id") = (t1759."parent")) and ((t1759."id") = (t1755."parent"))))

where t1749 is not bound and t1751 is not used.

There is some stuff about "Entry"s in the F# version, presumably it uses a slightly different schema.

from links.

jamescheney avatar jamescheney commented on September 13, 2024

Yes, the "entry" field is just an additional value to allow us to store multiple trees one table. This shouldn't matter, from the point of the apparent problem with the Links version, though.

The query in the initial comment looks like it should work to me; in general, any purely conjunctive/SQL-like query ought to work and anything that doesn't ought to yield a type error.

from links.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.