Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Samahussien7 authored May 17, 2023
1 parent ff01d5d commit 9c145e9
Show file tree
Hide file tree
Showing 15 changed files with 1,935 additions and 0 deletions.
439 changes: 439 additions & 0 deletions Law-expert_system/Family_Court_GUI/Family_Court_GUI.py

Large diffs are not rendered by default.

Binary file added Law-expert_system/GUI_screen_shots.pdf
Binary file not shown.
Binary file added Law-expert_system/Project_Intro_Logic.pdf
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# compiled_pyke_files.py

from pyke import target_pkg

pyke_version = '1.1.1'
compiler_version = 1
target_pkg_version = 1

try:
loader = __loader__
except NameError:
loader = None

def get_target_pkg():
return target_pkg.target_pkg(__name__, __file__, pyke_version, loader, {
('', '', 'facts.kfb'):
[1671883621.1383839, 'facts.fbc'],
('', '', 'questions.kqb'):
[1671883621.15832, 'questions.qbc'],
('', '', 'rules.krb'):
[1671883621.214132, 'rules_bc.py'],
},
compiler_version)

Binary file not shown.
Binary file not shown.
1,134 changes: 1,134 additions & 0 deletions Law-expert_system/pythonProject/Law_system/compiled_krb/rules_bc.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Law-expert_system/pythonProject/Law_system/facts.kfb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



26 changes: 26 additions & 0 deletions Law-expert_system/pythonProject/Law_system/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import contextlib
import sys

from pyke import knowledge_engine
from pyke import krb_traceback

engine = knowledge_engine.engine(__file__)

def family_court():

engine.reset()

engine.activate('rules')

try:
with engine.prove_goal('rules.what_to_happen($event)') as rule:
for vars, plan in rule:
print("%s" % (vars['event']))
except Exception:
krb_traceback.print_exc()
sys.exit(1)

print()
print("thanks for using our system")
family_court()

138 changes: 138 additions & 0 deletions Law-expert_system/pythonProject/Law_system/questions.kqb
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# questions.kqb
is_it_divorce_case($ans)
If it is aliment case enter y if it is incubation n?
---
$ans =yn

is_M_have_incubation($ans)
Does the mother have the incubation?
---
$ans =yn

is_child_under_2years($ans)
Is the child under 2 years?
---
$ans =yn

is_wife_staying_your_house($ans)
is the wife staying in the house?
---
$ans =yn

is_D_rich($ans)
Is the husband rich enough to pay a servant?
---
$ans =yn

ch_div_st($ans)
What is the kind of divorce?
---
$ans = select_1
1: Normal divorce
2: Wife divorced the Husband
3: Divorced for harm
4: None of the above
! Sorry, that is impossible

any_defect($ans)
If the wife have done any of these defects enter y if not enter n
1! prevented herself from her husband without a legitimate excuse
2! left their home without a legitimate excuse
3! prevented her husband from entering their house without a legitimate excuse
4! A case was issued restricting her freedom in the rights of her husband
5! She broke her commitment to her husband?
---
$ans =yn

is_it_in_contract($ans)
Is the after divorce money in the marriage contract?
---
$ans =yn

is_there_witness($ans)
Is there any witness on the contract?
---
$ans =yn


is_ch_und_15($ans)
Do you have a girl under 17 or a boy under 15?
---
$ans=yn


any_def_m($ans)
If mother not alive or alive suffering from any of these enter y if not enter n
1! she is insane
2! have diseases prevent her from raising the children
3! she is addicted to drugs
4! she is proven cheating on her husband
5! she will travel outside the country and take the kids
6! she is married to a stranger from the child
7! she did practice professions that violate religion and the law
8! She is not trusted, such as if she frequently go out and leave the child alone?
---
$ans =yn

any_def_f($ans)
If father not alive or alive suffering from any of these enter y if not enter n
1! he is insane
2! he has commit crimes before
3! he is immoral
4! he do not have a woman in the house to raise the children
5! he will travel outside the country and take the kids
6! it been 6 months before the father raised the case without an acceptable excuse?
---
$ans =yn

any_def_mm($ans)
If mothers mother dead or alive suffering from any of these enter y if not enter n
1! she is insane
2! have diseases prevent her from raising the children
3! she is addicted to drugs
4! she is proven cheating on her husband
5! she will travel outside the country and take the kids
6! she is married to a stranger from the child
7! she did practice professions that violate religion and the law
8! She is not trusted, such as if she frequently go out and leave the child alone?
---
$ans =yn

any_def_fm($ans)
If fathers mother dead or alive suffers from any of these enter y if not enter n
1! she is insane
2! have diseases prevent her from raising the children
3! she is addicted to drugs
4! she is proven cheating on her husband
5! she will travel outside the country and take the kids
6! she is married to a stranger from the child
7! she did practice professions that violate religion and the law
8! She is not trusted, such as if she frequently go out and leave the child alone?
---
$ans =yn

any_def_ms($ans)
If mothers sister dead or alive suffers from any of these enter y if not enter n
1! she is insane
2! have diseases prevent her from raising the children
3! she is addicted to drugs
4! she is proven cheating on her husband
5! she will travel outside the country and take the kids
6! she is married to a stranger from the child
7! she did practice professions that violate religion and the law
8! She is not trusted, such as if she frequently go out and leave the child alone?
---
$ans =yn

