next up previous contents
Next: TRALE-EXTENSION:BNF for TRALE Up: ale_trale_man Previous: Warning Messages   Contents

BNF for ALE

  <desc> ::= <type>
           | <variable>
           | (<feature>:<desc>)
           | (<desc>,<desc>)
           | (<desc>;<desc>)
           | @ <macro_spec>
           | <func_spec>
           | a_ <prolog_term>
           | <path> == <path>
           | =\= <desc>

  <type> ::= <prolog_functor>

  <feature> ::= <prolog_atom>

  <path> ::= list(<feature>)

  <macro_def> ::= <macro_head> macro <desc>.

  <macro_head> ::= <macro_name>
                 | <macro_name>(<seq(var)>)

  <macro_spec> ::= <macro_name>
                 | <macro_name>(<seq(desc)>)

  <func_def> ::= <func_spec> +++> <desc>.

  <func_spec> ::= <func_name>
                 | <func_name>(<seq(desc)>)

  <clause> ::= <literal> if <goal>.

  <literal> ::=  <pred_sym>
              |  <pred_sym>(<seq(desc)>)

  <cut_free_goal> ::= true
                    | <literal>
                    | prolog(<prolog_goal>)
                    | (<cut_free_goal>,<cut_free_goal>)
                    | (<cut_free_goal>;<cut_free_goal>)
                    | (<desc> =@ <desc>)
                    | (<cut_free_goal> -> <cut_free_goal>)
                    | (<cut_free_goal> -> <cut_free_goal> 
                                        ; <cut_free_goal>)
                    | (\+ <cut_free_goal>)

  <goal> ::= true
           | <literal>
           | prolog(<prolog_goal>)
           | (<goal>,<goal>)
           | (<goal>;<goal>)
           | (<desc> =@ <desc>)
           | (<cut_free_goal> -> <goal>)
           | (<cut_free_goal> -> <goal> ; <goal>)
           | !
           | (\+ <goal>)
           | when(<cond>,<goal>)

  <cond> ::= <variable>^(<cond>)
           | <quantified_cond>

  <quantified_cond> ::= <quantified_cond>, <quanitifed_cond>
                      | <quantified_cond> ;<quanitifed_cond>
                      | <variable>=<cond_desc>

  <cond_desc> ::= <variable>
                | <type>
                | max(<type>)
                | <feat>:<cond_desc>
                | <path> == <path>
                | <cond_desc>, <cond_desc>
                | <cond_desc> ;<cond_desc>

  <lex_entry> ::=  <word> ---> <desc>.

  <rule> ::=  <rule_name> rule <desc> ===> <rule_body>.

  <rule_body> ::=  <sem_less_rule_body>
                |  <sem_less_rule_body>,<sem_rule_body>,
                   <sem_less_rule_body>

  <sem_less_rule_body> ::= <rule_clause>
                         | <rule_clause>, <sem_less_rule_body>

  <rule_clause> ::=  cat> <desc>
                  |  cats> <desc>
                  |  goal> <goal>

  <sem_rule_body> ::= sem_head> <desc>
                    | sem_goal> <goal>, sem_head> <desc>
                    | sem_head> <desc>, sem_goal> <goal>
                    | sem_goal> <goal>, sem_head> <desc>, 
                      sem_goal> <goal>

  <lex_rule> ::= <lex_rule_name> lex_rule <lex_rewrite>
                                 morphs <morphs>.
  <lex_rewrite> ::= <desc> **> <desc>
                  | <desc> **> <desc> if <goal>

  <morphs> ::= <morph>
             | <morph>, <morphs>

  <morph> ::= (<string_pattern>) becomes (<string_pattern>)
            | (<string_pattern>) becomes (<string_pattern>)
                                 when <prolog_goal>

  <string_pattern> ::= <atomic_string_pattern>
                     | <atomic_string_pattern>, <string_pattern>

  <atomic_string_pattern> ::=  <atom>
                            |  <var>
                            |  <list(<var_char>)>
  <var_char> ::= <char>
               | <var>

  <seq(X)> ::= <X>
             | <X>, <seq(X)>

  <empty_prod> ::= empty <desc>.

  <type_spec> ::= <type> sub <list(<type>)>
                | <type> sub <list(<type>)>
                         intro <list(<frestr_spec>)>
                | <type> intro <list(<frestr_spec>)>

  <frestr_spec> ::= <feature>:<type>
                  | <feature>: a_ <prolog_term>

  <cons_spec> ::= <type> cons <desc>
                | <type> cons <desc>
                         goal <goal>

  <ext_spec> ::= ext(list(<type>))

  <prog> ::= <prog_line>
           | <prog_line> <prog>
  <prog_line> ::= <type_spec>
                | <ext_spec>
                | <cons_spec>
                | <macro_def>
                | <empty_prod>
                | <clause>
                | <rule>
                | <lex_entry>
                | <lex_rule>



Subsections

TRALE User's Manual