Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCG doesn't produce the same result as difference list. #338

Open
boblund opened this issue Dec 16, 2022 · 2 comments
Open

DCG doesn't produce the same result as difference list. #338

boblund opened this issue Dec 16, 2022 · 2 comments
Assignees
Labels
dcg Issues related to Definite Clause Grammars

Comments

@boblund
Copy link

boblund commented Dec 16, 2022

The following DCG:
subject --> modifier, noun.

modifier --> [the].

noun --> [cat].
noun --> [mouse].

when queried with:
subject(X,[]).

produces:
X = [the|_5]
X = [the|_5]

Whereas:
subject(L1, L3) :- modifier(L1, L2), noun(L2, L3).

modifier([the|X], X).

noun([cat|X], X).
noun([mouse|X], X).

produces the following with the same query:
X = [the,cat]
X = [the,mouse]

@jariazavalverde jariazavalverde self-assigned this Dec 18, 2022
@jariazavalverde jariazavalverde added the dcg Issues related to Definite Clause Grammars label Dec 18, 2022
@jariazavalverde
Copy link
Collaborator

Hi. Are you using the latest version of Tau Prolog?

@boblund
Copy link
Author

boblund commented Dec 18, 2022

Hi,

I'm using "version": "0.3.4".

boblund

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dcg Issues related to Definite Clause Grammars
Projects
None yet
Development

No branches or pull requests

2 participants