Skip to content

Instantly share code, notes, and snippets.

@vznvzn
Created November 24, 2018 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vznvzn/5787db2d7313d4ecba42b590e527a72f to your computer and use it in GitHub Desktop.
Save vznvzn/5787db2d7313d4ecba42b590e527a72f to your computer and use it in GitHub Desktop.
@echo off
if "%1%" == "" (
echo specify [n]
exit /b
)
set n=%1%
set m=26
echo "fsm14 n=%n% m=%m%"
call minlen %n% > nul
set fslice=fstlen%n%b.fst
lenmin %n% > lenmin.txt
set fminlen=lenmin.fst
fstcompile --acceptor=true lenmin.txt %fminlen%
set fpre=pre.fst
set flen=len.fst
uplen %m% > len%m%.txt
fstcompile --acceptor=true len%m%.txt %flen%
fstintersect %fslice% %flen% %fpre%
set fzero=empty.fst
echo. > empty.txt
fstcompile --acceptor=true empty.txt %fzero%
set x=0
set fin=%fminlen%
:re
set /a x = x + 1
echo -- %x%
date /t
time /t
set fcomp=fsmcomp.fst
fstcompose %fpre% fsmb.fst | fstproject --project_output=true > %fcomp%
call fstmin2b %fcomp%
set fand=and.fst
fstintersect %fcomp% %fin% %fand%
call fstmin2b %fand%
copy %fand% %fpre% > nul
fstequivalent %fpre% %fzero%
if %errorlevel% neq 0 goto re
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment