From: Markus Triska Date: Mon, 30 Mar 2020 23:28:16 +0000 (+0200) Subject: introduce and use nonterminal list//1 X-Git-Tag: v0.8.119~16^2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=11a616917af37e485d466144733ccf6760c5e192;p=scryer-prolog.git introduce and use nonterminal list//1 Example: ?- phrase(list(Ls), Ls0). Ls = [], Ls0 = [] ; Ls = [_A], Ls0 = [_A] ; Ls = [_A,_B], Ls0 = [_A,_B] ; Ls = [_A,_B,_C], Ls0 = [_A,_B,_C] ; ... --- diff --git a/src/prolog/examples/bimetatrans_ruleml.pl b/src/prolog/examples/bimetatrans_ruleml.pl index 7c0028d5..ea56c2e2 100644 --- a/src/prolog/examples/bimetatrans_ruleml.pl +++ b/src/prolog/examples/bimetatrans_ruleml.pl @@ -283,10 +283,13 @@ sign('+') --> "+". double_quote('"') --> "\"". -list_ws(String) --> - partial_string(String), +list_ws(Ls) --> + list(Ls), ws. +list([]) --> []. +list([L|Ls]) --> [L], list(Ls). + /* * ruleml_assert_item//1 specifies the elements of RuleML that may * appear as items in a RuleML Assert performative, an implicitly