dcg
Concatting a list of strings in Prolog
I\'m writing a Lisp to C translator and I have a problem with handling strings. This is a code that transforms an unary Lisp function to a C equivalent:[详细]
2023-02-05 12:16 分类:问答Question - formal language in prolog
I am trying to build a DCG which recognizes all lists which match this form : a^n b^2m c^2m d^n开发者_Python百科.[详细]
2023-02-02 21:32 分类:问答Prolog DCGs: Converting from programming notation to logical notation
I\'m trying to convert from this notation: A and (B or C) equ A and B or A and C) to standard logical notation i.e. things like and(A,B), or(A,B), neg(A)...[详细]
2023-02-02 19:56 分类:问答DCG in Prolog — strings
I\'m writing a Lisp-to-C translator using Prolog\'s built-in DCG capabilities. This is how I handle arithmetic:[详细]
2023-01-30 02:19 分类:问答gnu Prolog powerset modification
So i got this for powerset: powerset([], []). powerset([H|T], P) :- powerset(T,P). powerset([H|T], [H|P]) :- powerset(T,P).[详细]
2023-01-24 15:31 分类:问答How to write a square bracket in prolog?
This may sound strange, but it is used in a parser, I want to be able to parse something of the form foo[bar][详细]
2023-01-24 02:50 分类:问答What DCG rules should be added?
okay, so I am using prolog to build a simple xml parser. And I have the following xml file: <ip> <line> 7 </line> <envt> p1:1 in main:1 </envt> </ip>[详细]
2023-01-23 20:15 分类:问答Prolog DCG illustration please
Currently I am playing with DCG in Prolog to parse an XML file. I was able to get the following code snippet which is able to parse a simple XML such as:[详细]
2023-01-23 19:28 分类:问答how to split a sentence in swi-prolog
I am trying my hands on SWI-Prolog in win xp. I am trying to understand how to split a sentence in Prolog into separate atoms.[详细]
2023-01-21 16:28 分类:问答Prolog - formulas in propositional logic
I am trying to make a predicate in order to validate if a given input represents a formula. I am allowed to use only to propositional atoms like p, q, r, s, t, etc.[详细]
2023-01-20 14:07 分类:问答