Initial modifications for array inference

Summary: Made initial modifications to typing algorithm to build array typing structure to gather information about arrays during typing. Created Array_typer to begin inferring arrays. Note that the inferencing is extreme naive and also incorrect, but I need feedback on what I'm doing incorrectly in OCaml and naming.

Test Plan: Tested on sample php files using pretty printer.

Reviewers: julienv, pad

Differential Revision: https://phabricator.fb.com/D505066

Task ID: 1146337
xLess incorrect array inferencing

Summary: Added a more intelligent method for inferring the containers correcponding to an array. Made many minor refactoring changes.

Test Plan: Print statements, in the process of making tests to new code

Reviewers: julienv

Differential Revision: https://phabricator.fb.com/D508736

Task ID: 1146337
Array guessing tool

Summary: Added more evidence to assist in guessing each array, as well as corrected the definition of a tuple. Evidence used now includes bracket access of an array ($arr[]), array declaration types, the types of values added to the array, and the types of the keys of the array.

Test Plan: Added unit tests in unit_array_inference_php.ml, but need to flush out and add more.

Reviewers: julienv, pad

CC:

Task ID: #1146337

Blame Rev:
Array guessing tool

Summary: Added more evidence to guess the container corresponding to each array, and fixed the definition of a tuple. Evidence now includes empty bracket accesses ($arr[]), key types, value types, and array declaration types.

Test Plan: Tests in unit_array_inferencer_php.ml, but needed to be flushed out.

Reviewers: julienv, pad

Differential Revision: https://phabricator.fb.com/D522367

Task ID: 1146337

made changes requested by pad
Added patches for return value and array declaration

Summary: Prompts to patch all cases where arrays are the return value of a function or anywhere an array is declared

Test Plan: In process of writing

Reviewers: julienv

Differential Revision: https://phabricator.fb.com/D529707

Task ID: 1146337
Fixed bugs with return value patch and added parameter patch

Summary: Fixed return value patch such that if the return value is an array, the correct container is suggested as the return value. Added patch to fix the type of a parameter to be a container as needed.

Test Plan: WRiting unit tests

Reviewers: julienv

Differential Revision: https://phabricator.fb.com/D531674

Task ID: 1146337
Cleaned up user experience for patching arrays

Summary: Added appropriate tabbing etc in order to make patching process easier to follow. Also added a prompt to ask if the evidence should be displayed instead of displaying all evidence with each suggestion.

Test Plan: Need to write tests

Reviewers: julienv

Differential Revision: https://phabricator.fb.com/D532923

Task ID: 1146337
Fixed tuple patch and print out code snippet of evidence

Summary: Fixed the tuple patch in order to print out a tuple of the types associated with a tuple used as a parameter or a return value. Also added error handling for containers that can not be typed, ie a vector of an unknown type etc.When displaying evidence, a line of code is now displayed.

Test Plan:

Reviewers: julienv

CC:

Task ID: #1146337

Blame Rev:
Manual patch for confused arrays

Summary: Added a prompt to manually select the container and enter the type for confused arrays. Also fixed a bug so that key and values with no type information do not negatively impact inferencing algorithm. Basically ignore the type if it can not be inferred, in order to not save the uninferred type, Tsum[], as the type of the key or value.

Test Plan: Manual tests, need to add unit tests

Reviewers: julienv

Differential Revision: https://phabricator.fb.com/D537082

Task ID: 1146337
bug fixes for array container guesser

Summary: Cleaned up interactive patching. Fixed bugs in order to infer and patch arrays that have no assignment.

Test Plan: Manual tests, automating this afternoon and will add

Reviewers: julienv, pad

Differential Revision: https://phabricator.fb.com/D541728

Task ID: 1146337
Merge branch 'master' of git://github.com/facebook/pfff