Re: modelling a deterministic finite automata

From: Lex Spoon (lex_at_cc.gatech.edu)
Date: 03/16/04


Date: Tue, 16 Mar 2004 16:50:43 -0500

Christian Heinze <171179@web.de> writes:
> This concrete example accepts the language (ab)*. However, this
> interpreter, simple as it is, accepts any non-deterministic
> automaton. I am allowed to specify several delta/3-rules, where on the
> receipt of a symbol X in state Q it is not determined with state would
> come next, e.g.:
>
> delta(q0,a,q2).
> delta(q0,a,q3).
>
> I'd like to limit the interpreter to the acceptance of deterministic
> state machines only.

I like your code, myself, and would simply write the delta's in order
so that you can visually scan and see if there are non-determinisms.

But something like this would seem to work:

    nondeterministic :- delta(Q1, A, Q2),
                        delta(Q1, A, Q3),
                        Q2 /= Q3 .

    deterministic :- not nondeterministic .

I don't know whether Prolog allows you to write "not
nondeterministic", but even if i doesn't you can use
"nondeterministic" and mentally reverse the result.

-Lex



Relevant Pages

  • Re: Why Ive returned
    ... It was a parody of an absurd idea. ... not have the C language required to major at Kernighan's Princeton, ... Kernighan and John Hennessy, the RISC computer architect, rejected the ... the firmware interpreter for 1401 code on the old IBM 360 mainframe, ...
    (comp.programming)
  • Re: Mathematical ASL?
    ... You can imagine when I was interpreting for computer science classes, and the professor said "UNIX", and my non-computer-literate interpreter colleague signed "eunuchs". ... Teachers may need to make clear that they are using word in a technical sense for both their hearing and deaf students. ... Sign language can represent italics or "quotes" during conversation in ways spoken langauge cannot, ... If you say "the difference between a series and a sequence is X", and the same sign is used for both series and sequence (as they are in non-technical ASL), the interpreter will easily be able to create that distinction for the students whether or not s/he knows the math signs, and maintain the distinction going forward. ...
    (sci.math)
  • Re: OFF-TOPIC:: Why Lisp is not my favorite programming language
    ... The interpreter would be written in C. ... It is always possible to beat any interpreted language for speed using ... >at me for calling lisp a parsing language... ... I would write a parser to do so. ...
    (comp.lang.python)
  • Re: Which Is The Better Approach To Working With Javascript?
    ... Java SCRIPT runs in the browser exclusively. ... No language is written just for a single environment. ... You have to understand that I come from a hardware background, a huge area that is complately unknown to most 'computer programmers' whose life begins and ends with an interpreter or compiler.. ...
    (comp.lang.php)
  • Rexx and Security
    ... I surmise from the text that the thought is that simply having an interpretive / scripting language installed in computers is dangerous as someone might develop an evil script / program with that tool. ... I would conclude that the only secure computing model in the opinions of the writers is that of the Linux / Unix environment which has the execute bit in the filesystem, and that the only programs allowed to be installed are statically compiled C/C++ programs. ... Requiring the interpreter to only interpret source files with the execute bit set is an option that comes to my mind... ...
    (comp.lang.rexx)