Find Jobs
Hire Freelancers

Type 0 Grammar

$10-30 USD

종료됨
게시됨 6년 이상 전

$10-30 USD

제출할때 지불됩니다
Define a type 0 grammar that simulates a Turing Machine computation to accept the language (w w | w ∊ (0 + 1)*} The calculation can be done in three stages: For example, on input 10111011 Stage 1: Place an end marker at each end of the string: $10111011$ Stage 2: Move the end markers inward till they meet in the middle and mark the middle: 1011x1011 Stage 3: Go back and forth matching and crossing off symbols of the two strings. See the example grammar that accepts palindromes. To use the Python program: step 1: Click Rules and load a grammar rules file. Step 2: Click Run to initialize and run the simulation. When the program is paused, the step button can be used to run one step at a time. The simulation ends when no applicable re-writing rule is found. If at the end of the calculation the string contains non-terminals (capital letters), the input is rejected. If there are no uppercase letters the string is accepted. (Note, this is not exactly true. I took the quick approach and just checked islower() on the string. This returns true if there are no uppercase letters AND the string contains at least one lower case letter, so a string of all special characters will not be accepted). Notes about the program: The underscore _ is used to represent a blank. At startup, the input string has the start symbol placed at the beginning and the resulting string is padded with a blank at each end. The grammar rules file contains rules of the form: left-side → right-side The program actually just splits each line on white space and uses the first string as the left side and the last string on the line as the right side, so the arrow is not really needed. If a line contains just a single letter, that letter will be interpreted as the start symbol, otherwise the start symbol is S. You do not need to close and re-start the program to change rules. You can just select a new rules file and enter a new input string. Included are some example grammars: [login to view URL] Copies an input string, alphabet = {0, 1} [login to view URL] Accepts balanced (), alphabet = {(, )} [login to view URL] Mark string center, alphabet = {0, 1} [login to view URL] Accepts palindromes, alphabet = {0, 1} [login to view URL] Accepts anb nc n, alphabet = {a, b, c} The project grammar can first work like [login to view URL], then use a similar technique to [login to view URL] to check matching characters, but will scan both strings left to right, like [login to view URL] The program is a WIP and so is not as well organized as I would like, but it will do for the purpose of checking the project.
프로젝트 ID: 15894070

프로젝트 정보

2 제안서
원격근무 프로젝트
활동 중 6년 전

돈을 좀 벌 생각이십니까?

프리랜서 입찰의 이점

예산 및 기간 설정
작업 결과에 대한 급여 수급
제안의 개요를 자세히 쓰세요
무료로 프로젝트에 신청하고 입찰할 수 있습니다
2 이 프로젝트에 프리랜서들의 평균 입찰은 $49 USD입니다.
사용자 아바타
A proposal has not yet been provided
$27 USD 1일에
4.8 (2 건의 리뷰)
1.4
1.4

고객에 대한 정보

국기 (UNITED STATES)
United States
0.0
0
12월 17, 2017부터 회원입니다

고객 확인

감사합니다! 무료 크레딧을 신청할 수 있는 링크를 이메일로 보내드렸습니다.
이메일을 보내는 동안 문제가 발생했습니다. 다시 시도해 주세요.
등록 사용자 전체 등록 건수(일자리)
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
미리 보기 화면을 준비 중...
위치 정보 관련 접근권이 허용되었습니다.
고객님의 로그인 세션이 만료되어, 자동으로 로그아웃 처리가 되었습니다. 다시 로그인하여 주십시오.