any_def_fs($ans)
If fathers sister dead or alive suffers from any of these enter y if not enter n
1! she is insane
2! have diseases prevent her from raising the children
3! she is addicted to drugs
4! she is proven cheating on her husband
5! she will travel outside the country and take the kids
6! she is married to a stranger from the child
7! she did practice professions that violate religion and the law
8! She is not trusted, such as if she frequently go out and leave the child alone?
---
$ans =yn
171 changes: 171 additions & 0 deletions Law-expert_system/pythonProject/Law_system/rules.krb
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
no_money
use what_to_happen(husband_will_not_pay_money_for_kids_incubation)
when
questions.is_it_divorce_case(True)
questions.is_M_have_incubation(False)

inc
use what_to_happen(husband_will_pay_money_for_kids_incubation)
when
questions.is_it_divorce_case(True)
questions.is_M_have_incubation(True)

kids
use what_to_happen(husband_will_pay_money_for_kids_to_live_a_suitable_life)
when
questions.is_it_divorce_case(True)
questions.is_M_have_incubation(True)

brea
use what_to_happen(husband_will_pay_for_breastfeeding)
when
questions.is_it_divorce_case(True)
questions.is_M_have_incubation(True)
questions.is_child_under_2years(True)

house
use what_to_happen(husband_will_pay_rent_for_kids_house)
when
questions.is_it_divorce_case(True)
questions.is_M_have_incubation(True)
questions.is_wife_staying_your_house(False)

servant
use what_to_happen(husband_will_pay_for_a_servant)
when
questions.is_it_divorce_case(True)
questions.is_M_have_incubation(True)
questions.is_D_rich(True)

her_divorce
use what_to_happen(the_wife_will_give_up_on_all_her_rights)
when
questions.is_it_divorce_case(True)
questions.ch_div_st($ans)
check $ans in (2,)

her_div
use what_to_happen(the_wife_will_give_husband_money_before_marriage_back)
when
questions.is_it_divorce_case(True)
questions.ch_div_st($ans)
check $ans in (2,)

harm_expense
use what_to_happen(husband_pay_expense_from_2to5_years_of_the_monthly_aliment)
when
questions.is_it_divorce_case(True)
questions.ch_div_st($ans)
check $ans in (3,)
questions.any_defect(False)

not_harm_expense
use what_to_happen(husband_pay_24_month_expense_of_the_monthly_aliment)
when
questions.is_it_divorce_case(True)
questions.ch_div_st($ans)
check $ans in (1,)
questions.any_defect(False)

expense
use what_to_happen(husband_pay_3_month_expense_of_the_monthly_aliment)
when
questions.is_it_divorce_case(True)
questions.ch_div_st($ans)
check $ans in (1,3)
questions.any_defect(False)

after_divorce
use what_to_happen(husband_pay_after_divorce_money)
when
questions.is_it_divorce_case(True)
questions.ch_div_st($ans)
check $ans in (1,3)
questions.is_it_in_contract(True)
questions.any_defect(False)

aft_divorce
use what_to_happen(husband_pay_after_divorce_money)
when
questions.is_it_divorce_case(True)
questions.ch_div_st($ans)
check $ans in (1,3)
questions.is_it_in_contract(False)
questions.is_there_witness(True)
questions.any_defect(False)

incubation
use what_to_happen(there_is_no_incubation_the_children_free_to_choose_who_to_live_with)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(False)

m_incubation
use what_to_happen(the_mother_will_have_the_incubation)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(True)
questions.any_def_m(False)

f_incubation
use what_to_happen(the_father_will_have_the_incubation)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(True)
questions.any_def_m(True)
questions.any_def_f(False)

mm_incubation
use what_to_happen(the_mothers_mother_will_have_the_incubation)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(True)
questions.any_def_m(True)
questions.any_def_f(True)
questions.any_def_mm(False)


fm_incubation
use what_to_happen(the_fathers_mother_will_have_the_incubation)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(True)
questions.any_def_m(True)
questions.any_def_f(True)
questions.any_def_mm(True)
questions.any_def_fm(False)

ms_incubation
use what_to_happen(the_mothers_sister_will_have_the_incubation)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(True)
questions.any_def_m(True)
questions.any_def_f(True)
questions.any_def_mm(True)
questions.any_def_fm(True)
questions.any_def_ms(False)

fs_incubation
use what_to_happen(the_fathers_sister_will_have_the_incubation)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(True)
questions.any_def_m(True)
questions.any_def_f(True)
questions.any_def_mm(True)
questions.any_def_fm(True)
questions.any_def_ms(True)
questions.any_def_fs(False)

no_incubation
use what_to_happen(the_child_will_go_to_a_shelter)
when
questions.is_it_divorce_case(False)
questions.is_ch_und_15(True)
questions.any_def_m(True)
questions.any_def_f(True)
questions.any_def_mm(True)
questions.any_def_fm(True)
questions.any_def_ms(True)
questions.any_def_fs(True)

0 comments on commit 9c145e9

Please sign in to comment.