<?php
class fact {
	
	var $name;
	var $arguments;
	
	function fact($name, $arguments){
		//creates a fact of the form
		//name(argument1, argument2, argument3)
		$this->name = $name;
		$this->arguments = $arguments;
	}
		
	function fully_instantiated(){
		$flag = "true";
		foreach($this->arguments as $argument){
			if(get_class($argument) == "variable" && $argument->instantiated == "false"){
				$flag = "false";	
			}
		}
		return "false";	
	}	
		
	
	function toString(){
		//creates a string representation for this fact
		//essential for deubgging purposes
	  	$representation = $this->name . "(";
	  	foreach($this->arguments as $argument){
	  		$representation .= $argument->toString();
	  		$representation .= ", ";	
	  	}	
	  	$representation = rtrim($representation, " \,");
	  	$representation .= ")"; //need to kill the trailing comma and space
	  	return $representation;
	}
		
}
?>