Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ejercicio1[automata_] := Module[{transiciones, aux, i, j, est, alf},
- If[Length[Cases[automata[[3]], {_, {}, _}]] > 0, Return[False];];
- For[i = 1, i <= Length[automata[[1]]], i++,
- est = automata[[1]][[i]];
- For[j = 1, j <= Length[automata[[2]]], j++,
- alf = automata[[2]][[j]];
- transiciones = Cases[automata[[3]], {est, alf, _}];
- If[Length[transiciones] > 1, Return[False]];
- ];
- ];
- Return[True];
- ]
- Ejercicio2[afd_] := Module[{i, simbolos},
- simbolos = Length[afd[[2]]];
- For[i = 1, i <= simbolos + 1, i++,
- Print[Cases[afd[[3]], {afd[[1]][[i]], _, _}]];
- If[Length[Cases[afd[[3]], {afd[[1]][[i]], _, _}]] < simbolos,
- Return[False];
- ];
- ];
- Return[True];
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement