문제

멈추는 문제는 그 멈추지 않는 문제가 있음을 주장합니다.그리고 그것이 그것이 실제로 사소한 것임을 증명하는 것입니다.

그러나 임의의 프로그램에만 적용됩니다.

는 일반적으로 인간의 수업에 관한 연구가 있었습니까?

때로는 프로그램을 분석하고 모든 자유도를 열거하고 정지 할 것으로 결론을 내릴 수 있습니다.

예를 들어, 중단을 보장하는 프로그래밍 언어 (스크립팅 정말)를 만들기위한 노력이 있었습니까?그것은 널리 적용되지는 않지만 미션 크리티컬 모듈에 여전히 유용 할 수 있습니다.

도움이 되었습니까?

해결책

halt가 보장되는 언어는 넓은 확산 사용을 보았습니다. Coq / AGDA / IDRI와 같은 언어는 모두이 범주에 있습니다. 많은 많은 유형의 시스템이 실제로 시스템 F 또는 예를 들어 변형을 중단하도록 보장됩니다. 유형 시스템의 건전성이 모든 프로그램이 정규화되었음을 증명하기 위해 끓일 수 있습니다. 강력한 정규화는 일반적으로 프로그래밍 언어 연구에서 매우 바람직한 재산입니다.

실제로 무한한 루프를 잡는 데 많은 성공을 보지 못했습니다. 그러나 Telford와 Turner의 ESFP의 종료를 보장하는 것은 Euclid의 알고리즘이 항상 종료되고 부분적인 사례를 처리하는 것을 증명할 수 있었던보다 강력한 종료 검사기를 보여줍니다. 유클리드의 알고리즘은 원시적 재귀 적으로 똑바로 존재할 수없는 원시적 인 재귀 함수의 유명한 까다로운 예입니다. 그것은 단순히 감소 된 매개 변수 (또는 태아 종단 검사기와 같은 감소 매개 변수가 감소하는 단순한 패턴)를 간단히 찾는 체커가 실패합니다. 원시적 재귀 조합기를 사용 하여이 작업을 구현하려면 알고리즘에 대한 종료 증빙 증명을 필수적으로 함수의 매개 변수로 인코딩해야합니다.

나는 내 머리 꼭대기에서의 절차 언어에 대한 결과를 생각할 수 없으며, 기능적 언어의 대부분의 결과는 더 많은 복잡한 분석을 수행하려는 것이 아니라 복잡한 분석을 수행하려고하는 것보다 분명히 종결되는 일종의 제한을 사용합니다. 자연 프로그램이 종료됩니다.

다른 팁

Microsoft has developed a practical code checker (whose name escapes me at the moment) which performs halt-testing. It exploits the fact that the code it checks is human-written and not arbitrary, just as you suggest. More importantly, it bypasses the impossibility proof by being allowed to return the answer 'Cannot decide' if it runs into code too difficult to check.

There are only 2 types of infinite programs:

  1. Those that repeat their own state after a point (cyclical)
  2. Those that grow indefinitely in used memory

Those in 1st type, follow this pattern:

enter image description here

Where there is a pair of distinct indices i and j such that xi = xj, and after which the cycle repeats itself again (thanks to the deterministic nature of programs). In this case the inputs x, contain the whole memory and variables used by the algorithm, plus the current instruction pointer.

Cycle detection algorithms work very well in practice for this type and can prove that a given cyclical program will never finish, usually after a small number of steps, for most random programs.

Proving those in the 2nd type is where the challenge is. One could argue that type 2 can never exist in reality (as all computers have finite memory) but that is not very useful in practice because the memory used may grow very slowly for a regular computer to ever be full. A simple example of that is a binary counter that never stops and never repeats its full state completely.

There is a huge class of functions that are trivially guaranteed to halt: Everything with a finite number of loops, with an upper limit for the number of iterations for each loop determined before the loop is started.

If you have a random program, it can be difficult to prove whether or not it halts. Programs that are written for a purpose are usually much easier.

The smart contracts functions in the Ethereum blockchain are an example of a system that needs the guarantee of halting, not to stall the whole chain.

Every function has a gas cost, and the gas cost translates into real Ethereum coins. A transaction fee must be paid to call the contract. If the gas used in the contract exceed the gas paid with the transaction fee, the computation terminates immediately.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 cs.stackexchange
scroll top